mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
test(aws): move part of unit tests to integration (#4884)
* test(aws): move part of unit tests to integration * fix typo * fix test --------- Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
@@ -982,41 +982,6 @@ func Test_Run(t *testing.T) {
|
||||
allServices []string
|
||||
inputData string
|
||||
}{
|
||||
{
|
||||
name: "fail without region",
|
||||
options: flag.Options{
|
||||
RegoOptions: flag.RegoOptions{SkipPolicyUpdate: true},
|
||||
},
|
||||
want: "",
|
||||
expectErr: true,
|
||||
},
|
||||
{
|
||||
name: "fail without creds",
|
||||
options: flag.Options{
|
||||
RegoOptions: flag.RegoOptions{SkipPolicyUpdate: true},
|
||||
AWSOptions: flag.AWSOptions{
|
||||
Region: "us-east-1",
|
||||
},
|
||||
},
|
||||
want: "",
|
||||
expectErr: true,
|
||||
},
|
||||
{
|
||||
name: "try to call aws if cache is expired",
|
||||
options: flag.Options{
|
||||
RegoOptions: flag.RegoOptions{SkipPolicyUpdate: true},
|
||||
AWSOptions: flag.AWSOptions{
|
||||
Region: "us-east-1",
|
||||
Services: []string{"s3"},
|
||||
Account: "12345678",
|
||||
},
|
||||
CloudOptions: flag.CloudOptions{
|
||||
MaxCacheAge: time.Minute,
|
||||
},
|
||||
},
|
||||
cacheContent: "testdata/s3onlycache.json",
|
||||
expectErr: true,
|
||||
},
|
||||
{
|
||||
name: "succeed with cached infra",
|
||||
options: flag.Options{
|
||||
|
||||
Reference in New Issue
Block a user