Skip to content

Commit

Permalink
tests/kola: nuke is_rhcos8 code paths
Browse files Browse the repository at this point in the history
It's dead code.
  • Loading branch information
jlebon committed Jun 19, 2024
1 parent dcb92e1 commit bbbf0c4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 52 deletions.
6 changes: 0 additions & 6 deletions tests/kola/data/commonlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ get_rhel_maj_ver() {
echo "${RHEL_VERSION%%.*}"
}

# rhcos8
is_rhcos8() {
source /etc/os-release
[ "${ID}" == "rhcos" ] && [ "${RHEL_VERSION%%.*}" -eq 8 ]
}

# rhcos9
is_rhcos9() {
source /etc/os-release
Expand Down
10 changes: 3 additions & 7 deletions tests/kola/files/initrd/compression
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ set -xeuo pipefail
. "$KOLA_EXT_DATA/commonlib.sh"

# Check initrd for zstd magic number
if is_rhcos8; then
ok "Skipping initrd zstd compression test on RHCOS 8"
else
if ! LANG=C grep -aUPq "\x28\xb5\x2f\xfd" /boot/ostree/*/init*; then
fatal "Didn't find zstd compression in initrd"
fi
ok "Found zstd compression in initrd"
if ! LANG=C grep -aUPq "\x28\xb5\x2f\xfd" /boot/ostree/*/init*; then
fatal "Didn't find zstd compression in initrd"
fi
ok "Found zstd compression in initrd"
8 changes: 1 addition & 7 deletions tests/kola/files/rpmdb-sqlite
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
## kola:
## # Read only test thus safe to run in parallel
## exclusive: false
## description: Verify that we're using the sqlite rpmdb backend
## for RHCOS 9+ and FCOS 33+.
## description: Verify that we're using the sqlite rpmdb backend.

# See https://github.com/coreos/fedora-coreos-tracker/issues/623

Expand All @@ -12,11 +11,6 @@ set -xeuo pipefail
# shellcheck disable=SC1091
. "$KOLA_EXT_DATA/commonlib.sh"

if is_rhcos8; then
ok "nothing to check for RHCOS 8"
exit 0
fi

if [ ! -f /usr/share/rpm/rpmdb.sqlite ]; then
fatal "Didn't find file /usr/share/rpm/rpmdb.sqlite"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ if [ "$ID" == "fedora" ]; then
else
fatal "fail: not operating on expected OS version"
fi
elif [[ "${ID_LIKE}" =~ "rhel" ]]; then
elif [[ "${ID}" = "rhel" ]] || [[ "${ID_LIKE}" =~ "rhel" ]]; then
# For the version comparison use string substitution to remove the
# '.` from the version so we can use integer comparison

Expand Down
45 changes: 18 additions & 27 deletions tests/kola/networking/hostname/fallback-hostname/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,34 +51,25 @@ set -xeuo pipefail
# shellcheck disable=SC1091
. "$KOLA_EXT_DATA/commonlib.sh"

if is_rhcos8; then
if [ $(hostnamectl --transient) != 'localhost' ]; then
fatal "transient hostname was not expected"
fi
if [ ! -z $(hostnamectl --static) ]; then
fatal "static hostname not expected to be set"
fi
else
output=$(hostnamectl --json=pretty)
hostname=$(echo "$output" | jq -r '.Hostname')
fallback=$(echo "$output" | jq -r '.DefaultHostname')
static=$(echo "$output" | jq -r '.StaticHostname')
namesource=$(echo "$output" | jq -r '.HostnameSource')
output=$(hostnamectl --json=pretty)
hostname=$(echo "$output" | jq -r '.Hostname')
fallback=$(echo "$output" | jq -r '.DefaultHostname')
static=$(echo "$output" | jq -r '.StaticHostname')
namesource=$(echo "$output" | jq -r '.HostnameSource')

if [ "$hostname" != 'localhost' ]; then
fatal "hostname was not expected"
fi
if [ "$fallback" != 'localhost' ]; then
fatal "fallback hostname was not expected"
fi
if [ "$static" != 'null' ]; then
fatal "static hostname not expected to be set"
fi
if [ "$namesource" != 'default' ]; then
# For this test since we disabled NM setting the hostname we
# expect the hostname to have been set via the fallback/default
fatal "hostname was set from non-default/fallback source"
fi
if [ "$hostname" != 'localhost' ]; then
fatal "hostname was not expected"
fi
if [ "$fallback" != 'localhost' ]; then
fatal "fallback hostname was not expected"
fi
if [ "$static" != 'null' ]; then
fatal "static hostname not expected to be set"
fi
if [ "$namesource" != 'default' ]; then
# For this test since we disabled NM setting the hostname we
# expect the hostname to have been set via the fallback/default
fatal "hostname was set from non-default/fallback source"
fi

ok "fallback hostname wired up correctly"
4 changes: 0 additions & 4 deletions tests/kola/podman/rootless-systemd
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ main() {
sleep 5

retryflag="--retry-all-errors"
# --retry-all-errors flag passed to curl is not available on RHEL8
if is_rhcos8; then
retryflag="--retry-connrefused"
fi
# Try to grab the web page. Retry as it might not be up fully yet.
if ! curl --silent --show-error --retry 5 ${retryflag} http://localhost:8080 >/dev/null; then
runascoreuser podman logs httpd
Expand Down

0 comments on commit bbbf0c4

Please sign in to comment.