diff --git a/.kokoro/psm_interop_kokoro_lib.sh b/.kokoro/psm_interop_kokoro_lib.sh index e522e7ca..4878b23f 100644 --- a/.kokoro/psm_interop_kokoro_lib.sh +++ b/.kokoro/psm_interop_kokoro_lib.sh @@ -158,6 +158,50 @@ psm::security::run_test() { psm::tools::run_verbose python -m "tests.${test_name}" "${PSM_TEST_FLAGS[@]}" } +# --- DualStack TESTS ------------------ + +####################################### +# DualStack Test Suite setup. +# Outputs: +# Prints activated cluster names. +####################################### +psm::dualstack::setup() { + activate_gke_cluster GKE_CLUSTER_DUALSTACK +} + +####################################### +# Prepares the list of tests in DualStack test suite. +# Globals: +# TESTS: Populated with tests in PSM DualStack test suite. +####################################### +psm::dualstack::get_tests() { + TESTS=( + "test_dualstack" + ) +} + +####################################### +# Executes DualStack test case +# Globals: +# PSM_TEST_FLAGS: The array with flags for the test +# GRPC_LANGUAGE: The name of gRPC languages under test +# Arguments: +# Test case name +# Outputs: +# Writes the output of test execution to stdout, stderr +# Test xUnit report to ${TEST_XML_OUTPUT_DIR}/${test_name}/sponge_log.xml +####################################### +psm::dualstack::run_test() { + local test_name="${1:?${FUNCNAME[0]} missing the test name argument}" + + PSM_TEST_FLAGS+=( + "--flagfile=config/common-dualstack.cfg" + ) + + psm::run::finalize_test_flags "${test_name}" + psm::tools::run_verbose python -m "tests.${test_name}" "${PSM_TEST_FLAGS[@]}" +} + # --- URL Map TESTS ------------------ ####################################### @@ -694,6 +738,10 @@ activate_gke_cluster() { GKE_CLUSTER_NAME="interop-test-psm-basic" GKE_CLUSTER_ZONE="us-central1-c" ;; + GKE_CLUSTER_DUALSTACK) + GKE_CLUSTER_NAME="psm-interop-dualstack" + GKE_CLUSTER_ZONE="us-central1-a" + ;; *) psm::tools::log "Unknown GKE cluster: ${1}" exit 1 diff --git a/config/common-dualstack.cfg b/config/common-dualstack.cfg new file mode 100644 index 00000000..d4d2c991 --- /dev/null +++ b/config/common-dualstack.cfg @@ -0,0 +1,4 @@ +# Common config file for PSM DualStack tests. +--resource_prefix=psm-ds +--enable_dualstack +--noenable_workload_identity