mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-03 12:36:09 -04:00
deps: update Go to v1.24.2 (#3750)
* deps: update Go to v1.24.2 * tests: replace context.Background() with t.Context() --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
a7f9561a3d
commit
4e5c213b4d
112 changed files with 287 additions and 316 deletions
|
@ -116,7 +116,7 @@ func TestCreateCertChainCache(t *testing.T) {
|
|||
assert := assert.New(t)
|
||||
require := require.New(t)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
c := &Client{
|
||||
attVariant: variant.Dummy{},
|
||||
|
@ -204,7 +204,7 @@ func TestGetCertChainCache(t *testing.T) {
|
|||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
c := NewClient(logger.NewTest(t), tc.kubeClient, variant.Dummy{})
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ func TestGetDataKey(t *testing.T) {
|
|||
|
||||
client.grpc = tc.client
|
||||
|
||||
res, err := client.GetDataKey(context.Background(), "disk-uuid", 32)
|
||||
res, err := client.GetDataKey(t.Context(), "disk-uuid", 32)
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
} else {
|
||||
|
|
|
@ -201,7 +201,7 @@ func TestIssueJoinTicket(t *testing.T) {
|
|||
DiskUuid: "uuid",
|
||||
IsControlPlane: tc.isControlPlane,
|
||||
}
|
||||
resp, err := api.IssueJoinTicket(context.Background(), req)
|
||||
resp, err := api.IssueJoinTicket(t.Context(), req)
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
return
|
||||
|
@ -265,7 +265,7 @@ func TestIssueRejoinTicker(t *testing.T) {
|
|||
req := &joinproto.IssueRejoinTicketRequest{
|
||||
DiskUuid: uuid,
|
||||
}
|
||||
resp, err := api.IssueRejoinTicket(context.Background(), req)
|
||||
resp, err := api.IssueRejoinTicket(t.Context(), req)
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
return
|
||||
|
|
|
@ -147,7 +147,7 @@ func TestUpdate(t *testing.T) {
|
|||
|
||||
// test connection to server
|
||||
clientOID := variant.Dummy{}
|
||||
resp, err := testConnection(require, server.URL, clientOID)
|
||||
resp, err := testConnection(t.Context(), require, server.URL, clientOID)
|
||||
require.NoError(err)
|
||||
defer resp.Body.Close()
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
|
@ -159,7 +159,7 @@ func TestUpdate(t *testing.T) {
|
|||
require.NoError(validator.Update())
|
||||
|
||||
// client connection should fail now, since the server's validator expects a different OID from the client
|
||||
resp, err = testConnection(require, server.URL, clientOID)
|
||||
resp, err = testConnection(t.Context(), require, server.URL, clientOID)
|
||||
if err == nil {
|
||||
defer resp.Body.Close()
|
||||
}
|
||||
|
@ -230,12 +230,12 @@ func TestUpdateConcurrency(t *testing.T) {
|
|||
wg.Wait()
|
||||
}
|
||||
|
||||
func testConnection(require *require.Assertions, url string, oid variant.Getter) (*http.Response, error) {
|
||||
func testConnection(ctx context.Context, require *require.Assertions, url string, oid variant.Getter) (*http.Response, error) {
|
||||
clientConfig, err := atls.CreateAttestationClientTLSConfig(fakeIssuer{oid}, nil)
|
||||
require.NoError(err)
|
||||
client := http.Client{Transport: &http.Transport{TLSClientConfig: clientConfig}}
|
||||
|
||||
req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, url, http.NoBody)
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, http.NoBody)
|
||||
require.NoError(err)
|
||||
return client.Do(req)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue