diff --git a/config/shared_config_test.go b/config/shared_config_test.go index f5195ecb4f5..3fb8960ac9d 100644 --- a/config/shared_config_test.go +++ b/config/shared_config_test.go @@ -593,6 +593,12 @@ func TestLoadSharedConfigFromSection(t *testing.T) { Profile: "profile partial_creds", Expected: SharedConfig{}, }, + "profile with role duration": { + Profile: "profile with_role_duration", + Expected: SharedConfig{ + RoleDurationSeconds: aws.Duration(3601 * time.Second), + }, + }, "profile with complete creds": { Profile: "profile complete_creds", Expected: SharedConfig{ @@ -689,12 +695,12 @@ func TestLoadSharedConfigFromSection(t *testing.T) { } return } - if err != nil { t.Fatalf("expect no error, got %v", err) } - if e, a := c.Expected, cfg; !reflect.DeepEqual(e, a) { - t.Errorf("expect %v, got %v", e, a) + + if diff := cmp.Diff(c.Expected, cfg); diff != "" { + t.Errorf("expect shared config match\n%s", diff) } }) } diff --git a/config/testdata/shared_config b/config/testdata/shared_config index ee2c7b9961c..dc3886ba455 100644 --- a/config/testdata/shared_config +++ b/config/testdata/shared_config @@ -13,6 +13,9 @@ aws_secret_access_key = SECRET [profile alt_profile_name] region = alt_profile_name_region +[profile with_role_duration] +duration_seconds = 3601 + [profile short_profile_name_first] region = short_profile_name_first_short