Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions test/system/101-create.bats
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

# shellcheck shell=bats
#
# Copyright © 2019 – 2023 Red Hat, Inc.
# Copyright © 2019 – 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -167,18 +166,18 @@ teardown() {
assert_output --regexp "Created[[:blank:]]+fedora-toolbox-34"
}

@test "create: RHEL 8.7" {
pull_distro_image rhel 8.7
@test "create: RHEL 8.9" {
pull_distro_image rhel 8.9

run "$TOOLBOX" --assumeyes create --distro rhel --release 8.7
run "$TOOLBOX" --assumeyes create --distro rhel --release 8.9

assert_success
assert_output --partial "Created container: rhel-toolbox-8.7"
assert_output --partial "Enter with: toolbox enter rhel-toolbox-8.7"
assert_output --partial "Created container: rhel-toolbox-8.9"
assert_output --partial "Enter with: toolbox enter rhel-toolbox-8.9"

run podman ps -a

assert_output --regexp "Created[[:blank:]]+rhel-toolbox-8.7"
assert_output --regexp "Created[[:blank:]]+rhel-toolbox-8.9"
}

@test "create: Ubuntu 16.04" {
Expand Down
14 changes: 7 additions & 7 deletions test/system/102-list.bats
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shellcheck shell=bats
#
# Copyright © 2019 – 2023 Red Hat, Inc.
# Copyright © 2019 – 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -215,8 +215,8 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "list: RHEL 8.7 image" {
pull_distro_image rhel 8.7
@test "list: RHEL 8.9 image" {
pull_distro_image rhel 8.9

local num_of_images
num_of_images="$(list_images)"
Expand All @@ -225,7 +225,7 @@ teardown() {
run --keep-empty-lines --separate-stderr "$TOOLBOX" list

assert_success
assert_line --index 1 --partial "registry.access.redhat.com/ubi8/toolbox:8.7"
assert_line --index 1 --partial "registry.access.redhat.com/ubi8/toolbox:8.9"

if check_bats_version 1.10.0; then
assert [ ${#lines[@]} -eq 2 ]
Expand All @@ -236,8 +236,8 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "list: RHEL 8.7 image (using --images)" {
pull_distro_image rhel 8.7
@test "list: RHEL 8.9 image (using --images)" {
pull_distro_image rhel 8.9

local num_of_images
num_of_images="$(list_images)"
Expand All @@ -246,7 +246,7 @@ teardown() {
run --keep-empty-lines --separate-stderr "$TOOLBOX" list --images

assert_success
assert_line --index 1 --partial "registry.access.redhat.com/ubi8/toolbox:8.7"
assert_line --index 1 --partial "registry.access.redhat.com/ubi8/toolbox:8.9"

if check_bats_version 1.10.0; then
assert [ ${#lines[@]} -eq 2 ]
Expand Down
8 changes: 4 additions & 4 deletions test/system/104-run.bats
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shellcheck shell=bats
#
# Copyright © 2021 – 2023 Red Hat, Inc.
# Copyright © 2021 – 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -89,10 +89,10 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "run: Smoke test with RHEL 8.7" {
create_distro_container rhel 8.7 rhel-toolbox-8.7
@test "run: Smoke test with RHEL 8.9" {
create_distro_container rhel 8.9 rhel-toolbox-8.9

run --separate-stderr "$TOOLBOX" run --distro rhel --release 8.7 true
run --separate-stderr "$TOOLBOX" run --distro rhel --release 8.9 true

assert_success
assert [ ${#lines[@]} -eq 0 ]
Expand Down
22 changes: 11 additions & 11 deletions test/system/203-network.bats
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shellcheck shell=bats
#
# Copyright © 2023 Red Hat, Inc.
# Copyright © 2023 – 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -116,10 +116,10 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "network: /etc/resolv.conf inside RHEL 8.7" {
create_distro_container rhel 8.7 rhel-toolbox-8.7
@test "network: /etc/resolv.conf inside RHEL 8.9" {
create_distro_container rhel 8.9 rhel-toolbox-8.9

run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.7 readlink /etc/resolv.conf
run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.9 readlink /etc/resolv.conf

assert_success
assert_line --index 0 "/run/host/etc/resolv.conf"
Expand Down Expand Up @@ -348,7 +348,7 @@ teardown() {
fi
}

@test "network: DNS inside RHEL 8.7" {
@test "network: DNS inside RHEL 8.9" {
local ipv4_skip=false
local ipv4_addr
if ! ipv4_addr="$(python3 -c "$RESOLVER_PYTHON3" A k.root-servers.net)"; then
Expand All @@ -365,12 +365,12 @@ teardown() {
skip "DNS not working on host"
fi

create_distro_container rhel 8.7 rhel-toolbox-8.7
create_distro_container rhel 8.9 rhel-toolbox-8.9

if ! $ipv4_skip; then
run --keep-empty-lines --separate-stderr "$TOOLBOX" run \
--distro rhel \
--release 8.7 \
--release 8.9 \
/usr/libexec/platform-python3.6 -c "$RESOLVER_PYTHON3" A k.root-servers.net

assert_success
Expand All @@ -388,7 +388,7 @@ teardown() {
if ! $ipv6_skip; then
run --keep-empty-lines --separate-stderr "$TOOLBOX" run \
--distro rhel \
--release 8.7 \
--release 8.9 \
/usr/libexec/platform-python3.6 -c "$RESOLVER_PYTHON3" AAAA k.root-servers.net

assert_success
Expand Down Expand Up @@ -620,10 +620,10 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "network: ping(8) inside RHEL 8.7" {
create_distro_container rhel 8.7 rhel-toolbox-8.7
@test "network: ping(8) inside RHEL 8.9" {
create_distro_container rhel 8.9 rhel-toolbox-8.9

run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.7 ping -c 2 f.root-servers.net
run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.9 ping -c 2 f.root-servers.net

if [ "$status" -eq 1 ]; then
skip "lost packets"
Expand Down
34 changes: 17 additions & 17 deletions test/system/206-user.bats
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shellcheck shell=bats
#
# Copyright © 2023 Red Hat, Inc.
# Copyright © 2023 – 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -105,14 +105,14 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "user: root in shadow(5) inside RHEL 8.7" {
create_distro_container rhel 8.7 rhel-toolbox-8.7
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount rhel-toolbox-8.7)"
@test "user: root in shadow(5) inside RHEL 8.9" {
create_distro_container rhel 8.9 rhel-toolbox-8.9
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount rhel-toolbox-8.9)"

"$TOOLBOX" run --distro rhel --release 8.7 true
"$TOOLBOX" run --distro rhel --release 8.9 true

run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
"$PODMAN" unshare "$PODMAN" unmount rhel-toolbox-8.7
"$PODMAN" unshare "$PODMAN" unmount rhel-toolbox-8.9

assert_success
assert_line --regexp '^root::.+$'
Expand Down Expand Up @@ -230,16 +230,16 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "user: $USER in passwd(5) inside RHEL 8.7" {
@test "user: $USER in passwd(5) inside RHEL 8.9" {
local user_gecos
user_gecos="$(getent passwd "$USER" | cut --delimiter : --fields 5)"

local user_id_real
user_id_real="$(id --real --user)"

create_distro_container rhel 8.7 rhel-toolbox-8.7
create_distro_container rhel 8.9 rhel-toolbox-8.9

run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.7 cat /etc/passwd
run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.9 cat /etc/passwd

assert_success
assert_line --regexp "^$USER::$user_id_real:$user_id_real:$user_gecos:$HOME:$SHELL$"
Expand Down Expand Up @@ -360,14 +360,14 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "user: $USER in shadow(5) inside RHEL 8.7" {
create_distro_container rhel 8.7 rhel-toolbox-8.7
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount rhel-toolbox-8.7)"
@test "user: $USER in shadow(5) inside RHEL 8.9" {
create_distro_container rhel 8.9 rhel-toolbox-8.9
container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount rhel-toolbox-8.9)"

"$TOOLBOX" run --distro rhel --release 8.7 true
"$TOOLBOX" run --distro rhel --release 8.9 true

run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow"
"$PODMAN" unshare "$PODMAN" unmount rhel-toolbox-8.7
"$PODMAN" unshare "$PODMAN" unmount rhel-toolbox-8.9

assert_success
refute_line --regexp "^$USER:.*$"
Expand Down Expand Up @@ -467,10 +467,10 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "user: $USER in group(5) inside RHEL 8.7" {
create_distro_container rhel 8.7 rhel-toolbox-8.7
@test "user: $USER in group(5) inside RHEL 8.9" {
create_distro_container rhel 8.9 rhel-toolbox-8.9

run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.7 cat /etc/group
run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.9 cat /etc/group

assert_success
assert_line --regexp "^wheel:x:[[:digit:]]+:$USER$"
Expand Down
14 changes: 7 additions & 7 deletions test/system/211-dbus.bats
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shellcheck shell=bats
#
# Copyright © 2023 Red Hat, Inc.
# Copyright © 2023 – 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -121,19 +121,19 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "dbus: session bus inside RHEL 8.7" {
@test "dbus: session bus inside RHEL 8.9" {
local expected_response
expected_response="$(gdbus call \
--session \
--dest org.freedesktop.DBus \
--object-path /org/freedesktop/DBus \
--method org.freedesktop.DBus.Peer.Ping)"

create_distro_container rhel 8.7 rhel-toolbox-8.7
create_distro_container rhel 8.9 rhel-toolbox-8.9

run --keep-empty-lines --separate-stderr "$TOOLBOX" run \
--distro rhel \
--release 8.7 \
--release 8.9 \
gdbus call \
--session \
--dest org.freedesktop.DBus \
Expand Down Expand Up @@ -314,7 +314,7 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "dbus: system bus inside RHEL 8.7" {
@test "dbus: system bus inside RHEL 8.9" {
local expected_response
expected_response="$(gdbus call \
--system \
Expand All @@ -324,11 +324,11 @@ teardown() {
org.freedesktop.systemd1.Manager \
Version)"

create_distro_container rhel 8.7 rhel-toolbox-8.7
create_distro_container rhel 8.9 rhel-toolbox-8.9

run --keep-empty-lines --separate-stderr "$TOOLBOX" run \
--distro rhel \
--release 8.7 \
--release 8.9 \
gdbus call \
--system \
--dest org.freedesktop.systemd1 \
Expand Down
18 changes: 9 additions & 9 deletions test/system/220-environment-variables.bats
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "environment variables: HISTFILESIZE inside RHEL 8.7" {
create_distro_container rhel 8.7 rhel-toolbox-8.7
@test "environment variables: HISTFILESIZE inside RHEL 8.9" {
create_distro_container rhel 8.9 rhel-toolbox-8.9

# shellcheck disable=SC2031
if [ "$HISTFILESIZE" = "" ]; then
Expand All @@ -129,7 +129,7 @@ teardown() {
export HISTFILESIZE

# shellcheck disable=SC2016
run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.7 bash -c 'echo "$HISTFILESIZE"'
run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.9 bash -c 'echo "$HISTFILESIZE"'

assert_success
assert_line --index 0 "$HISTFILESIZE"
Expand Down Expand Up @@ -323,10 +323,10 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "environment variables: HISTSIZE inside RHEL 8.7" {
@test "environment variables: HISTSIZE inside RHEL 8.9" {
skip "https://pagure.io/setup/pull-request/48"

create_distro_container rhel 8.7 rhel-toolbox-8.7
create_distro_container rhel 8.9 rhel-toolbox-8.9

# shellcheck disable=SC2031
if [ "$HISTSIZE" = "" ]; then
Expand All @@ -339,7 +339,7 @@ teardown() {
export HISTSIZE

# shellcheck disable=SC2016
run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.7 bash -c 'echo "$HISTSIZE"'
run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.9 bash -c 'echo "$HISTSIZE"'

assert_success
assert_line --index 0 "$HISTSIZE"
Expand Down Expand Up @@ -494,11 +494,11 @@ teardown() {
assert [ ${#stderr_lines[@]} -eq 0 ]
}

@test "environment variables: HOSTNAME inside RHEL 8.7" {
create_distro_container rhel 8.7 rhel-toolbox-8.7
@test "environment variables: HOSTNAME inside RHEL 8.9" {
create_distro_container rhel 8.9 rhel-toolbox-8.9

# shellcheck disable=SC2016
run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.7 bash -c 'echo "$HOSTNAME"'
run --keep-empty-lines --separate-stderr "$TOOLBOX" run --distro rhel --release 8.9 bash -c 'echo "$HOSTNAME"'

assert_success
assert_line --index 0 "toolbox"
Expand Down
4 changes: 2 additions & 2 deletions test/system/setup_suite.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shellcheck shell=bash
#
# Copyright © 2021 – 2023 Red Hat, Inc.
# Copyright © 2021 – 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -45,7 +45,7 @@ setup_suite() {
# Cache all images that will be needed during the tests
_pull_and_cache_distro_image arch latest || false
_pull_and_cache_distro_image fedora 34 || false
_pull_and_cache_distro_image rhel 8.7 || false
_pull_and_cache_distro_image rhel 8.9 || false
_pull_and_cache_distro_image ubuntu 16.04 || false
_pull_and_cache_distro_image ubuntu 18.04 || false
_pull_and_cache_distro_image ubuntu 20.04 || false
Expand Down