Skip to content

Commit 3564421

Browse files
committed
Adds multitenant sa pipeline at infra test
1 parent f42ee71 commit 3564421

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

test/integration/appfactory/appfactory_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ func TestAppfactory(t *testing.T) {
5353
tft.WithTFDir("../../setup/vpcsc"),
5454
)
5555

56+
os.Setenv("GOOGLE_IMPERSONATE_SERVICE_ACCOUNT", bootstrap.GetJsonOutput("cb_service_accounts_emails").Get("applicationfactory").String())
57+
5658
backend_bucket := bootstrap.GetStringOutput("state_bucket")
5759
backendConfig := map[string]interface{}{
5860
"bucket": backend_bucket,

test/integration/fleetscope/fleetscope_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ func TestFleetscope(t *testing.T) {
4646
tft.WithTFDir("../../../1-bootstrap"),
4747
)
4848

49+
os.Setenv("GOOGLE_IMPERSONATE_SERVICE_ACCOUNT", bootstrap.GetJsonOutput("cb_service_accounts_emails").Get("fleetscope").String())
50+
4951
backend_bucket := bootstrap.GetStringOutput("state_bucket")
5052
backendConfig := map[string]interface{}{
5153
"bucket": backend_bucket,

test/integration/multitenant/multitenant_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package multitenant
1616

1717
import (
1818
"fmt"
19+
"os"
1920
"regexp"
2021
"strings"
2122
"testing"
@@ -36,6 +37,7 @@ func TestMultitenant(t *testing.T) {
3637
bootstrap := tft.NewTFBlueprintTest(t,
3738
tft.WithTFDir("../../../1-bootstrap"),
3839
)
40+
os.Setenv("GOOGLE_IMPERSONATE_SERVICE_ACCOUNT", bootstrap.GetJsonOutput("cb_service_accounts_emails").Get("multitenant").String())
3941

4042
vpcsc := tft.NewTFBlueprintTest(t,
4143
tft.WithTFDir("../../setup/vpcsc"),

test/setup/iam.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ resource "google_project_iam_member" "int_test_connection_admin" {
6363
}
6464

6565
resource "google_folder_iam_member" "int_test_connection_admin" {
66-
for_each = toset(["roles/resourcemanager.projectCreator", "roles/owner"])
66+
for_each = toset(["roles/resourcemanager.projectCreator", "roles/owner", "roles/iam.serviceAccountAdmin", "roles/iam.serviceAccountUser",])
6767
folder = module.folder_seed.id
6868
role = each.value
6969
member = "serviceAccount:${google_service_account.int_test[local.index].email}"

0 commit comments

Comments
 (0)