summaryrefslogtreecommitdiff
path: root/test/compose
diff options
context:
space:
mode:
Diffstat (limited to 'test/compose')
-rw-r--r--test/compose/ipam_set_ip/tests.sh6
-rw-r--r--test/compose/slirp4netns_opts/tests.sh15
-rw-r--r--test/compose/two_networks/tests.sh8
3 files changed, 25 insertions, 4 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/slirp4netns_opts/tests.sh b/test/compose/slirp4netns_opts/tests.sh
index 1efce45c4..2d41311ad 100644
--- a/test/compose/slirp4netns_opts/tests.sh
+++ b/test/compose/slirp4netns_opts/tests.sh
@@ -1,6 +1,19 @@
# -*- bash -*-
-output="$(cat $OUTFILE)"
expected="teststring"
+# Reading from the nc socket is flaky because docker-compose only starts
+# the containers. We cannot know at this point if the container did already
+# send the message. Give the container 5 seconds time to send the message
+# to prevent flakes.
+container_timeout=5
+while [ $container_timeout -gt 0 ]; do
+ output="$(< $OUTFILE)"
+ if [ -n "$output" ]; then
+ break
+ fi
+ sleep 1
+ container_timeout=$(($container_timeout - 1))
+done
+
is "$output" "$expected" "$testname : nc received teststring"
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"