@@ -44,6 +44,7 @@ output=json
44
44
keyring , err := getKeyring ("test" )
45
45
assert .NoError (t , err )
46
46
47
+ mfaSerial := "arn:aws:iam::111111111111:mfa/test-user"
47
48
setupConfig := SetupConfig {
48
49
// Config
49
50
Logger : logger ,
@@ -61,11 +62,28 @@ output=json
61
62
// Profiles
62
63
BaseProfileName : "test-id-base" ,
63
64
AWSProfileAccounts : []string {"test-id:123456789012" },
65
+ MFASerial : mfaSerial ,
64
66
}
65
67
err = setupConfig .UpdateAWSConfigFile ()
66
68
assert .NoError (t , err )
67
69
68
- // TODO: Check contents of file
70
+ // re-load the config file
71
+ config , err = vault .LoadConfig (f )
72
+ assert .NoError (t , err )
73
+
74
+ testBaseSection , ok := config .ProfileSection ("test-id-base" )
75
+ assert .True (t , ok )
76
+ assert .Equal (t , len (testBaseSection .MfaSerial ), 0 )
77
+ assert .Equal (t , testBaseSection .Region , "us-west-2" )
78
+ // assert.Equal(t, testBaseSection.Output, "json")
79
+
80
+ testSection , ok := config .ProfileSection ("test-id" )
81
+ assert .True (t , ok )
82
+ assert .Equal (t , testSection .SourceProfile , "test-id-base" )
83
+ assert .Equal (t , testSection .MfaSerial , mfaSerial )
84
+ assert .Equal (t , testSection .RoleARN , "arn:aws:iam::123456789012:role/test-role" )
85
+ assert .Equal (t , testSection .Region , "us-west-2" )
86
+ // assert.Equal(t, testBaseSection.Output, "json")
69
87
}
70
88
71
89
func TestGenerateQrCode (t * testing.T ) {
0 commit comments