diff --git a/rpm_tests/p_osinfo-db/001-prepare_environment.sh b/rpm_tests/p_osinfo-db/001-prepare_environment.sh new file mode 100755 index 0000000..d033188 --- /dev/null +++ b/rpm_tests/p_osinfo-db/001-prepare_environment.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Подготовка окружения для тестирования пакета ${TEST_PACKAGE_NAME}" + +dnf install -y libosinfo + +exit 0 diff --git a/rpm_tests/p_osinfo-db/01-msvsphere-present.sh b/rpm_tests/p_osinfo-db/01-msvsphere-present.sh new file mode 100755 index 0000000..08978d0 --- /dev/null +++ b/rpm_tests/p_osinfo-db/01-msvsphere-present.sh @@ -0,0 +1,16 @@ +#!/bin/bash -x + +echo "Тест наличия MSVSphere ОС в БД osinfo" + +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} diff --git a/rpm_tests/p_osinfo-db/02-check-image.sh b/rpm_tests/p_osinfo-db/02-check-image.sh new file mode 100755 index 0000000..06c3b8a --- /dev/null +++ b/rpm_tests/p_osinfo-db/02-check-image.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +echo "Тест получения названия MSVSphere ОС из ISO образа" + +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} diff --git a/rpm_tests/p_osinfo-db/files/msvsphereiso_url.txt b/rpm_tests/p_osinfo-db/files/msvsphereiso_url.txt new file mode 100644 index 0000000..aa48d23 --- /dev/null +++ b/rpm_tests/p_osinfo-db/files/msvsphereiso_url.txt @@ -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