diff --git a/tests/scripts/acceptance_freeze.sh b/tests/scripts/acceptance_freeze.sh new file mode 100755 index 0000000..01de230 --- /dev/null +++ b/tests/scripts/acceptance_freeze.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +echo "Test that Windows XP\Windows 2003 are frozen and didn't change" + +# Compare with the old package +URL_OLD=`head -n 1 package.cfg` +wget $URL_OLD + +# Unpack previous version ISO +rpm2cpio ./virtio-win-1.9.7-2.el8.noarch.rpm | cpio -idmv + +# Mount previous ISO +mkdir mnt_iso_old +mount ./usr/share/virtio-win/virtio-win.iso mnt_iso_old -o loop + +# Mount current ISO +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" +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 ] +then + echo "Success: Files for Windows XP/2003/2008 were not changed" + exit 0 +else + echo "Failure: Files for Windows XP/2003/2008 were changed" + exit 1 +fi + diff --git a/tests/scripts/package.cfg b/tests/scripts/package.cfg new file mode 100644 index 0000000..f57a469 --- /dev/null +++ b/tests/scripts/package.cfg @@ -0,0 +1 @@ +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 diff --git a/tests/tests.yml b/tests/tests.yml index 5826d18..cc519e6 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -5,7 +5,7 @@ tags: - classic tests: - - simple: + - freeze_xp_test: dir: scripts - run: ./run_tests.sh + run: ./acceptance_freeze.sh