From 934f992536b644533ab6c5f1e57511461b635237 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Wed, 7 Oct 2020 15:34:18 +0100 Subject: [PATCH] scripts: dev_cli: Add support for Windows guest integration tests Now that we've written Windows integration tests and the associated script to launch them, this patch enables the support for Windows tests in dev_cli.sh, so that we can run it in our Cloud Hypervisor container. Signed-off-by: Rob Bradford --- scripts/dev_cli.sh | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/scripts/dev_cli.sh b/scripts/dev_cli.sh index 310826858..4c11bc038 100755 --- a/scripts/dev_cli.sh +++ b/scripts/dev_cli.sh @@ -158,12 +158,13 @@ cmd_help() { echo "" echo " tests [--unit|--cargo|--all] [--libc musl|gnu] [-- []]" echo " Run the Cloud Hypervisor tests." - echo " --unit Run the unit tests." - echo " --cargo Run the cargo tests." - echo " --integration Run the integration tests." - echo " --integration-sgx Run the SGX integration tests." - echo " --libc Select the C library Cloud Hypervisor will be built against. Default is gnu" - echo " --all Run all tests." + echo " --unit Run the unit tests." + echo " --cargo Run the cargo tests." + echo " --integration Run the integration tests." + echo " --integration-sgx Run the SGX integration tests." + echo " --integration-windows Run the Windows guest integration tests." + echo " --libc Select the C library Cloud Hypervisor will be built against. Default is gnu" + echo " --all Run all tests." echo "" echo " build-container [--type]" echo " Build the Cloud Hypervisor container." @@ -248,6 +249,7 @@ cmd_tests() { cargo=false integration=false integration_sgx=false + integration_windows=false libc="gnu" while [ $# -gt 0 ]; do @@ -257,6 +259,7 @@ cmd_tests() { "--cargo") { cargo=true; } ;; "--integration") { integration=true; } ;; "--integration-sgx") { integration_sgx=true; } ;; + "--integration-windows") { integration_windows=true; } ;; "--libc") shift [[ "$1" =~ ^(musl|gnu)$ ]] || \ @@ -344,6 +347,24 @@ cmd_tests() { ./scripts/run_integration_tests_sgx.sh "$@" || fix_dir_perms $? || exit $? fi + if [ "$integration_windows" = true ] ; then + say "Running integration tests for $target..." + $DOCKER_RUNTIME run \ + --workdir "$CTR_CLH_ROOT_DIR" \ + --rm \ + --privileged \ + --security-opt seccomp=unconfined \ + --ipc=host \ + --net="$CTR_CLH_NET" \ + --mount type=tmpfs,destination=/tmp \ + --volume /dev:/dev \ + --volume "$CLH_ROOT_DIR:$CTR_CLH_ROOT_DIR" \ + --volume "$CLH_INTEGRATION_WORKLOADS:$CTR_CLH_INTEGRATION_WORKLOADS" \ + --env USER="root" \ + --env CH_LIBC="${libc}" \ + "$CTR_IMAGE" \ + ./scripts/run_integration_tests_windows.sh "$@" || fix_dir_perms $? || exit $? + fi fix_dir_perms $? }