Commit defd3a84 authored by Thomas Abraham's avatar Thomas Abraham
Browse files

sgi/tests: adapt the help messages to the new product names



Adapt the help messages in the test execute scripts to the new product
names. In addition to this, use helper functions to simplify the
script code.

Change-Id: I4e1969434b6bbb10b4b5cd31158d4f743e4bd326
Signed-off-by: Thomas Abraham's avatarThomas Abraham <thomas.abraham@arm.com>
parent 35a44f5a
......@@ -32,19 +32,26 @@
source $PWD/../sgi/sgi_common_util.sh
declare -A sgi_platforms
sgi_platforms[sgi575]=1
sgi_platforms[rdn1edge]=1
sgi_platforms[rde1edge]=1
# List of all the supported platforms.
declare -A platforms_sgi
platforms_sgi[sgi575]=1
declare -A platforms_rdinfra
platforms_rdinfra[rdn1edge]=1
__print_supported_sgi_platforms()
__print_examples()
{
echo "Supported platforms are -"
for plat in "${!sgi_platforms[@]}" ;
do
printf "\t $plat \n"
done
echo "Example 1: ./acs.sh -p $1"
echo " Executes ACS tests for $1 platform. The luv live image is picked"
echo " from the location \"output/$1/luv-live-image-gpt.img\""
echo
echo "Example 2: ./acs.sh -p $1 -j true"
echo " Executes ACS tests for $1 platform and terminates the fvp model"
echo " automatically when the test ends. The luv live image is picked"
echo " from the location \"output/$1/luv-live-image-gpt.img\""
echo ""
echo "Example 3: ./acs.sh -p $1 -v ~/prebuilts/acs/luv-live-image-gpt.img"
echo " Executes ACS tests for $1 platform. The luv live image is picked"
echo " from the location \"~/prebuilts/acs/luv-live-image-gpt.img\""
}
print_usage ()
......@@ -60,19 +67,8 @@ print_usage ()
echo " -v Absolute path of luv-live image (optional)"
echo " -a Additional model parameters, if any"
echo ""
__print_supported_sgi_platforms
echo "Example 1: ./acs.sh -p sgi575"
echo " Executes ACS tests for sgi575 platform. The luv live image is picked"
echo " from the location \"output/sgi575/luv-live-image-gpt.img\""
echo
echo "Example 2: ./acs.sh -p sgi575 -j true"
echo " Executes ACS tests for sgi575 platform and terminates the fvp model"
echo " automatically when the test ends. The luv live image is picked"
echo " from the location \"output/sgi575/luv-live-image-gpt.img\""
echo ""
echo "Example 3: ./acs.sh -p sgi575 -v ~/prebuilts/acs/luv-live-image-gpt.img"
echo " Executes ACS tests for sgi575 platform. The luv live image is picked"
echo " from the location \"~/prebuilts/acs/luv-live-image-gpt.img\""
__print_supported_platforms_$refinfra
__print_examples_$refinfra
echo ""
}
......@@ -90,19 +86,19 @@ get_acs_test_results()
# Copy the SBSA/SBBR results from the LUV-RESULTS partition
dd if=$acs_image of=luvres skip=${arr[0]} count=${arr[1]} &> /dev/null
mcopy -i luvres ::/Sbsa_results/uefi/SbsaResults.log $outdir/sgi-${MODEL_PID}-sbsaResults_uefi_${CURRENT_DATE_TIME}.log
mcopy -i luvres ::/Sbsa_results/linux/SbsaResults.log $outdir/sgi-${MODEL_PID}-sbsaResults_linux_${CURRENT_DATE_TIME}.log
mcopy -i luvres ::/results.md $outdir/sgi-${MODEL_PID}-acs_results_${CURRENT_DATE_TIME}.md
mcopy -i luvres ::/Sbsa_results/uefi/SbsaResults.log $outdir/refinfra-${MODEL_PID}-sbsaResults_uefi_${CURRENT_DATE_TIME}.log
mcopy -i luvres ::/Sbsa_results/linux/SbsaResults.log $outdir/refinfra-${MODEL_PID}-sbsaResults_linux_${CURRENT_DATE_TIME}.log
mcopy -i luvres ::/results.md $outdir/refinfra-${MODEL_PID}-acs_results_${CURRENT_DATE_TIME}.md
# Check whether the results are extracted successfully or not
if [ -f "$outdir/sgi-${MODEL_PID}-sbsaResults_uefi_${CURRENT_DATE_TIME}.log" ] && \
[ -f "$outdir/sgi-${MODEL_PID}-sbsaResults_linux_${CURRENT_DATE_TIME}.log" ] && \
[ -f "$outdir/sgi-${MODEL_PID}-acs_results_${CURRENT_DATE_TIME}.md" ]; then
if [ -f "$outdir/refinfra-${MODEL_PID}-sbsaResults_uefi_${CURRENT_DATE_TIME}.log" ] && \
[ -f "$outdir/refinfra-${MODEL_PID}-sbsaResults_linux_${CURRENT_DATE_TIME}.log" ] && \
[ -f "$outdir/refinfra-${MODEL_PID}-acs_results_${CURRENT_DATE_TIME}.md" ]; then
flag=true
echo "Detailed SBSA/SBBR results:"
echo "SBSA UEFI shell tests results are at $outdir/sgi-${MODEL_PID}-sbsaResults_uefi_${CURRENT_DATE_TIME}.log"
echo "SBSA OS tests results are at $outdir/sgi-${MODEL_PID}-sbsaResults_linux_${CURRENT_DATE_TIME}.log"
echo "LuvOS test results are at $outdir/sgi-${MODEL_PID}-acs_results_${CURRENT_DATE_TIME}.md"
echo "SBSA UEFI shell tests results are at $outdir/refinfra-${MODEL_PID}-sbsaResults_uefi_${CURRENT_DATE_TIME}.log"
echo "SBSA OS tests results are at $outdir/refinfra-${MODEL_PID}-sbsaResults_linux_${CURRENT_DATE_TIME}.log"
echo "LuvOS test results are at $outdir/refinfra-${MODEL_PID}-acs_results_${CURRENT_DATE_TIME}.md"
fi
if [[ ! "$flag" = true ]]; then
echo "SBSA/SBBR results files are not exist in LUV-RESULTS partitions"
......@@ -144,16 +140,7 @@ while getopts "p:n:a:j:v:h" opt; do
done
#Ensure that the platform is supported
if [ -z "$platform" ] ; then
print_usage
exit 1
fi
if [ -z "${sgi_platforms[$platform]}" ] ; then
echo "[ERROR] Could not deduce the selected platform."
__print_supported_sgi_platforms
exit 1
fi
__parse_params_validate
#Run the SBSA/SBBR tests
if [ "$prebuilt" != "true" ]; then
......
......@@ -33,30 +33,39 @@ platform_dir=""
source $PWD/../sgi/sgi_common_util.sh
declare -A sgi_platforms
sgi_platforms[sgi575]=1
sgi_platforms[rdn1edge]=1
sgi_platforms[rde1edge]=1
# List of all the supported platforms.
declare -A platforms_sgi
platforms_sgi[sgi575]=1
declare -A platforms_rdinfra
platforms_rdinfra[rdn1edge]=1
platforms_rdinfra[rde1edge]=1
__print_supported_sgi_platforms()
__print_examples()
{
echo "Supported platforms are -"
for plat in "${!sgi_platforms[@]}" ;
do
printf "\t $plat \n"
done
echo
echo "Example 1: ./boot.sh -p $1"
echo " Starts the execution of the $1 model and the software boots upto the"
echo " busybox prompt"
echo ""
echo "Example 2: ./boot.sh -p $1 -n true"
echo " Starts the execution of the $1 model and the software boots upto the"
echo " busybox prompt. The model supports networking allowing the software running"
echo " within the model to access the network."
echo ""
echo "Example 3: ./boot.sh -p $1 -n true -a \"board.flash0.diagnostics=1\""
echo " Starts the execution of the $1 model with networking enabled and the"
echo " software boots upto the busybox prompt. Additional parameters to the model"
echo " are supplied using the -a command line parameter."
}
print_usage ()
{
echo ""
echo "Boots upto busybox console on a specified SGI platform."
echo "Boots upto busybox console on a specified platform."
echo "Usage: ./boot.sh -p <platform> [-n <true|false>] [-a \"model params\"] [-j <true|false>]"
echo ""
echo "Supported command line parameters - "
echo " -p Specifies the SGI platform to be selected. See below for list of"
echo " SGI platforms supported \(mandatory\)"
echo " -p Specifies the platform to be selected. See below for list of"
echo " platforms supported \(mandatory\)"
echo " -n Enable or disable network controller support on the platform \(optional\)."
echo " If not specified, network support is disabled by default."
echo " -j Enable or disable auto termination of the model after booting upto"
......@@ -64,21 +73,8 @@ print_usage ()
echo " to keep the model executing."
echo " -a Additional model parameters \(optional\)."
echo ""
__print_supported_sgi_platforms
echo ""
echo "Example 1: ./boot.sh -p sgi575"
echo " Starts the execution of the SGI-575 model and the software boots upto the"
echo " busybox prompt"
echo ""
echo "Example 2: ./boot.sh -p sgi575 -n true"
echo " Starts the execution of the SGI-575 model and the software boots upto the"
echo " busybox prompt. The model supports networking allowing the software running"
echo " within the model to access the network."
echo ""
echo "Example 3: ./boot.sh -p sgi575 -n true -a \"board.flash0.diagnostics=1\""
echo " Starts the execution of the SGI-575 model with networking enabled and the"
echo " software boots upto the busybox prompt. Additional parameters to the model"
echo " are supplied using the -a command line parameter."
__print_supported_platforms_$refinfra
__print_examples_$refinfra
echo ""
}
......@@ -99,15 +95,7 @@ while getopts "p:n:a:j:h" opt; do
done
#Ensure that the platform is supported
if [ -z "$platform" ] ; then
print_usage
exit 1
fi
if [ -z "${sgi_platforms[$platform]}" ] ; then
echo "[ERROR] Could not deduce the selected platform."
__print_supported_sgi_platforms
exit 1
fi
__parse_params_validate
platform_dir="platforms/$platform"
pushd $platform_dir
......
......@@ -38,20 +38,12 @@ platform_dir=""
network=false
extra_param=""
declare -A sgi_platforms
sgi_platforms[sgi575]=1
sgi_platforms[rdn1edge]=1
sgi_platforms[rde1edge]=1
__print_supported_sgi_platforms()
{
echo "Supported platforms are -"
for plat in "${!sgi_platforms[@]}" ;
do
printf "\t $plat \n"
done
echo
}
# List of all the supported platforms.
declare -A platforms_sgi
platforms_sgi[sgi575]=1
declare -A platforms_rdinfra
platforms_rdinfra[rdn1edge]=1
platforms_rdinfra[rde1edge]=1
install ()
{
......@@ -113,14 +105,26 @@ boot ()
esac
}
__print_examples()
{
echo "Example 1: ./distro.sh -p $1 -i Fedora-Server-dvd-aarch64-27-1.6.iso -s 16"
echo " Installs Fedora 27 on to a 16 GB disk."
echo ""
echo "Example 2: ./distro.sh -p $1"
echo " Finds an available installed disk image and boots from it."
echo ""
echo "Example 3: ./distro.sh -p $1 -d fedora27.satadisk"
echo " Boot from an existing installed disk image"
}
print_usage ()
{
echo ""
echo "Install or boot linux distribution on SGI platforms"
echo "Install or boot linux distribution."
echo "Usage: ./distro.sh -p <platform> -i <image> -s <disk size> [-d <disk image>] [-n <true|false>] [-a \"model params\"]"
echo ""
echo "Supported command line parameters:"
echo " -p SGI platform name (mandatory)"
echo " -p platform name (mandatory)"
echo " -i Image, takes a path to an iso installer image (mandatory for installation)"
echo " -s Disk size in GB (mandatory for installation)"
echo " -d Disk image with previously installed distro, used for"
......@@ -129,15 +133,8 @@ print_usage ()
echo " -n Enable network: true or false (default: false)"
echo " -a Additional model parameters, if any"
echo ""
__print_supported_sgi_platforms
echo "Example 1: ./distro.sh -p sgi575 -i Fedora-Server-dvd-aarch64-27-1.6.iso -s 16"
echo " Installs Fedora 27 on to a 16 GB disk."
echo ""
echo "Example 2: ./distro.sh -p sgi575"
echo " Finds an available installed disk image and boots from it."
echo ""
echo "Example 3: ./distro.sh -p sgi575 -d fedora27.satadisk"
echo " Boot from an existing installed disk image"
__print_supported_platforms_$refinfra
__print_examples_$refinfra
echo ""
}
......@@ -168,7 +165,6 @@ while getopts "p:i:s:d:n:a:h" opt; do
esac
done
# Either an installer and a disk size is specified or neither.
# If they are specified, create a new disk and boot the model with those params
# if not, check for an existing .satadisk file and use that to boot from
......@@ -187,15 +183,7 @@ else
fi
#Ensure that the platform is supported
if [ -z "$platform" ] ; then
print_usage
exit 1
fi
if [ -z "${sgi_platforms[$platform]}" ] ; then
echo "[ERROR] Could not deduce the selected platform."
__print_supported_sgi_platforms
exit 1
fi
__parse_params_validate
platform_dir="platforms/$platform"
......
......@@ -44,10 +44,12 @@ source $PWD/../sgi/sgi_common_util.sh
HOST_OS_LOG_FILE=kvm_test_host_os_${MYPID}_$CURRENT_DATE_TIME.log
GUEST_OS0_BOOT_LOG=kvm_test_guest_os0_${MYPID}_$CURRENT_DATE_TIME.log
declare -A sgi_platforms
sgi_platforms[sgi575]=1
sgi_platforms[rdn1edge]=1
sgi_platforms[rde1edge]=1
# List of all the supported platforms.
declare -A platforms_sgi
platforms_sgi[sgi575]=1
declare -A platforms_rdinfra
platforms_rdinfra[rdn1edge]=1
platforms_rdinfra[rde1edge]=1
##
# Start guest os with lkvm
......@@ -89,15 +91,20 @@ get_kvm_results () {
return 0
}
__print_supported_sgi_platforms()
__print_examples()
{
echo "Supported platforms are -"
for plat in "${!sgi_platforms[@]}" ;
do
printf "\t $plat \n"
done
echo
echo "Example 1: ./kvm.sh -p $1"
echo " Boot the distro image for KVM test."
echo ""
echo "Example 2: ./kvm.sh -p $1 -n true"
echo " Boot the distro image for KVM test with network enabled."
echo ""
echo "Example 3: ./kvm.sh -p $1 -j true -n true"
echo " Boot the distro image for KVM and automate the test."
echo ""
echo "Note: For automating the KVM test, it is a prerequisite to have"
echo " tap interface set in the host machine."
}
print_usage ()
......@@ -107,23 +114,13 @@ print_usage ()
echo "Usage: ./kvm.sh -p <platform> [-n <true|false>] [-j <true|false>] [-a \"model params\"]"
echo ""
echo "Supported command line parameters:"
echo " -p SGI platform name (mandatory)"
echo " -p platform name (mandatory)"
echo " -n Enable network: true or false (default: false)"
echo " -j Automate kvm test: true or false (default: false)"
echo " -a Additional model parameters, if any"
echo ""
__print_supported_sgi_platforms
echo "Example 1: ./kvm.sh -p sgi575"
echo " Boot the distro image for KVM test."
echo ""
echo "Example 2: ./kvm.sh -p sgi575 -n true"
echo " Boot the distro image for KVM test with network enabled."
echo ""
echo "Example 3: ./kvm.sh -p sgi575 -j true -n true"
echo " Boot the distro image for KVM and automate the test."
echo ""
echo "Note: For automating the KVM test, it is a prerequisite to have"
echo " tap interface set in the host machine."
__print_supported_platforms_$refinfra
__print_examples_$refinfra
echo ""
}
......@@ -148,17 +145,8 @@ while getopts "p:n:a:j:h" opt; do
esac
done
# Ensure that the platform is supported
if [ -z "$platform" ] ; then
print_usage
exit 1
fi
if [ -z "${sgi_platforms[$platform]}" ] ; then
echo "[ERROR] Could not deduce the selected platform."
__print_supported_sgi_platforms
exit 1
fi
#Ensure that the platform is supported
__parse_params_validate
platform_dir="platforms/$platform"
RESULT_OUTPUT_FOLDER="$RUNDIR/$platform_dir/$platform/kvm_test_results"
......
......@@ -45,19 +45,26 @@ RESULT_FILE=ras_test_result.log
source $PWD/../sgi/sgi_common_util.sh
declare -A sgi_platforms
sgi_platforms[sgi575]=1
sgi_platforms[rdn1edge]=1
sgi_platforms[rde1edge]=1
__print_supported_sgi_platforms()
# List of all the supported platforms.
declare -A platforms_sgi
platforms_sgi[sgi575]=1
declare -A platforms_rdinfra
platforms_rdinfra[rdn1edge]=1
platforms_rdinfra[rde1edge]=1
__print_examples()
{
echo "Supported platforms are -"
for plat in "${!sgi_platforms[@]}" ;
do
printf "\t $plat \n"
done
echo
echo "Example 1: ./ras.sh -p $1"
echo " Boot the distro image for RAS test."
echo ""
echo "Example 2: ./ras.sh -p $1 -n true"
echo " Boot the distro image for RAS test with network enabled."
echo ""
echo "Example 3: ./ras.sh -p $1 -j true -n true"
echo " Boot the distro image for RAS and automate the test."
echo ""
echo "Note: For automating the RAS test, it is a prerequisite to have"
echo " tap interface set in the host machine."
}
print_usage ()
......@@ -67,23 +74,13 @@ print_usage ()
echo "Usage: ./ras.sh -p <platform> [-n <true|false>] [-j <true|false>] [-a \"model params\"]"
echo ""
echo "Supported command line parameters:"
echo " -p SGI platform name (mandatory)"
echo " -p platform name (mandatory)"
echo " -n Enable network: true or false (default: false)"
echo " -j Automate ras test: true or false (default: false)"
echo " -a Additional model parameters, if any"
echo ""
__print_supported_sgi_platforms
echo "Example 1: ./ras.sh -p sgi575"
echo " Boot the distro image for RAS test."
echo ""
echo "Example 2: ./ras.sh -p sgi575 -n true"
echo " Boot the distro image for RAS test with network enabled."
echo ""
echo "Example 3: ./ras.sh -p sgi575 -j true -n true"
echo " Boot the distro image for RAS and automate the test."
echo ""
echo "Note: For automating the RAS test, it is a prerequisite to have"
echo " tap interface set in the host machine."
__print_supported_platforms_$refinfra
__print_examples_$refinfra
echo ""
}
......@@ -160,16 +157,7 @@ while getopts "p:n:a:j:h" opt; do
done
#Ensure that the platform is supported
if [ -z "$platform" ] ; then
print_usage
exit 1
fi
if [ -z "${sgi_platforms[$platform]}" ] ; then
echo "[ERROR] Could not deduce the selected platform."
__print_supported_sgi_platforms
exit 1
fi
__parse_params_validate
platform_dir="platforms/$platform"
......
......@@ -32,39 +32,36 @@
source $PWD/../sgi/sgi_common_util.sh
declare -A sgi_platforms
sgi_platforms[sgi575]=1
sgi_platforms[rdn1edge]=1
sgi_platforms[rde1edge]=1
__print_supported_sgi_platforms()
# List of all the supported platforms.
declare -A platforms_sgi
platforms_sgi[sgi575]=1
declare -A platforms_rdinfra
platforms_rdinfra[rdn1edge]=1
platforms_rdinfra[rde1edge]=1
__print_examples()
{
echo "Supported platforms are -"
for plat in "${!sgi_platforms[@]}" ;
do
printf "\t $plat \n"
done
echo "Example 1: ./sct.sh -p $1"
echo " Executes UEFI SCT tests for $1 platform."
echo
echo "Example 2: ./sct.sh -p $1 -j true"
echo " Executes UEFI SCT tests for $1 platform and terminates the fvp model"
echo " automatically when the test ends."
}
print_usage ()
{
echo ""
echo "Execute UEFI SCT tests on SGI platforms"
echo "Execute UEFI SCT tests"
echo "Usage: ./sct.sh -p <platform> [-n <true|false>] [-j <true|false>] [-a \"model params\"]"
echo " -p SGI platform name (mandatory)"
echo " -p Platform name (mandatory)"
echo " -n Enable network: true or false (default: false)"
echo " -j Automate sct test: true or false (default: false)"
echo " -a Additional model parameters, if any"
echo ""
__print_supported_sgi_platforms
echo "Example 1: ./sct.sh -p sgi575"
echo " Executes UEFI SCT tests for sgi575 platform."
echo
echo "Example 2: ./sct.sh -p sgi575 -j true"
echo " Executes UEFI SCT tests for sgi575 platform and terminates the fvp model"
echo " automatically when the test ends."
echo
__print_supported_platforms_$refinfra
__print_examples_$refinfra
echo ""
}
# get_sct_test_results: Extracts the UEFI SCT test results from SCT partition
......@@ -124,16 +121,7 @@ while getopts "p:n:a:j:h" opt; do
done
#Ensure that the platform is supported
if [ -z "$platform" ] ; then
print_usage
exit 1
fi
if [ -z "${sgi_platforms[$platform]}" ] ; then
echo "[ERROR] Could not deduce the selected platform."
__print_supported_sgi_platforms
exit 1
fi
__parse_params_validate
#Run the UEFI SCT tests
sct_image="../../../../output/$platform/uefisct/uefi-sct.img"
......
......@@ -33,41 +33,38 @@ platform_dir=""
source $PWD/../sgi/sgi_common_util.sh
declare -A sgi_platforms
sgi_platforms[sgi575]=1
sgi_platforms[rdn1edge]=1
sgi_platforms[rde1edge]=1
# List of all the supported platforms.
declare -A platforms_sgi
platforms_sgi[sgi575]=1
declare -A platforms_rdinfra
platforms_rdinfra[rdn1edge]=1
platforms_rdinfra[rde1edge]=1
__print_supported_sgi_platforms()
__print_examples()
{
echo "Supported platforms are -"
for plat in "${!sgi_platforms[@]}" ;
do
printf "\t $plat \n"
done
echo "Example 1: ./secure_boot.sh -p $1"
echo " Validates UEFI secure boot on $1 platform."
echo
echo "Example 2: ./secure_boot.sh -p $1 -j true"
echo " Validates UEFI secure boot on $1 platform and terminates the fvp model"
echo " automatically when the test ends."
}
print_usage ()
{
echo ""
echo "Validate secure boot on SGI platforms"
echo "Validate secure boot with busybox"
echo "Usage: ./secure_boot.sh -p <platform> [-n <true|false>] [-j <true|false>] [-a \"model params\"]"
echo ""
echo "Supported command line parameters - "
echo " -p SGI platform name (mandatory)"
echo " -p Platform name (mandatory)"
echo " -n Enable network: true or false (default: false)"
echo " -j Automate ras test: true or false (default: false)"
echo " -a Additional model parameters, if any"
echo ""
__print_supported_sgi_platforms
echo "Example 1: ./secure_boot.sh -p sgi575"
echo " Validates UEFI secure boot on sgi575 platform."
echo
echo "Example 2: ./secure_boot.sh -p sgi575 -j true"
echo " Validates UEFI secure boot on sgi575 platform and terminates the fvp model"
echo " automatically when the test ends."
echo
__print_supported_platforms_$refinfra
__print_examples_$refinfra
echo ""
}
while getopts "p:n:a:j:h" opt; do
......@@ -87,15 +84,7 @@ while getopts "p:n:a:j:h" opt; do
done
#Ensure that the platform is supported
if [ -z "$platform" ] ; then
print_usage
exit 1
fi
if [ -z "${sgi_platforms[$platform]}" ] ; then
echo "[ERROR] Could not deduce the selected platform."
__print_supported_sgi_platforms
exit 1
fi
__parse_params_validate
platform_dir="platforms/$platform"
pushd $platform_dir
......
......@@ -33,18 +33,21 @@ platform_dir=""
source $PWD/../sgi/sgi_common_util.sh
declare -A sgi_platforms
sgi_platforms[sgi575]=1
sgi_platforms[rdn1edge]=1
# List of all the supported platforms.
declare -A platforms_sgi
platforms_sgi[sgi575]=1
declare -A platforms_rdinfra
platforms_rdinfra[rdn1edge]=1
__print_supported_sgi_platforms()
__print_examples()
{
echo "Supported platforms are -"
for plat in "${!sgi_platforms[@]}" ;
do