|
| 1 | +*** Settings *** |
| 2 | +Resource ${CURDIR}/stackql.resource |
| 3 | + |
| 4 | +*** Test Cases *** |
| 5 | + |
| 6 | +IDFed AWS S3 Buckets List |
| 7 | + Sleep 2s |
| 8 | + ${awsRoleArn} = OperatingSystem.Get Environment Variable STACKQL_IDFED_ROLE_ARN |
| 9 | + Should Not Be Empty ${awsRoleArn} |
| 10 | + ${awsAuthCfg} = Catenate |
| 11 | + ... { "aws": { "type":"aws_web_identity", "aws_role_arn": "${awsRoleArn}", "aws_sts_region": "us-east-1", "oidc_subject_token_file_env_var": "OIDC_SUBJECT_TOKEN_FILE" } } |
| 12 | + ${bucketsListQuery} = Catenate |
| 13 | + ... select * from aws.s3.buckets where region = 'ap-southeast-2'; |
| 14 | + ${result} = Run Process |
| 15 | + ... ${STACKQL_EXE} |
| 16 | + ... \-\-auth |
| 17 | + ... ${awsAuthCfg} |
| 18 | + ... \-\-registry |
| 19 | + ... { "url": "file://${REPOSITORY_ROOT}/test/registry", "localDocRoot": "${REPOSITORY_ROOT}/test/registry", "verifyConfig": { "nopVerify": true } } |
| 20 | + ... exec |
| 21 | + ... ${bucketsListQuery} |
| 22 | + ... cwd=${REPOSITORY_ROOT} |
| 23 | + ... stdout=${CURDIR}/tmp/IDFed-AWS-S3-Buckets-List.tmp |
| 24 | + ... stderr=${CURDIR}/tmp/IDFed-AWS-S3-Buckets-List-stderr.tmp |
| 25 | + Should Be Equal As Integers ${result.rc} 0 |
| 26 | + Should Be Empty ${result.stderr} |
| 27 | + Should Contain ${result.stdout} stackql-trial-bucket-02 |
| 28 | + |
| 29 | +IDFed Azure VNETs List |
| 30 | + Sleep 2s |
| 31 | + ${azureTargetSubscription} = OperatingSystem.Get Environment Variable AZURE_TARGET_SUBSCRIPTION_ID |
| 32 | + Should Not Be Empty ${azureTargetSubscription} |
| 33 | + ${azureAuthCfg} = Catenate |
| 34 | + ... { "azure": { "type": "azure_federated", "azure_tenant_id": "${AZURE_TENANT_ID}", "client_id": "${AZURE_CLIENT_ID}", "scopes": ["https://management.azure.com/.default"], "oidc_subject_token_file_env_var": "OIDC_SUBJECT_TOKEN_FILE" } } |
| 35 | + ${bucketsListQuery} = Catenate |
| 36 | + ... select location, name from azure.network.virtual_networks where subscriptionId = '${azureTargetSubscription}'; |
| 37 | + ${result} = Run Process |
| 38 | + ... ${STACKQL_EXE} |
| 39 | + ... \-\-auth |
| 40 | + ... ${azureAuthCfg} |
| 41 | + ... \-\-registry |
| 42 | + ... { "url": "file://${REPOSITORY_ROOT}/test/registry", "localDocRoot": "${REPOSITORY_ROOT}/test/registry", "verifyConfig": { "nopVerify": true } } |
| 43 | + ... exec |
| 44 | + ... ${bucketsListQuery} |
| 45 | + ... cwd=${REPOSITORY_ROOT} |
| 46 | + ... stdout=${CURDIR}/tmp/IDFed-Azure-VNETs-List.tmp |
| 47 | + ... stderr=${CURDIR}/tmp/IDFed-Azure-VNETs-List-stderr.tmp |
| 48 | + Should Be Equal As Integers ${result.rc} 0 |
| 49 | + Should Be Empty ${result.stderr} |
| 50 | + Should Contain ${result.stdout} inspector-network |
| 51 | + |
| 52 | +IDFed Google Buckets List |
| 53 | + Sleep 2s |
| 54 | + ${gcpAudience} = OperatingSystem.Get Environment Variable GCP_OIDC_AUDIENCE |
| 55 | + ${gcpServiceAccount} = OperatingSystem.Get Environment Variable GCP_SERVICE_ACCOUNT_EMAIL |
| 56 | + Should Not Be Empty ${gcpAudience} |
| 57 | + Should Not Be Empty ${gcpServiceAccount} |
| 58 | + ${gcpAuthCfg} = Catenate |
| 59 | + ... { "google": { "type": "gcp_workload_identity", "gcp_workload_identity_audience": "${gcpAudience}", "gcp_service_account_impersonation_url": "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/${gcpServiceAccount}:generateAccessToken", "scopes": ["https://www.googleapis.com/auth/cloud-platform"], "oidc_subject_token_file_env_var": "OIDC_SUBJECT_TOKEN_FILE" } } |
| 60 | + ${bucketsListQuery} = Catenate |
| 61 | + ... select location, name from google.storage.buckets where project = 'stackql-demo'; |
| 62 | + ${result} = Run Process |
| 63 | + ... ${STACKQL_EXE} |
| 64 | + ... \-\-auth |
| 65 | + ... ${gcpAuthCfg} |
| 66 | + ... \-\-registry |
| 67 | + ... { "url": "file://${REPOSITORY_ROOT}/test/registry", "localDocRoot": "${REPOSITORY_ROOT}/test/registry", "verifyConfig": { "nopVerify": true } } |
| 68 | + ... exec |
| 69 | + ... ${bucketsListQuery} |
| 70 | + ... cwd=${REPOSITORY_ROOT} |
| 71 | + ... stdout=${CURDIR}/tmp/IDFed-Google-Buckets-List.tmp |
| 72 | + ... stderr=${CURDIR}/tmp/IDFed-Google-Buckets-List-stderr.tmp |
| 73 | + Should Be Equal As Integers ${result.rc} 0 |
| 74 | + Should Be Empty ${result.stderr} |
| 75 | + Should Contain ${result.stdout} stackql-demo-bucket |
0 commit comments