File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
containers/trafficjam_test Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+
3+ # Check for nftables testing
4+ if [[ -n " $NFTABLES " ]]; then
5+ ln -s /sbin/xtables-nft-multi /sbin/iptables -f
6+ fi
27/usr/local/bin/dockerd-entrypoint.sh dockerd &
38# Wait for docker startup for 60s
49while ! docker ps; do
@@ -10,4 +15,4 @@ while ! docker ps; do
1015done
1116docker build -t trafficjam /opt/trafficjam || exit 1;
1217docker build -t whoami /opt/trafficjam/test/containers/whoami || exit 1;
13- sleep infinity
18+ sleep infinity
Original file line number Diff line number Diff line change 1+ version : ' 3.8'
2+ services :
3+ trafficjam_test :
4+ image : trafficjam_test
5+ container_name : trafficjam_test_nftables
6+ environment :
7+ NFTABLES : " true"
8+ privileged : true
Original file line number Diff line number Diff line change 1919 docker exec trafficjam_test bats /opt/trafficjam/test/test-dind.bats
2020}
2121
22+ @test " Deploy the non-swarm environment with nftables" {
23+ docker-compose -f " $BATS_TEST_DIRNAME " /docker-compose-nftables.yml up -d
24+ }
25+
26+ @test " Test the non-swarm environment with nftables" {
27+ docker exec trafficjam_test_nftables bats /opt/trafficjam/test/test-dind.bats
28+ }
29+
2230@test " Deploy the swarm environment" {
2331 docker-compose -f " $BATS_TEST_DIRNAME " /docker-compose-swarm.yml up -d
2432 docker exec swarm-manager docker swarm init
3644
3745function teardown_file() {
3846 docker-compose -f " $BATS_TEST_DIRNAME " /docker-compose.yml down
47+ docker-compose -f " $BATS_TEST_DIRNAME " /docker-compose-nftables.yml down
3948 docker-compose -f " $BATS_TEST_DIRNAME " /docker-compose-swarm.yml down
4049 docker image rm --force trafficjam_bats trafficjam_test
4150}
You can’t perform that action at this time.
0 commit comments