From a45c89ecd1ce41ce2c95b0fac39e7fe217711f25 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 Aug 2019 15:18:42 +0200 Subject: [PATCH] integration/secret: fix TestSecretInspect not actually checking response Signed-off-by: Sebastiaan van Stijn --- integration/secret/secret_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/integration/secret/secret_test.go b/integration/secret/secret_test.go index 6917fd993b..48e311c213 100644 --- a/integration/secret/secret_test.go +++ b/integration/secret/secret_test.go @@ -3,6 +3,7 @@ package secret // import "github.com/docker/docker/integration/secret" import ( "bytes" "context" + "encoding/json" "sort" "testing" "time" @@ -30,16 +31,17 @@ func TestSecretInspect(t *testing.T) { ctx := context.Background() - testName := "test_secret_" + t.Name() + testName := t.Name() secretID := createSecret(ctx, t, c, testName, []byte("TESTINGDATA"), nil) - secret, _, err := c.SecretInspectWithRaw(context.Background(), secretID) + insp, body, err := c.SecretInspectWithRaw(ctx, secretID) assert.NilError(t, err) - assert.Check(t, is.Equal(secret.Spec.Name, testName)) + assert.Check(t, is.Equal(insp.Spec.Name, testName)) - secret, _, err = c.SecretInspectWithRaw(context.Background(), testName) + var secret swarmtypes.Secret + err = json.Unmarshal(body, &secret) assert.NilError(t, err) - assert.Check(t, is.Equal(secretID, secretID)) + assert.Check(t, is.DeepEqual(secret, insp)) } func TestSecretList(t *testing.T) {