From 1050f8a506a08e67cb291d852029c127a4f00771 Mon Sep 17 00:00:00 2001 From: Jakub Rusz Date: Thu, 15 Sep 2022 10:26:41 +0200 Subject: [PATCH] tests/upgrade: copy shared_lib.sh to the test vm shared_lib.sh now contains some more helper functions and the verification script uses them. Copy it over so that we can source it. Also install all other dependencies before the actual upgrade. --- test/cases/upgrade8to9.sh | 1 + test/data/upgrade8to9/upgrade_prepare.sh | 3 ++- test/data/upgrade8to9/upgrade_verify.sh | 5 +---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/test/cases/upgrade8to9.sh b/test/cases/upgrade8to9.sh index b54ba512c..a68ee48dd 100755 --- a/test/cases/upgrade8to9.sh +++ b/test/cases/upgrade8to9.sh @@ -118,6 +118,7 @@ sudo pkill -P "$CONSOLE_PID" # copy over next phases of the test and run the first one sudo scp "${SSH_OPTIONS[@]}" -q -i "${SSH_KEY}" /usr/share/tests/osbuild-composer/upgrade8to9/*.sh root@"$INSTANCE_ADDRESS": +sudo scp "${SSH_OPTIONS[@]}" -q -i "${SSH_KEY}" /usr/libexec/tests/osbuild-composer/shared_lib.sh root@"$INSTANCE_ADDRESS": # Put comment in sshd_config to keep root login after upgrade sudo ssh "${SSH_OPTIONS[@]}" -q -i "${SSH_KEY}" root@"$INSTANCE_ADDRESS" 'sed -i "s/PermitRootLogin yes/PermitRootLogin yes #for sure/" /etc/ssh/sshd_config' set +e diff --git a/test/data/upgrade8to9/upgrade_prepare.sh b/test/data/upgrade8to9/upgrade_prepare.sh index b3659e729..aae59cd1b 100755 --- a/test/data/upgrade8to9/upgrade_prepare.sh +++ b/test/data/upgrade8to9/upgrade_prepare.sh @@ -12,7 +12,8 @@ dnf install -y osbuild-composer composer-cli # Prepare the upgrade curl -k -o /etc/yum.repos.d/oam-group-leapp-rhel-8.repo https://gitlab.cee.redhat.com/leapp/oamg-rhel8-vagrant/-/raw/master/roles/init/files/leapp-copr.repo -dnf install -y leapp-upgrade-el8toel9 vdo +# install the leapp upgrade tool + other dependencies +dnf install -y leapp-upgrade-el8toel9 vdo jq rpmdevtools curl -kLO https://gitlab.cee.redhat.com/leapp/oamg-rhel7-vagrant/raw/master/roles/init/files/prepare_test_env.sh source /root/prepare_test_env.sh get_data_files diff --git a/test/data/upgrade8to9/upgrade_verify.sh b/test/data/upgrade8to9/upgrade_verify.sh index aa18b40d9..6cba02889 100755 --- a/test/data/upgrade8to9/upgrade_verify.sh +++ b/test/data/upgrade8to9/upgrade_verify.sh @@ -2,7 +2,7 @@ set -euxo pipefail -source /usr/libexec/tests/osbuild-composer/shared_lib.sh +source shared_lib.sh WORKSPACE=$(mktemp -d) function cleanup() { @@ -44,9 +44,6 @@ COMPOSE_INFO=${WORKSPACE}/compose-info-${IMAGE_KEY}.json # check installed osbuild-composer version rpm -qi osbuild-composer -# install jq in case it's not present -dnf install -y jq - # Prepare repository override mkdir -p /etc/osbuild-composer/repositories tee /etc/osbuild-composer/repositories/rhel-91.json > /dev/null << EOF