Support --perf-test, --shell in test-deb, test-rpm

This commit is contained in:
Dmitry Maksyoma 2023-01-25 17:51:58 +13:00
parent 55c8c1e80e
commit 8d49eed7f0
4 changed files with 60 additions and 2 deletions

View File

@ -1,3 +1,5 @@
#!/bin/bash
default_os=${default_os:-ubuntu}
default_os_codename=${default_os_codename:-bionic}

View File

@ -0,0 +1,49 @@
#!/bin/bash
usage() {
echo >&2 "Usage: $(basename "$0") [-s|--shell] [-p|--perf-test] [-h|--help] <distro> <distro_version>"
exit
}
process_options() {
local sorted_options=$(getopt -o psh --long perf-test --long shell --long help -- "$@")
eval set -- $sorted_options
while : ; do
case "$1" in
-p|--perf-test)
entrypoint_args='-interface 0.0.0.0 -selfBench :1'
entrypoint_executable="--entrypoint=/usr/bin/Xvnc"
shift
;;
-s|--shell)
entrypoint_executable="--entrypoint=bash"
shift
;;
-h|--help)
print_usage=1
;;
--)
shift
break
;;
esac
done
leftover_options=("$@")
}
declare -a leftover_options
if [ "$#" -eq 0 ]; then
usage
exit
fi
process_options "$@"
set -- "${leftover_options[@]}"
if [ -n "$print_usage" ]; then
usage
exit
fi

View File

@ -3,6 +3,7 @@
set -e
cd "$(dirname "$0")/.."
. ./builder/process_test_options.sh
. ./builder/os_ver_cli.sh
. ./builder/common.sh
@ -11,8 +12,11 @@ docker build --build-arg KASMVNC_PACKAGE_DIR="builder/build/${os_codename}" \
--build-arg BUILD_DEBIAN_REVISION="$build_debian_revision" \
-t "$tester_image" \
-f "builder/dockerfile.${os}_${os_codename}${build_tag}.deb.test" .
docker run -it -p "443:$VNC_PORT" --rm \
-e KASMVNC_VERBOSE_LOGGING=$KASMVNC_VERBOSE_LOGGING \
-e "VNC_USER=foo" -e "VNC_PW=foobar" \
-e "VNC_PORT=$VNC_PORT" \
"$tester_image"
$entrypoint_executable \
"$tester_image" \
$entrypoint_args

View File

@ -3,6 +3,7 @@
set -e
cd "$(dirname "$0")/.."
. ./builder/process_test_options.sh
. ./builder/os_ver_cli.sh
. ./builder/common.sh
@ -16,4 +17,6 @@ docker run -it -p "443:$VNC_PORT" --rm \
-e KASMVNC_VERBOSE_LOGGING=$KASMVNC_VERBOSE_LOGGING \
-e "VNC_USER=foo" -e "VNC_PW=foobar" \
-e "VNC_PORT=$VNC_PORT" \
kasmvnctester_${os}:$os_codename
$entrypoint_executable \
kasmvnctester_${os}:$os_codename \
$entrypoint_args