Fix more awskms test brokenness

This commit is contained in:
Jeff Mitchell 2018-11-13 13:01:40 -05:00
parent e5aad14d79
commit 9735bd7d69

View file

@ -23,7 +23,9 @@ func TestAWSKMSSeal(t *testing.T) {
} }
// Set the key // Set the key
oldKeyID := os.Getenv(EnvAWSKMSSealKeyID)
os.Setenv(EnvAWSKMSSealKeyID, awsTestKeyID) os.Setenv(EnvAWSKMSSealKeyID, awsTestKeyID)
defer os.Setenv(EnvAWSKMSSealKeyID, oldKeyID)
_, err = s.SetConfig(nil) _, err = s.SetConfig(nil)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
@ -38,7 +40,9 @@ func TestAWSKMSSeal_Lifecycle(t *testing.T) {
s.client = &mockAWSKMSSealClient{ s.client = &mockAWSKMSSealClient{
keyID: aws.String(awsTestKeyID), keyID: aws.String(awsTestKeyID),
} }
oldKeyID := os.Getenv(EnvAWSKMSSealKeyID)
os.Setenv(EnvAWSKMSSealKeyID, awsTestKeyID) os.Setenv(EnvAWSKMSSealKeyID, awsTestKeyID)
defer os.Setenv(EnvAWSKMSSealKeyID, oldKeyID)
testEncryptionRoundTrip(t, s) testEncryptionRoundTrip(t, s)
} }