From eb20b4eebfe267909679d69c4b75a5bbbfeca3fd Mon Sep 17 00:00:00 2001 From: Yan Vugenfirer Date: Thu, 6 Aug 2020 14:12:08 +0300 Subject: [PATCH] Improve old drivers freeze test for gating The added script will test during gating time that old drivers for Windows XP, Server 2003 and Server 2008 were not changed. - Resolves: rhbz#1738372 Signed-off-by: Yan Vugenfirer --- tests/scripts/acceptance_freeze.sh | 24 +++++++++++++----------- tests/scripts/cleanup.sh | 11 +++++++++++ tests/scripts/package.cfg | 3 ++- 3 files changed, 26 insertions(+), 12 deletions(-) create mode 100755 tests/scripts/cleanup.sh diff --git a/tests/scripts/acceptance_freeze.sh b/tests/scripts/acceptance_freeze.sh index 01de230..e380d37 100755 --- a/tests/scripts/acceptance_freeze.sh +++ b/tests/scripts/acceptance_freeze.sh @@ -1,13 +1,18 @@ #!/bin/sh -echo "Test that Windows XP\Windows 2003 are frozen and didn't change" +echo "Test that Windows XP\Windows Server 2003 are frozen and didn't change" # Compare with the old package URL_OLD=`head -n 1 package.cfg` +RPM_OLD=`tail -n 1 package.cfg` + +echo "Old package URL " $URL_OLD +echo "Old rpm" $RPM_OLD + wget $URL_OLD # Unpack previous version ISO -rpm2cpio ./virtio-win-1.9.7-2.el8.noarch.rpm | cpio -idmv +rpm2cpio $RPM_OLD | cpio -idmv # Mount previous ISO mkdir mnt_iso_old @@ -18,18 +23,15 @@ mkdir mnt_iso mount /usr/share/virtio-win/virtio-win.iso mnt_iso -o loop # Check unchanged files(winxp/win2k3/2k8) -echo "begin to check if the files for winxp/2003/2008 are unchanged" +echo "begin to check if the files for winxp/2003 are unchanged" for i in `find mnt_iso -maxdepth 4 -mindepth 1 -type f | grep xp`;do diff $i ${i/mnt_iso/mnt_iso_old} >> freeze_results.txt; done for i in `find mnt_iso -maxdepth 4 -mindepth 1 -type f | grep 2k3`;do diff $i ${i/mnt_iso/mnt_iso_old} >> freeze_results.txt; done -for i in `find mnt_iso -maxdepth 4 -mindepth 1 -type f | grep 2k8`;do diff $i ${i/mnt_iso/mnt_iso_old} >> freezeresults.txt; done -cat freeze_results.txt -if [ $? -eq 1 ] +if [ -s freeze_results.txt ] then - echo "Success: Files for Windows XP/2003/2008 were not changed" - exit 0 + echo "Failure: Files for Windows XP/2003 were changed" + exit 1 else - echo "Failure: Files for Windows XP/2003/2008 were changed" - exit 1 + echo "Success: Files for Windows XP/2003 were not changed" + exit 0 fi - diff --git a/tests/scripts/cleanup.sh b/tests/scripts/cleanup.sh new file mode 100755 index 0000000..73736c4 --- /dev/null +++ b/tests/scripts/cleanup.sh @@ -0,0 +1,11 @@ +#~/bin/sh + +umount mnt_iso +umount mnt_iso_old +rm freeze_results.txt +rm *.rpm +rm -rf usr + +rmdir mnt_iso +rmdir mnt_iso_old + diff --git a/tests/scripts/package.cfg b/tests/scripts/package.cfg index f57a469..7655c28 100644 --- a/tests/scripts/package.cfg +++ b/tests/scripts/package.cfg @@ -1 +1,2 @@ -http://download.eng.bos.redhat.com/brewroot/vol/rhel-8/packages/virtio-win/1.9.7/2.el8/noarch/virtio-win-1.9.7-2.el8.noarch.rpm +http://download.eng.bos.redhat.com/brewroot/vol/rhel-8/packages/virtio-win/1.9.11/1.el8/noarch/virtio-win-1.9.11-1.el8.noarch.rpm +virtio-win-1.9.11-1.el8.noarch.rpm