Skip to content

Commit 8d21757

Browse files
DaliborKrdebarshiray
authored andcommitted
test/system: Check if 'create' added the c.gh.containers.toolbox label
#1716
1 parent 4756370 commit 8d21757

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

test/system/101-create.bats

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ teardown() {
5050

5151
assert_success
5252
assert_output --regexp "Created[[:blank:]]+$default_container"
53+
54+
run podman inspect \
55+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
56+
--type container \
57+
"$default_container"
58+
59+
assert_success
60+
assert_output "true"
5361
}
5462

5563
@test "create: With a custom name (using option --container)" {
@@ -69,6 +77,14 @@ teardown() {
6977

7078
assert_success
7179
assert_output --regexp "Created[[:blank:]]+$container"
80+
81+
run podman inspect \
82+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
83+
--type container \
84+
"$container"
85+
86+
assert_success
87+
assert_output "true"
7288
}
7389

7490
@test "create: With a custom image and name (using option --container)" {
@@ -88,6 +104,14 @@ teardown() {
88104

89105
assert_success
90106
assert_output --regexp "Created[[:blank:]]+$container"
107+
108+
run podman inspect \
109+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
110+
--type container \
111+
"$container"
112+
113+
assert_success
114+
assert_output "true"
91115
}
92116

93117
@test "create: Try without --assumeyes" {
@@ -182,6 +206,14 @@ teardown() {
182206

183207
assert_success
184208
assert_output --regexp "Created[[:blank:]]+$container"
209+
210+
run podman inspect \
211+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
212+
--type container \
213+
"$container"
214+
215+
assert_success
216+
assert_output "true"
185217
}
186218

187219
@test "create: Arch Linux ('--release latest')" {
@@ -210,6 +242,14 @@ teardown() {
210242

211243
assert_success
212244
assert_output --regexp "Created[[:blank:]]+$container"
245+
246+
run podman inspect \
247+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
248+
--type container \
249+
"$container"
250+
251+
assert_success
252+
assert_output "true"
213253
}
214254

215255
@test "create: Arch Linux ('--release rolling')" {
@@ -238,6 +278,14 @@ teardown() {
238278

239279
assert_success
240280
assert_output --regexp "Created[[:blank:]]+$container"
281+
282+
run podman inspect \
283+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
284+
--type container \
285+
"$container"
286+
287+
assert_success
288+
assert_output "true"
241289
}
242290

243291
@test "create: Fedora 34" {
@@ -257,6 +305,14 @@ teardown() {
257305

258306
assert_success
259307
assert_output --regexp "Created[[:blank:]]+$container"
308+
309+
run podman inspect \
310+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
311+
--type container \
312+
"$container"
313+
314+
assert_success
315+
assert_output "true"
260316
}
261317

262318
@test "create: RHEL 8.10" {
@@ -276,6 +332,14 @@ teardown() {
276332

277333
assert_success
278334
assert_output --regexp "Created[[:blank:]]+$container"
335+
336+
run podman inspect \
337+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
338+
--type container \
339+
"$container"
340+
341+
assert_success
342+
assert_output "true"
279343
}
280344

281345
@test "create: Ubuntu 16.04" {
@@ -295,6 +359,14 @@ teardown() {
295359

296360
assert_success
297361
assert_output --regexp "Created[[:blank:]]+$container"
362+
363+
run podman inspect \
364+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
365+
--type container \
366+
"$container"
367+
368+
assert_success
369+
assert_output "true"
298370
}
299371

300372
@test "create: Ubuntu 18.04" {
@@ -314,6 +386,14 @@ teardown() {
314386

315387
assert_success
316388
assert_output --regexp "Created[[:blank:]]+$container"
389+
390+
run podman inspect \
391+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
392+
--type container \
393+
"$container"
394+
395+
assert_success
396+
assert_output "true"
317397
}
318398

319399
@test "create: Ubuntu 20.04" {
@@ -333,6 +413,14 @@ teardown() {
333413

334414
assert_success
335415
assert_output --regexp "Created[[:blank:]]+$container"
416+
417+
run podman inspect \
418+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
419+
--type container \
420+
"$container"
421+
422+
assert_success
423+
assert_output "true"
336424
}
337425

338426
@test "create: With a custom image without a name" {
@@ -350,6 +438,14 @@ teardown() {
350438

351439
assert_success
352440
assert_output --regexp "Created[[:blank:]]+$image"
441+
442+
run podman inspect \
443+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
444+
--type container \
445+
"$image"
446+
447+
assert_success
448+
assert_output "true"
353449
}
354450

355451
@test "create: With a custom image without a name, and container name (using positional argument)" {
@@ -369,6 +465,14 @@ teardown() {
369465

370466
assert_success
371467
assert_output --regexp "Created[[:blank:]]+$container"
468+
469+
run podman inspect \
470+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
471+
--type container \
472+
"$container"
473+
474+
assert_success
475+
assert_output "true"
372476
}
373477

374478
@test "create: With a custom image without a name, and container name (using option --container)" {
@@ -388,6 +492,14 @@ teardown() {
388492

389493
assert_success
390494
assert_output --regexp "Created[[:blank:]]+$container"
495+
496+
run podman inspect \
497+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
498+
--type container \
499+
"$container"
500+
501+
assert_success
502+
assert_output "true"
391503
}
392504

393505
@test "create: Try the same name again" {
@@ -1069,4 +1181,12 @@ teardown() {
10691181

10701182
assert_success
10711183
assert_output --regexp "Created[[:blank:]]+$container"
1184+
1185+
run podman inspect \
1186+
--format '{{index .Config.Labels "com.github.containers.toolbox"}}' \
1187+
--type container \
1188+
"$container"
1189+
1190+
assert_success
1191+
assert_output "true"
10721192
}

0 commit comments

Comments
 (0)