Skip to content

Commit fbffd45

Browse files
committed
playbooks, test/system: Drop the PODMAN and SKOPEO environment variables
The toolbox(1) binary always relies on the PATH environment variable to find the podman(1) and skopeo(1) binaries. There's no way to override those with the PODMAN and SKOPEO environment variables, and they only affect any direct use of podman(1) and skopeo(1) within the test suite. Therefore, offering the PODMAN and SKOPEO environment variables in their current form is needlessly confusing and misleading, and can lead to surprises arising from different podman(1) and skopeo(1) binaries being used in different places. Either toolbox(1) should also honour them or the test suite shouldn't offer them. The former is more complicated without any obvious need for it, so the latter was chosen. #1592
1 parent c11a03c commit fbffd45

10 files changed

+92
-97
lines changed

playbooks/system-test-commands-options.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
- name: Run the commands-options system tests
2323
command: bats --filter-tags commands-options ./test/system
2424
environment:
25-
PODMAN: '/usr/bin/podman'
2625
TMPDIR: '/var/tmp'
2726
TOOLBX: '/usr/local/bin/toolbox'
2827
TOOLBX_TEST_SYSTEM_TAGS: 'arch-fedora,commands-options,custom-image,ubuntu'

playbooks/system-test-runtime-environment-arch-fedora.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
- name: Run the (arch-fedora,runtime-environment) system tests
2323
command: bats --filter-tags arch-fedora,runtime-environment ./test/system
2424
environment:
25-
PODMAN: '/usr/bin/podman'
2625
TMPDIR: '/var/tmp'
2726
TOOLBX: '/usr/local/bin/toolbox'
2827
TOOLBX_TEST_SYSTEM_TAGS: 'arch-fedora,runtime-environment'

playbooks/system-test-runtime-environment-ubuntu.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
- name: Run the (runtime-environment,ubuntu) system tests
2323
command: bats --filter-tags runtime-environment,ubuntu ./test/system
2424
environment:
25-
PODMAN: '/usr/bin/podman'
2625
TMPDIR: '/var/tmp'
2726
TOOLBX: '/usr/local/bin/toolbox'
2827
TOOLBX_TEST_SYSTEM_TAGS: 'runtime-environment,ubuntu'

