summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2022-03-17 15:16:13 -0400
committerMatthew Heon <mheon@redhat.com>2022-03-17 15:16:13 -0400
commit4b359e4598ec795b8eff3dfebae52b17c195c22b (patch)
treed8deb40392da9412e712ac0adf8879701192d4c7
parentbde3ca8c363bfbd0f50fe9c787960836212e0167 (diff)
downloadpodman-4b359e4598ec795b8eff3dfebae52b17c195c22b.tar.gz
podman-4b359e4598ec795b8eff3dfebae52b17c195c22b.tar.bz2
podman-4b359e4598ec795b8eff3dfebae52b17c195c22b.zip
Set names in compose tests based on version
Compose v2 uses dashes as separators instead of hyphens. This broke some tests that relied upon container names. Set the name conditionally to make it safe for both. Signed-off-by: Matthew Heon <mheon@redhat.com>
-rw-r--r--test/compose/ipam_set_ip/tests.sh6
-rw-r--r--test/compose/two_networks/tests.sh8
2 files changed, 11 insertions, 3 deletions
diff --git a/test/compose/ipam_set_ip/tests.sh b/test/compose/ipam_set_ip/tests.sh
index ecaf3167e..b9e761ea2 100644
--- a/test/compose/ipam_set_ip/tests.sh
+++ b/test/compose/ipam_set_ip/tests.sh
@@ -1,4 +1,8 @@
# -*- bash -*-
-podman container inspect ipam_set_ip_test_1 --format '{{ .NetworkSettings.Networks.ipam_set_ip_net1.IPAddress }}'
+ctr_name="ipam_set_ip_test_1"
+if [ "$TEST_FLAVOR" = "compose_v2" ]; then
+ ctr_name="ipam_set_ip-test-1"
+fi
+podman container inspect "$ctr_name" --format '{{ .NetworkSettings.Networks.ipam_set_ip_net1.IPAddress }}'
like "$output" "10.123.0.253" "$testname : ip address is set"
diff --git a/test/compose/two_networks/tests.sh b/test/compose/two_networks/tests.sh
index 1cc88aa5f..af0d1fbe3 100644
--- a/test/compose/two_networks/tests.sh
+++ b/test/compose/two_networks/tests.sh
@@ -1,7 +1,11 @@
# -*- bash -*-
-podman container inspect two_networks_con1_1 --format '{{len .NetworkSettings.Networks}}'
+ctr_name="two_networks_con1_1"
+if [ "$TEST_FLAVOR" = "compose_v2" ]; then
+ ctr_name="two_networks-con1-1"
+fi
+podman container inspect "$ctr_name" --format '{{len .NetworkSettings.Networks}}'
is "$output" "2" "$testname : Container is connected to both networks"
-podman container inspect two_networks_con1_1 --format '{{.NetworkSettings.Networks}}'
+podman container inspect "$ctr_name" --format '{{.NetworkSettings.Networks}}'
like "$output" "two_networks_net1" "$testname : First network name exists"
like "$output" "two_networks_net2" "$testname : Second network name exists"