Skip to content

Commit

Permalink
fix: make integration test work
Browse files Browse the repository at this point in the history
  • Loading branch information
Ao Zhang committed Nov 15, 2023
1 parent 95b2079 commit 4dc3dd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ variable "integration_name" {

variable "client_id" {
type = string
default = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

variable "client_secret" {
type = string
default = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
sensitive = true
}

variable "integration_level" {
Expand All @@ -28,28 +27,27 @@ variable "integration_level" {

variable "blob_container_name" {
type = string
default = "blob container name"
default = "blob-container-name"
}

# TODO: make this fully qualified
variable "scanning_subscription_id" {
type = string
default = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
default = "0252a545-04d4-4262-a82c-ceef83344237"
}

variable "scanning_resource_group_name" {
type = string
default = "abcd"
default = "AWLS-kilby-test"
}

variable "storage_account_url" {
type = string
default = "https://blobabc.blob.core.windows.net"
default = "https://aoztest.blob.core.windows.net/"
}

variable "tenant_id" {
type = string
default = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
default = "a329d4bf-4557-4ccf-b132-84e7025ea22d"
}

variable "query_text" {
Expand All @@ -59,7 +57,7 @@ variable "query_text" {

variable "subscriptions_list" {
type = list(string)
default = ["sub1", "sub2"]
default = []
}

resource "lacework_integration_azure_agentless_scanning" "example" {
Expand Down Expand Up @@ -91,10 +89,6 @@ output "client_id" {
value = lacework_integration_azure_agentless_scanning.example.credentials[0].client_id
}

output "client_secret" {
value = lacework_integration_azure_agentless_scanning.example.credentials[0].client_secret
}

output "blob_container_name" {
value = lacework_integration_azure_agentless_scanning.example.blob_container_name
}
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ require (
golang.org/x/text v0.13.0
)

replace github.com/lacework/go-sdk v1.37.0 => /Users/aoz/dev/go-sdk

require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.19.1 // indirect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ func TestIntegrationAzureAgentlessScanningCreate(t *testing.T) {
terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: "../examples/resource_lacework_integration_azure_agentless_scanning",
Vars: map[string]interface{}{
"integration_name": integration_name,
"client_id": credential.ClientID,
"blob_container_name": "blob container name",
"integration_name": integration_name,
"client_id": credential.ClientID,
"client_secret": credential.ClientSecret,
},
EnvVars: map[string]string{
"TF_VAR_CLIENT_SECRET": credential.ClientSecret,
"LW_API_TOKEN": LwApiToken,
"LW_API_TOKEN": LwApiToken,
},
})
defer terraform.Destroy(t, terraformOptions)
Expand All @@ -40,7 +39,7 @@ func TestIntegrationAzureAgentlessScanningCreate(t *testing.T) {
// Update Azure integration
terraformOptions.Vars["integration_name"] = update_integration_name

update := terraform.ApplyAndIdempotent(t, terraformOptions)
update := terraform.InitAndApplyAndIdempotent(t, terraformOptions)
updateData := GetAzureAgentlessScanningResponse(update)
assert.Equal(t, update_integration_name, updateData.Data.Name)
}
Expand Down

0 comments on commit 4dc3dd3

Please sign in to comment.