https://dev-ci.inferitos.ru/job/rpmTests/job/Docker_tests/320/
Co-authored-by: Pavel Negrobov <Pavel.Negrobov@softline.com>
Reviewed-on: #1
pull/2/head
Pavel Negrobov 1 year ago
parent 1cd931780e
commit 326536f339

@ -0,0 +1,7 @@
#!/bin/bash
echo "Подготовка окружения для тестирования пакета ${TEST_PACKAGE_NAME}"
dnf install -y libosinfo
exit 0

@ -0,0 +1,18 @@
#!/bin/bash -x
echo "Тест наличия MSVSphere ОС в БД osinfo"
echo "====================================="
echo ""
source ../../library/sh_lib.sh
check=0
/usr/bin/osinfo-query os | /bin/grep -i msvsphere8
check=$(eq_is_success ${check} 0)
/usr/bin/osinfo-query os | /bin/grep -i msvsphere9
check=$(eq_is_success ${check} 0)
check_test_status ${check} "$0"
exit ${check}

@ -0,0 +1,24 @@
#!/bin/bash
echo "Тест получения названия MSVSphere ОС из ISO образа"
echo "=================================================="
echo ""
source ../../library/sh_lib.sh
check=0
ISO_IMAGES_URLS_FILE='files/msvsphereiso_url.txt'
EXPECTED_MESSAGE="Media is bootable.
Media is an installer for OS 'MSVSphere 9 (x86_64)'"
while read LINE; do
curl -LJs -r 0-1048576 -o img.iso $LINE
OUTPUT="$(/usr/bin/osinfo-detect img.iso 2>&1)"
[[ "$OUTPUT" == "$EXPECTED_MESSAGE" ]]
check=$(eq_is_success ${check} 0)
echo "RESULT: File: $LINE; Result: $check"
rm -f img.iso
done < $ISO_IMAGES_URLS_FILE
check_test_status ${check} "$0"
exit ${check}

@ -0,0 +1,44 @@
#!/bin/bash
echo "Тест проверки целостности ISO образов MSVSphere ОС"
echo "=================================================="
echo ""
source ../../library/sh_lib.sh
echo "ATTENSION: Test tomporarely skipped."
exit 0
check=0
ISO_IMAGES_URLS_FILE='files/msvsphereiso_url.txt'
while read LINE; do
ISO_FILENAME=`basename $LINE`
ISO_URL_PATH="${LINE%/*}"
LOCAL_FILE="/home/pavel/MSVSphere-images/$ISO_FILENAME"
CHECKSUM_FILE_URL="$ISO_URL_PATH/$ISO_FILENAME.CHECKSUM"
echo "ISO URL: $LINE"
echo "Local file path: $LOCAL_FILE"
echo "Checksum File: $CHECKSUM_FILE_URL"
# Get SHA256 hash value:
# curl -s https://rsync.inferitos.ru/msvsphere/9.3/isos/x86_64/MSVSphere-9.3-x86_64-arm.iso.CHECKSUM | /bin/grep SHA256 | /bin/grep -v Hash: | /bin/awk -F '=' '{gsub(/ /, "", $2); print $2}'
SHA256_HASH_FROM_FILE="$(curl -s $CHECKSUM_FILE_URL | /bin/grep SHA256 | /bin/grep -v Hash: | /bin/awk -F '=' '{gsub(/ /, "", $2); print $2}')"
# curl -LJs -r 0-1048576 -o img.iso $LINE
# sha256sum /home/pavel/MSVSphere-images/MSVSphere-9.3-x86_64-arm.iso | /bin/awk -F ' ' '{ print $1 }'
SHA256_HASH_CALCULATED="$(sha256sum $LOCAL_FILE | /bin/awk -F ' ' '{ print $1 }')"
# Test and print results
echo "Calculated file SHA256 hash: $SHA256_HASH_CALCULATED"
echo "SHA256 hash from CHECKSUM file: $SHA256_HASH_FROM_FILE"
if [ "$SHA256_HASH_CALCULATED" == "$SHA256_HASH_FROM_FILE" ]; then
echo 'SHA256 hash OK'
else
echo 'ERROR: SHA256 hash mismatch!!!'
let check+=1
fi
echo "--------------------------"
done < $ISO_IMAGES_URLS_FILE
check_test_status ${check} "$0"
exit ${check}

@ -0,0 +1,5 @@
/home/pavel/MSVSphere-images/MSVSphere-9.3-x86_64-dvd.iso
/home/pavel/MSVSphere-images/MSVSphere-9.3-x86_64-netinstall.iso
/home/pavel/MSVSphere-images/MSVSphere-9.3-x86_64-minimal.iso
/home/pavel/MSVSphere-images/MSVSphere-9.3-x86_64-server.iso
/home/pavel/MSVSphere-images/MSVSphere-9.3-x86_64-arm.iso

@ -0,0 +1,5 @@
https://rsync.inferitos.ru/msvsphere/9.3/isos/x86_64/MSVSphere-9.3-x86_64-dvd.iso
https://rsync.inferitos.ru/msvsphere/9.3/isos/x86_64/MSVSphere-9.3-x86_64-netinstall.iso
https://rsync.inferitos.ru/msvsphere/9.3/isos/x86_64/MSVSphere-9.3-x86_64-minimal.iso
https://rsync.inferitos.ru/msvsphere/9.3/isos/x86_64/MSVSphere-9.3-x86_64-server.iso
https://rsync.inferitos.ru/msvsphere/9.3/isos/x86_64/MSVSphere-9.3-x86_64-arm.iso
Loading…
Cancel
Save