You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
821 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#!/bin/bash
set -e
echo "Тест получения названия MSVSphere ОС из ISO образа"
echo "=================================================="
echo ""
source library/sh_lib.sh
check=0
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# echo "Script dir: ${SCRIPT_DIR}"
ISO_IMAGES_URLS_FILE="${SCRIPT_DIR}/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}