@@ -1068,8 +1068,11 @@ Summary Report for compliance: my-custom-spec
1068
1068
MisconfOptions : flag.MisconfOptions {IncludeNonFailures : true },
1069
1069
},
1070
1070
cacheContent : "testdata/s3andcloudtrailcache.json" ,
1071
- allServices : []string {"s3" , "cloudtrail" },
1072
- want : expectedS3AndCloudTrailResult ,
1071
+ allServices : []string {
1072
+ "s3" ,
1073
+ "cloudtrail" ,
1074
+ },
1075
+ want : expectedS3AndCloudTrailResult ,
1073
1076
},
1074
1077
{
1075
1078
name : "skip certain services and include specific services" ,
@@ -1087,7 +1090,10 @@ Summary Report for compliance: my-custom-spec
1087
1090
MisconfOptions : flag.MisconfOptions {IncludeNonFailures : true },
1088
1091
},
1089
1092
cacheContent : "testdata/s3andcloudtrailcache.json" ,
1090
- allServices : []string {"s3" , "cloudtrail" },
1093
+ allServices : []string {
1094
+ "s3" ,
1095
+ "cloudtrail" ,
1096
+ },
1091
1097
// we skip cloudtrail but still expect results from it as it is cached
1092
1098
want : expectedS3AndCloudTrailResult ,
1093
1099
},
@@ -1096,16 +1102,23 @@ Summary Report for compliance: my-custom-spec
1096
1102
options : flag.Options {
1097
1103
RegoOptions : flag.RegoOptions {SkipPolicyUpdate : true },
1098
1104
AWSOptions : flag.AWSOptions {
1099
- Region : "us-east-1" ,
1100
- SkipServices : []string {"cloudtrail" , "iam" },
1101
- Account : "12345678" ,
1105
+ Region : "us-east-1" ,
1106
+ SkipServices : []string {
1107
+ "cloudtrail" ,
1108
+ "iam" ,
1109
+ },
1110
+ Account : "12345678" ,
1102
1111
},
1103
1112
CloudOptions : flag.CloudOptions {
1104
1113
MaxCacheAge : time .Hour * 24 * 365 * 100 ,
1105
1114
},
1106
1115
MisconfOptions : flag.MisconfOptions {IncludeNonFailures : true },
1107
1116
},
1108
- allServices : []string {"s3" , "cloudtrail" , "iam" },
1117
+ allServices : []string {
1118
+ "s3" ,
1119
+ "cloudtrail" ,
1120
+ "iam" ,
1121
+ },
1109
1122
cacheContent : "testdata/s3onlycache.json" ,
1110
1123
want : expectedS3ScanResult ,
1111
1124
},
@@ -1129,7 +1142,7 @@ Summary Report for compliance: my-custom-spec
1129
1142
},
1130
1143
}
1131
1144
1132
- clock .SetFakeTime ( t , time .Date (2021 , 8 , 25 , 12 , 20 , 30 , 5 , time .UTC ))
1145
+ ctx := clock .With ( context . Background () , time .Date (2021 , 8 , 25 , 12 , 20 , 30 , 5 , time .UTC ))
1133
1146
for _ , test := range tests {
1134
1147
t .Run (test .name , func (t * testing.T ) {
1135
1148
if test .allServices != nil {
@@ -1179,7 +1192,7 @@ Summary Report for compliance: my-custom-spec
1179
1192
require .NoError (t , os .WriteFile (cacheFile , cacheData , 0600 ))
1180
1193
}
1181
1194
1182
- err := Run (context . Background () , test .options )
1195
+ err := Run (ctx , test .options )
1183
1196
if test .expectErr {
1184
1197
assert .Error (t , err )
1185
1198
return
0 commit comments