Add scripts that are comparing INF versions

The comparison is between the versions that are present in
signed drivers repository and should be present in
signed_drivers_versions.txt file.
The comparison is based on driver version in INF file.

- Resolves: rhbz#1738372

Signed-off-by: Yan Vugenfirer <yvugenfi@redhat.com>
This commit is contained in:
Yan Vugenfirer 2020-08-09 16:07:21 +03:00
parent eb20b4eebf
commit 3e656e3163
6 changed files with 54 additions and 9 deletions

View File

@ -18,10 +18,6 @@ rpm2cpio $RPM_OLD | cpio -idmv
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 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

View File

@ -3,9 +3,11 @@
umount mnt_iso
umount mnt_iso_old
rm freeze_results.txt
rm compare_results.txt
rm *.rpm
rm -rf usr
rmdir mnt_iso
rmdir mnt_iso_old
rm -rf virtio-win-prewhql-*

View File

@ -0,0 +1,38 @@
#!/bin/sh
drivers=(viostor vioserial vioscsi viorng vioinput pvpanic NetKVM Balloon)
oses=(2k12 2k12R2 2k16 2k19 w10 w8.1 w8)
platfroms=(amd64 x86)
COMPARE_FILE=installed_signed_versions.txt
RESULT_FILE=compare_result.txt
echo "Compare versions in INF files"
rm $COMPARE_FILE
cd mnt_iso
for driver in ${drivers[@]}; do
cd $driver
for os in ${oses[@]}; do
for p in ${platfroms[@]}; do
if [ $os=="w8" ]; then
grep -Rr --include="*.inf" DriverVer | grep "$os" | grep "$p" | grep -v "w8.1" >> ../../$COMPARE_FILE
else
grep -Rr --include="*.inf" DriverVer | grep "$os" | grep "$p" >> ../../$COMPARE_FILE
fi
done
done
cd ..
done
cd ..
diff signed_drivers_versions.txt $COMPARE_FILE > $RESULT_FILE
if [ -s $RESULT_FILE ]
then
echo "Failure: versions of some of the drivers are different!"
cat $RESULT_FILE
exit 1
else
echo "Success: INF versions are correct."
exit 0
fi

8
tests/scripts/mount_iso.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
echo "Mount installed virtio-win ISO"
mkdir mnt_iso
mount /usr/share/virtio-win/virtio-win.iso mnt_iso -o loop

View File

@ -1,4 +0,0 @@
#!/bin/sh
echo "Testing gating, let's fail"
exit 1

View File

@ -5,7 +5,12 @@
tags:
- classic
tests:
- mount_iso:
dir: scripts
run: ./mount_iso.sh
- freeze_xp_test:
dir: scripts
run: ./acceptance_freeze.sh
- compare_inf_versions:
dir: scripts
run: compare_singed_versions.sh