From c0de4a4d70a68e5afeb70a5f6c5c5fbd2ca0bcc2 Mon Sep 17 00:00:00 2001 From: zhangguanzhang Date: Thu, 6 May 2021 18:52:45 +0800 Subject: Fixes docker-compose cannot set static ip when use ipam Signed-off-by: zhangguanzhang --- test/compose/ipam_set_ip/docker-compose.yml | 17 +++++++++++++++++ test/compose/ipam_set_ip/tests.sh | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 test/compose/ipam_set_ip/docker-compose.yml create mode 100644 test/compose/ipam_set_ip/tests.sh (limited to 'test/compose') 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" -- cgit v1.2.3-54-g00ecf