diff --git a/Regression/Fail-to-update-filesystem-inside-systemd-nspawn/runtest.sh b/Regression/Fail-to-update-filesystem-inside-systemd-nspawn/runtest.sh index 73201b8..733c1f2 100755 --- a/Regression/Fail-to-update-filesystem-inside-systemd-nspawn/runtest.sh +++ b/Regression/Fail-to-update-filesystem-inside-systemd-nspawn/runtest.sh @@ -30,16 +30,30 @@ PACKAGE="filesystem" CONTAINER_NAME="test-container" -SETUP_LOG="/root/setup.log" -TEST_LOG="/root/test.log" +SETUP_LOG="setup.log" +TEST_LOG="test.log" rlJournalStart rlPhaseStartSetup rlAssertRpm systemd-container - VERSION=$(cat /etc/redhat-release | grep -oP '([0-9]).*' | grep -oP '^([0-9])*') - rlRun "yum -y --nogpg --releasever=$VERSION --installroot=/var/lib/machines/$CONTAINER_NAME install dnf &>> $SETUP_LOG" 0 "Installing dnf into container" - rlRun "yumdownloader --downloadonly --destdir /var/lib/machines/$CONTAINER_NAME/ $PACKAGE &>> $SETUP_LOG" 0 "Downloading $PACKAGE rpm into container" + rlAssertRpm filesystem + + rlRun "TmpDir=\$(mktemp -d)" 0 "Creating tmp directory" + rlRun "pushd $TmpDir" + + rlRun "mkdir -p /var/lib/machines/$CONTAINER_NAME" 0 "Create the install root directory" + + rlRun "mkdir -p /var/lib/machines/$CONTAINER_NAME/etc/yum.repos.d" + rlRun "cp /etc/yum.repos.d/* /var/lib/machines/$CONTAINER_NAME/etc/yum.repos.d/" 0 "Copy repository configuration files" + + rlRun "mkdir -p /var/lib/machines/$CONTAINER_NAME/etc" + rlRun "cp /etc/{hosts,resolv.conf} /var/lib/machines/$CONTAINER_NAME/etc/" 0 "Copy basic configuration files" + + VERSION=$(cat /etc/redhat-release | grep -oP '([0-9]).*' | grep -oP '^([0-9])*') + + rlRun "dnf -y --nogpgcheck --releasever=$VERSION --installroot=/var/lib/machines/$CONTAINER_NAME install dnf &>> $SETUP_LOG" 0 "Installing dnf into container" + rlRun "dnf download --destdir=/var/lib/machines/$CONTAINER_NAME --resolve $PACKAGE &>> $SETUP_LOG" 0 "Downloading $PACKAGE rpm into container" rlPhaseEnd rlPhaseStartTest @@ -47,6 +61,8 @@ rlJournalStart rlPhaseEnd rlPhaseStartCleanup + rlRun "popd" + rlRun "rm -r $TmpDir" 0 "Removing tmp directory" rlRun "rm -rf /var/lib/machines/$CONTAINER_NAME" 0 "Removing container" rlPhaseEnd rlJournalPrintText