summaryrefslogtreecommitdiff
path: root/test/compose
diff options
context:
space:
mode:
authorzhangguanzhang <zhangguanzhang@qq.com>2021-05-06 18:52:45 +0800
committerzhangguanzhang <zhangguanzhang@qq.com>2021-05-06 19:25:27 +0800
commitc0de4a4d70a68e5afeb70a5f6c5c5fbd2ca0bcc2 (patch)
treef49bdcc3b348cd0b4268041bc6cc630d48de9722 /test/compose
parented6f399770946bb2e88f8b94e1d2f279208648d4 (diff)
downloadpodman-c0de4a4d70a68e5afeb70a5f6c5c5fbd2ca0bcc2.tar.gz
podman-c0de4a4d70a68e5afeb70a5f6c5c5fbd2ca0bcc2.tar.bz2
podman-c0de4a4d70a68e5afeb70a5f6c5c5fbd2ca0bcc2.zip
Fixes docker-compose cannot set static ip when use ipam
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'test/compose')
-rw-r--r--test/compose/ipam_set_ip/docker-compose.yml17
-rw-r--r--test/compose/ipam_set_ip/tests.sh4
2 files changed, 21 insertions, 0 deletions
diff --git a/test/compose/ipam_set_ip/docker-compose.yml b/test/compose/ipam_set_ip/docker-compose.yml
new file mode 100644
index 000000000..d220c02c0
--- /dev/null
+++ b/test/compose/ipam_set_ip/docker-compose.yml
@@ -0,0 +1,17 @@
+version: "3.2"
+services:
+ test:
+ image: alpine
+ networks:
+ net1:
+ ipv4_address: 10.123.0.253
+ tty: true
+ command: ["top"]
+
+networks:
+ net1:
+ driver: bridge
+ ipam:
+ driver: default
+ config:
+ - subnet: 10.123.0.0/24
diff --git a/test/compose/ipam_set_ip/tests.sh b/test/compose/ipam_set_ip/tests.sh
new file mode 100644
index 000000000..ecaf3167e
--- /dev/null
+++ b/test/compose/ipam_set_ip/tests.sh
@@ -0,0 +1,4 @@
+# -*- bash -*-
+
+podman container inspect ipam_set_ip_test_1 --format '{{ .NetworkSettings.Networks.ipam_set_ip_net1.IPAddress }}'
+like "$output" "10.123.0.253" "$testname : ip address is set"