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.
This commit is contained in:
Jakub Rusz 2022-09-15 10:26:41 +02:00 committed by Tomáš Hozza
parent d40dbd6f0b
commit 1050f8a506
3 changed files with 4 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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