test/system/101-create.bats

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ teardown() {
204204
assert_output --partial "Created container: ubuntu-toolbox-16.04"
205205
assert_output --partial "Enter with: toolbox enter ubuntu-toolbox-16.04"
206206

207-
run $PODMAN ps --all
207+
run podman ps --all
208208

209209
assert_success
210210
assert_output --regexp "Created[[:blank:]]+ubuntu-toolbox-16.04"
@@ -219,7 +219,7 @@ teardown() {
219219
assert_output --partial "Created container: ubuntu-toolbox-18.04"
220220
assert_output --partial "Enter with: toolbox enter ubuntu-toolbox-18.04"
221221

222-
run $PODMAN ps --all
222+
run podman ps --all
223223

224224
assert_success
225225
assert_output --regexp "Created[[:blank:]]+ubuntu-toolbox-18.04"
@@ -234,7 +234,7 @@ teardown() {
234234
assert_output --partial "Created container: ubuntu-toolbox-20.04"
235235
assert_output --partial "Enter with: toolbox enter ubuntu-toolbox-20.04"
236236

237-
run $PODMAN ps --all
237+
run podman ps --all
238238

239239
assert_success
240240
assert_output --regexp "Created[[:blank:]]+ubuntu-toolbox-20.04"
@@ -251,7 +251,7 @@ teardown() {
251251
assert [ ${#lines[@]} -eq 2 ]
252252
assert [ ${#stderr_lines[@]} -eq 0 ]
253253

254-
run $PODMAN ps --all
254+
run podman ps --all
255255

256256
assert_success
257257
assert_output --regexp "Created[[:blank:]]+$image"
@@ -268,7 +268,7 @@ teardown() {
268268
assert [ ${#lines[@]} -eq 2 ]
269269
assert [ ${#stderr_lines[@]} -eq 0 ]
270270

271-
run $PODMAN ps --all
271+
run podman ps --all
272272

273273
assert_success
274274
assert_output --regexp "Created[[:blank:]]+non-default"
@@ -285,7 +285,7 @@ teardown() {
285285
assert [ ${#lines[@]} -eq 2 ]
286286
assert [ ${#stderr_lines[@]} -eq 0 ]
287287

288-
run $PODMAN ps --all
288+
run podman ps --all
289289

290290
assert_success
291291
assert_output --regexp "Created[[:blank:]]+non-default"
@@ -842,7 +842,7 @@ teardown() {
842842
local authfile="$BATS_TEST_TMPDIR/authfile"
843843
local image="fedora-toolbox:34"
844844

845-
run $PODMAN login --authfile "$authfile" --username user --password user "$DOCKER_REG_URI"
845+
run podman login --authfile "$authfile" --username user --password user "$DOCKER_REG_URI"
846846
assert_success
847847

848848
run "$TOOLBX" --assumeyes create --image "$DOCKER_REG_URI/$image"

test/system/102-list.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ teardown() {
535535
num_of_images="$(list_images)"
536536
assert_equal "$num_of_images" 1
537537

538-
$PODMAN create --name busybox-container "$busybox_image"
538+
podman create --name busybox-container "$busybox_image"
539539

540540
local num_of_containers
541541
num_of_containers="$(list_containers)"
@@ -558,7 +558,7 @@ teardown() {
558558
num_of_images="$(list_images)"
559559
assert_equal "$num_of_images" 1
560560

561-
$PODMAN create --name busybox-container "$busybox_image"
561+
podman create --name busybox-container "$busybox_image"
562562

563563
local num_of_containers
564564
num_of_containers="$(list_containers)"
@@ -581,7 +581,7 @@ teardown() {
581581
num_of_images="$(list_images)"
582582
assert_equal "$num_of_images" 1
583583

584-
$PODMAN create --name busybox-container "$busybox_image"
584+
podman create --name busybox-container "$busybox_image"
585585

586586
local num_of_containers
587587
num_of_containers="$(list_containers)"

test/system/104-run.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,11 +842,11 @@ teardown() {
842842

843843
local container="ancient"
844844

845-
run "$PODMAN" create --name "$container" "$default_image" true
845+
run podman create --name "$container" "$default_image" true
846846

847847
assert_success
848848

849-
run $PODMAN ps --all
849+
run podman ps --all
850850

851851
assert_success
852852
assert_output --regexp "Created[[:blank:]]+$container"

test/system/206-user.bats

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ teardown() {
5757
default_container="$(get_system_id)-toolbox-$(get_system_version)"
5858

5959
create_default_container
60-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount "$default_container")"
60+
container_root_file_system="$(podman unshare podman mount "$default_container")"
6161

6262
"$TOOLBX" run true
6363

64-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
65-
"$PODMAN" unshare "$PODMAN" unmount "$default_container"
64+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
65+
podman unshare podman unmount "$default_container"
6666

6767
assert_success
6868
assert_line --regexp '^root::.+$'
@@ -75,12 +75,12 @@ teardown() {
7575
# bats test_tags=arch-fedora
7676
@test "user: root in shadow(5) inside Arch Linux" {
7777
create_distro_container arch latest arch-toolbox-latest
78-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount arch-toolbox-latest)"
78+
container_root_file_system="$(podman unshare podman mount arch-toolbox-latest)"
7979

8080
"$TOOLBX" run --distro arch true
8181

82-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
83-
"$PODMAN" unshare "$PODMAN" unmount arch-toolbox-latest
82+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
83+
podman unshare podman unmount arch-toolbox-latest
8484

8585
assert_success
8686
assert_line --regexp '^root::.+$'
@@ -93,12 +93,12 @@ teardown() {
9393
# bats test_tags=arch-fedora
9494
@test "user: root in shadow(5) inside Fedora 34" {
9595
create_distro_container fedora 34 fedora-toolbox-34
96-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount fedora-toolbox-34)"
96+
container_root_file_system="$(podman unshare podman mount fedora-toolbox-34)"
9797

9898
"$TOOLBX" run --distro fedora --release 34 true
9999

100-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
101-
"$PODMAN" unshare "$PODMAN" unmount fedora-toolbox-34
100+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
101+
podman unshare podman unmount fedora-toolbox-34
102102

103103
assert_success
104104
assert_line --regexp '^root::.+$'
@@ -111,12 +111,12 @@ teardown() {
111111
# bats test_tags=arch-fedora
112112
@test "user: root in shadow(5) inside RHEL 8.10" {
113113
create_distro_container rhel 8.10 rhel-toolbox-8.10
114-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount rhel-toolbox-8.10)"
114+
container_root_file_system="$(podman unshare podman mount rhel-toolbox-8.10)"
115115

116116
"$TOOLBX" run --distro rhel --release 8.10 true
117117

118-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
119-
"$PODMAN" unshare "$PODMAN" unmount rhel-toolbox-8.10
118+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
119+
podman unshare podman unmount rhel-toolbox-8.10
120120

121121
assert_success
122122
assert_line --regexp '^root::.+$'
@@ -129,12 +129,12 @@ teardown() {
129129
# bats test_tags=ubuntu
130130
@test "user: root in shadow(5) inside Ubuntu 16.04" {
131131
create_distro_container ubuntu 16.04 ubuntu-toolbox-16.04
132-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-16.04)"
132+
container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-16.04)"
133133

134134
"$TOOLBX" run --distro ubuntu --release 16.04 true
135135

136-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
137-
"$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-16.04
136+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
137+
podman unshare podman unmount ubuntu-toolbox-16.04
138138

139139
assert_success
140140
assert_line --regexp '^root::.+$'
@@ -147,12 +147,12 @@ teardown() {
147147
# bats test_tags=ubuntu
148148
@test "user: root in shadow(5) inside Ubuntu 18.04" {
149149
create_distro_container ubuntu 18.04 ubuntu-toolbox-18.04
150-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-18.04)"
150+
container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-18.04)"
151151

152152
"$TOOLBX" run --distro ubuntu --release 18.04 true
153153

154-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
155-
"$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-18.04
154+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
155+
podman unshare podman unmount ubuntu-toolbox-18.04
156156

157157
assert_success
158158
assert_line --regexp '^root::.+$'
@@ -165,12 +165,12 @@ teardown() {
165165
# bats test_tags=ubuntu
166166
@test "user: root in shadow(5) inside Ubuntu 20.04" {
167167
create_distro_container ubuntu 20.04 ubuntu-toolbox-20.04
168-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-20.04)"
168+
container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-20.04)"
169169

170170
"$TOOLBX" run --distro ubuntu --release 20.04 true
171171

172-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
173-
"$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-20.04
172+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
173+
podman unshare podman unmount ubuntu-toolbox-20.04
174174

175175
assert_success
176176
assert_line --regexp '^root::.+$'
@@ -326,12 +326,12 @@ teardown() {
326326
default_container="$(get_system_id)-toolbox-$(get_system_version)"
327327

328328
create_default_container
329-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount "$default_container")"
329+
container_root_file_system="$(podman unshare podman mount "$default_container")"
330330

331331
"$TOOLBX" run true
332332

333-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
334-
"$PODMAN" unshare "$PODMAN" unmount "$default_container"
333+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
334+
podman unshare podman unmount "$default_container"
335335

336336
assert_success
337337
refute_line --regexp "^$USER:.*$"
@@ -344,12 +344,12 @@ teardown() {
344344
# bats test_tags=arch-fedora
345345
@test "user: $USER in shadow(5) inside Arch Linux" {
346346
create_distro_container arch latest arch-toolbox-latest
347-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount arch-toolbox-latest)"
347+
container_root_file_system="$(podman unshare podman mount arch-toolbox-latest)"
348348

349349
"$TOOLBX" run --distro arch true
350350

351-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
352-
"$PODMAN" unshare "$PODMAN" unmount arch-toolbox-latest
351+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
352+
podman unshare podman unmount arch-toolbox-latest
353353

354354
assert_success
355355
refute_line --regexp "^$USER:.*$"
@@ -362,12 +362,12 @@ teardown() {
362362
# bats test_tags=arch-fedora
363363
@test "user: $USER in shadow(5) inside Fedora 34" {
364364
create_distro_container fedora 34 fedora-toolbox-34
365-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount fedora-toolbox-34)"
365+
container_root_file_system="$(podman unshare podman mount fedora-toolbox-34)"
366366

367367
"$TOOLBX" run --distro fedora --release 34 true
368368

369-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
370-
"$PODMAN" unshare "$PODMAN" unmount fedora-toolbox-34
369+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
370+
podman unshare podman unmount fedora-toolbox-34
371371

372372
assert_success
373373
refute_line --regexp "^$USER:.*$"
@@ -380,12 +380,12 @@ teardown() {
380380
# bats test_tags=arch-fedora
381381
@test "user: $USER in shadow(5) inside RHEL 8.10" {
382382
create_distro_container rhel 8.10 rhel-toolbox-8.10
383-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount rhel-toolbox-8.10)"
383+
container_root_file_system="$(podman unshare podman mount rhel-toolbox-8.10)"
384384

385385
"$TOOLBX" run --distro rhel --release 8.10 true
386386

387-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
388-
"$PODMAN" unshare "$PODMAN" unmount rhel-toolbox-8.10
387+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
388+
podman unshare podman unmount rhel-toolbox-8.10
389389

390390
assert_success
391391
refute_line --regexp "^$USER:.*$"
@@ -398,12 +398,12 @@ teardown() {
398398
# bats test_tags=ubuntu
399399
@test "user: $USER in shadow(5) inside Ubuntu 16.04" {
400400
create_distro_container ubuntu 16.04 ubuntu-toolbox-16.04
401-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-16.04)"
401+
container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-16.04)"
402402

403403
"$TOOLBX" run --distro ubuntu --release 16.04 true
404404

405-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
406-
"$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-16.04
405+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
406+
podman unshare podman unmount ubuntu-toolbox-16.04
407407

408408
assert_success
409409
refute_line --regexp "^$USER:.*$"
@@ -416,12 +416,12 @@ teardown() {
416416
# bats test_tags=ubuntu
417417
@test "user: $USER in shadow(5) inside Ubuntu 18.04" {
418418
create_distro_container ubuntu 18.04 ubuntu-toolbox-18.04
419-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-18.04)"
419+
container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-18.04)"
420420

421421
"$TOOLBX" run --distro ubuntu --release 18.04 true
422422

423-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
424-
"$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-18.04
423+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
424+
podman unshare podman unmount ubuntu-toolbox-18.04
425425

426426
assert_success
427427
refute_line --regexp "^$USER:.*$"
@@ -434,12 +434,12 @@ teardown() {
434434
# bats test_tags=ubuntu
435435
@test "user: $USER in shadow(5) inside Ubuntu 20.04" {
436436
create_distro_container ubuntu 20.04 ubuntu-toolbox-20.04
437-
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-20.04)"
437+
container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-20.04)"
438438

439439
"$TOOLBX" run --distro ubuntu --release 20.04 true
440440

441-
run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
442-
"$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-20.04
441+
run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow"
442+
podman unshare podman unmount ubuntu-toolbox-20.04
443443

444444
assert_success
445445
refute_line --regexp "^$USER:.*$"

0 commit comments

Comments
 (0)