Skip to content

Commit

Permalink
test: initialise tests in each test file
Browse files Browse the repository at this point in the history
Signed-off-by: Nikita Pivkin <[email protected]>
  • Loading branch information
nikpivkin authored and simar7 committed Aug 22, 2024
1 parent 15db71e commit 78a74ef
Show file tree
Hide file tree
Showing 30 changed files with 142 additions and 57 deletions.
4 changes: 4 additions & 0 deletions test/rego/aws_access_analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(awsAccessAnalyzerTestCases)
}

var awsAccessAnalyzerTestCases = testCases{
"AVD-AWS-0175": {
// TODO: Trivy does not export empty structures into Rego
Expand Down
4 changes: 4 additions & 0 deletions test/rego/aws_athena_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(awsAthenaTestCases)
}

var awsAthenaTestCases = testCases{
"AVD-AWS-0006": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/aws_cloudtrail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(awsCloudTrailTestCases)
}

var awsCloudTrailTestCases = testCases{
"AVD-AWS-0014": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/aws_codebuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(awsCodeBuildTestCases)
}

var awsCodeBuildTestCases = testCases{
"AVD-AWS-0018": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/aws_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(awsConfigTestCases)
}

var awsConfigTestCases = testCases{
"AVD-AWS-0019": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/aws_document_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(awsDocumentDBTestCases)
}

var awsDocumentDBTestCases = testCases{
"AVD-AWS-0020": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/aws_dynamodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(awsDynamodbTestCases)
}

var awsDynamodbTestCases = testCases{
"AVD-AWS-0023": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/aws_s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(awsS3TestCases)
}

var awsS3TestCases = testCases{
"AVD-AWS-0086": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_appservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureAppServiceTestCases)
}

var azureAppServiceTestCases = testCases{
"AVD-AZU-0002": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_authorization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureAuthorizationTestCases)
}

var azureAuthorizationTestCases = testCases{
"AVD-AZU-0030": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_compute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureComputeTestCases)
}

var azureComputeTestCases = testCases{
"AVD-AZU-0039": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureContainerTestCases)
}

var azureContainerTestCases = testCases{
"AVD-AZU-0043": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureDatabaseTestCases)
}

var azureDatabaseTestCases = testCases{
"AVD-AZU-0028": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_datafactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureDataFactoryTestCases)
}

var azureDataFactoryTestCases = testCases{
"AVD-AZU-0035": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_datalake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureDataLakeTestCases)
}

var azureDataLakeTestCases = testCases{
"AVD-AZU-0036": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_keyvault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureKeyVaultTestCases)
}

var azureKeyVaultTestCases = testCases{
"AVD-AZU-0015": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureMonitorTestCases)
}

var azureMonitorTestCases = testCases{
"AVD-AZU-0031": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureNetworkTestCases)
}

var azureNetworkTestCases = testCases{
"AVD-AZU-0048": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_securitycenter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureSecurityCenterTestCases)
}

var azureSecurityCenterTestCases = testCases{
"AVD-AZU-0044": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/azure_synapse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(azureSynapseTestCases)
}

var azureSynapseTestCases = testCases{
"AVD-AZU-0034": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/digitalocean_spaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(digitalOceanSpacesTestCases)
}

var digitalOceanSpacesTestCases = testCases{
"AVD-DIG-0006": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(githubTestCases)
}

var githubTestCases = testCases{
"AVD-GIT-0004": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/google_bigquery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(googleBigQueryTestCases)
}

var googleBigQueryTestCases = testCases{
"AVD-GCP-0046": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/google_dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(googleDnsTestCases)
}

var googleDnsTestCases = testCases{
"AVD-GCP-0013": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/google_kms_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(googleKmsTestCases)
}

var googleKmsTestCases = testCases{
"AVD-GCP-0065": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/nifcloud_dns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(nifcloudDnsTestCases)
}

var nifcloudDnsTestCases = testCases{
"AVD-NIF-0007": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/nifcloud_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(nifcloudNetworkTestCases)
}

var nifcloudNetworkTestCases = testCases{
"AVD-NIF-0016": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/nifcloud_sslcertificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(nifcloudSslCertificateTestCases)
}

var nifcloudSslCertificateTestCases = testCases{
"AVD-NIF-0006": {
{
Expand Down
4 changes: 4 additions & 0 deletions test/rego/oracle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (
trivyTypes "github.com/aquasecurity/trivy/pkg/iac/types"
)

func init() {
addTests(oracleTestCases)
}

var oracleTestCases = testCases{
"AVD-OCI-0001": {
{
Expand Down
Loading

0 comments on commit 78a74ef

Please sign in to comment.