Skip to content

Commit 9134310

Browse files
committed
fix: add --pull-image=false to containerd integration tests
Images are pre-pulled in setup() via ctr_pull_image, but pumba still contacted the registry at runtime. When ghcr.io is slow, this causes context canceled errors (flaky CI failures on tests 53-55). Match the pattern used by all Docker integration tests.
1 parent 010447b commit 9134310

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

tests/containerd_combined.bats

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ teardown() {
3131

3232
@test "Should apply netem then iptables on same container via containerd runtime" {
3333
# Apply netem delay
34-
run sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 2s delay --time 100 test-combined-ctr
34+
run sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 2s delay --time 100 test-combined-ctr
3535
echo "Netem status: $status, output: $output"
3636
assert_success
3737

3838
# Apply iptables loss on the same container
39-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug iptables --interface lo --duration 30s loss --probability 1.0 test-combined-ctr &
39+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug iptables --interface lo --pull-image=false --duration 30s loss --probability 1.0 test-combined-ctr &
4040
PUMBA_PID=$!
4141
sleep 2
4242

@@ -52,12 +52,12 @@ teardown() {
5252

5353
@test "Should apply rate limit with iptables protocol filter via containerd runtime" {
5454
# Apply rate limit
55-
run sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 2s rate --rate 1mbit test-combined-ctr
55+
run sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 2s rate --rate 1mbit test-combined-ctr
5656
echo "Rate limit status: $status"
5757
assert_success
5858

5959
# Apply iptables with protocol filter
60-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug iptables --interface lo --protocol icmp --duration 30s loss --probability 0.5 test-combined-ctr &
60+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug iptables --interface lo --pull-image=false --protocol icmp --duration 30s loss --probability 0.5 test-combined-ctr &
6161
PUMBA_PID=$!
6262
sleep 2
6363

@@ -72,7 +72,7 @@ teardown() {
7272
}
7373

7474
@test "Should apply netem with target IP filter via containerd runtime" {
75-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --target 8.8.8.8 --duration 30s delay --time 100 test-combined-ctr &
75+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --target 8.8.8.8 --duration 30s delay --time 100 test-combined-ctr &
7676
PUMBA_PID=$!
7777
sleep 2
7878

@@ -88,11 +88,11 @@ teardown() {
8888

8989
@test "Should apply iptables nth mode in combined scenario via containerd runtime" {
9090
# Apply netem delay first
91-
run sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 2s delay --time 50 test-combined-ctr
91+
run sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 2s delay --time 50 test-combined-ctr
9292
assert_success
9393

9494
# Then iptables nth mode
95-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug iptables --interface lo --duration 30s loss --mode nth --every 5 --packet 0 test-combined-ctr &
95+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug iptables --interface lo --pull-image=false --duration 30s loss --mode nth --every 5 --packet 0 test-combined-ctr &
9696
PUMBA_PID=$!
9797
sleep 2
9898

tests/containerd_netem.bats

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ teardown() {
3636
assert_success
3737

3838
# Run pumba in BACKGROUND with long duration so we can inspect tc rules while active
39-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 30s delay --time 100 test-netem-ctr &
39+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 30s delay --time 100 test-netem-ctr &
4040
PUMBA_PID=$!
4141
# Give pumba time to apply tc rules
4242
sleep 2
@@ -62,7 +62,7 @@ teardown() {
6262

6363
@test "Should apply packet loss via containerd runtime" {
6464
# Run pumba in BACKGROUND with long duration
65-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 30s loss --percent 50 test-netem-ctr &
65+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 30s loss --percent 50 test-netem-ctr &
6666
PUMBA_PID=$!
6767
sleep 2
6868

@@ -86,7 +86,7 @@ teardown() {
8686
}
8787

8888
@test "Should apply packet duplicate via containerd runtime" {
89-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 30s duplicate --percent 50 test-netem-ctr &
89+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 30s duplicate --percent 50 test-netem-ctr &
9090
PUMBA_PID=$!
9191
sleep 2
9292

@@ -108,7 +108,7 @@ teardown() {
108108
}
109109

110110
@test "Should apply packet corruption via containerd runtime" {
111-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 30s corrupt --percent 50 test-netem-ctr &
111+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 30s corrupt --percent 50 test-netem-ctr &
112112
PUMBA_PID=$!
113113
sleep 2
114114

@@ -131,12 +131,12 @@ teardown() {
131131

132132
@test "Should handle netem on non-existent container via containerd runtime" {
133133
# Pumba should handle gracefully — exit 0 (no matching containers found)
134-
run sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 2s delay --time 100 nonexistent_container_12345
134+
run sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 2s delay --time 100 nonexistent_container_12345
135135
assert_success
136136
}
137137

138138
@test "Should apply loss-state model via containerd runtime" {
139-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 30s loss-state --p13 5 --p31 15 --p32 10 --p23 20 --p14 5 test-netem-ctr &
139+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 30s loss-state --p13 5 --p31 15 --p32 10 --p23 20 --p14 5 test-netem-ctr &
140140
PUMBA_PID=$!
141141
sleep 2
142142

@@ -157,7 +157,7 @@ teardown() {
157157
}
158158

159159
@test "Should apply loss-gemodel model via containerd runtime" {
160-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 30s loss-gemodel --pg 5 --pb 20 --one-h 80 --one-k 10 test-netem-ctr &
160+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 30s loss-gemodel --pg 5 --pb 20 --one-h 80 --one-k 10 test-netem-ctr &
161161
PUMBA_PID=$!
162162
sleep 2
163163

@@ -178,7 +178,7 @@ teardown() {
178178
}
179179

180180
@test "Should apply delay with normal distribution via containerd runtime" {
181-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 30s delay --time 100 --jitter 30 --distribution normal test-netem-ctr &
181+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 30s delay --time 100 --jitter 30 --distribution normal test-netem-ctr &
182182
PUMBA_PID=$!
183183
sleep 2
184184

@@ -200,7 +200,7 @@ teardown() {
200200
}
201201

202202
@test "Should apply rate limit with cell options via containerd runtime" {
203-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 30s rate --rate 1mbit --packetoverhead 10 --cellsize 1500 --celloverhead 20 test-netem-ctr &
203+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 30s rate --rate 1mbit --packetoverhead 10 --cellsize 1500 --celloverhead 20 test-netem-ctr &
204204
PUMBA_PID=$!
205205
sleep 2
206206

@@ -222,7 +222,7 @@ teardown() {
222222
}
223223

224224
@test "Should apply rate limiting via containerd runtime" {
225-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --duration 30s rate --rate 100kbit test-netem-ctr &
225+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --duration 30s rate --rate 100kbit test-netem-ctr &
226226
PUMBA_PID=$!
227227
sleep 2
228228

@@ -244,7 +244,7 @@ teardown() {
244244
}
245245

246246
@test "Should apply netem delay with egress port filter via containerd runtime" {
247-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --egress-port 80 --duration 30s delay --time 100 test-netem-ctr &
247+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --egress-port 80 --duration 30s delay --time 100 test-netem-ctr &
248248
PUMBA_PID=$!
249249
sleep 2
250250

@@ -262,7 +262,7 @@ teardown() {
262262
}
263263

264264
@test "Should apply netem delay with ingress port filter via containerd runtime" {
265-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --ingress-port 443 --duration 30s delay --time 100 test-netem-ctr &
265+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --pull-image=false --ingress-port 443 --duration 30s delay --time 100 test-netem-ctr &
266266
PUMBA_PID=$!
267267
sleep 2
268268

tests/containerd_sidecar.bats

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ setup() {
1010
require_containerd
1111
sudo ctr -n moby t kill -s SIGKILL test-sidecar-target >/dev/null 2>&1 || true
1212
sudo ctr -n moby c rm test-sidecar-target >/dev/null 2>&1 || true
13-
# Use plain alpine — no tc tools installed
13+
# Use plain alpine — no tc tools installed; pre-pull sidecar image too
1414
ctr_pull_image moby docker.io/library/alpine:latest
15+
ctr_pull_image moby docker.io/nicolaka/netshoot:latest
1516
# Create with a dummy network interface for testing
1617
sudo ctr -n moby run -d --privileged docker.io/library/alpine:latest test-sidecar-target \
1718
sh -c "ip link add dummy0 type dummy && ip link set dummy0 up && sleep infinity" >/dev/null 2>&1
@@ -33,7 +34,7 @@ teardown() {
3334
@test "Should apply netem delay via sidecar container (tc-image)" {
3435
# Run pumba with --tc-image to use sidecar approach
3536
# The target container (alpine) does NOT have tc installed
36-
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --tc-image docker.io/nicolaka/netshoot:latest --duration 30s delay --time 100 test-sidecar-target &
37+
sudo pumba --runtime containerd --containerd-namespace moby --log-level debug netem --interface dummy0 --tc-image docker.io/nicolaka/netshoot:latest --pull-image=false --duration 30s delay --time 100 test-sidecar-target &
3738
PUMBA_PID=$!
3839
sleep 3
3940

0 commit comments

Comments
 (0)