diff --git a/vault/seal/awskms/awskms_test.go b/vault/seal/awskms/awskms_test.go index e11e9452a..1b2a45c6b 100644 --- a/vault/seal/awskms/awskms_test.go +++ b/vault/seal/awskms/awskms_test.go @@ -23,7 +23,9 @@ func TestAWSKMSSeal(t *testing.T) { } // Set the key + oldKeyID := os.Getenv(EnvAWSKMSSealKeyID) os.Setenv(EnvAWSKMSSealKeyID, awsTestKeyID) + defer os.Setenv(EnvAWSKMSSealKeyID, oldKeyID) _, err = s.SetConfig(nil) if err != nil { t.Fatal(err) @@ -38,7 +40,9 @@ func TestAWSKMSSeal_Lifecycle(t *testing.T) { s.client = &mockAWSKMSSealClient{ keyID: aws.String(awsTestKeyID), } + oldKeyID := os.Getenv(EnvAWSKMSSealKeyID) os.Setenv(EnvAWSKMSSealKeyID, awsTestKeyID) + defer os.Setenv(EnvAWSKMSSealKeyID, oldKeyID) testEncryptionRoundTrip(t, s) }