summaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run_tests.sh')
-rwxr-xr-xtools/run_tests.sh45
1 files changed, 32 insertions, 13 deletions
diff --git a/tools/run_tests.sh b/tools/run_tests.sh
index b35d2e4b8..483b9cb50 100755
--- a/tools/run_tests.sh
+++ b/tools/run_tests.sh
@@ -45,7 +45,8 @@ readonly TEST_PACKAGES=("//pkg/..." "//runsc/..." "//tools/...")
#######################
# Install the latest version of Bazel and log the version.
-(which use_bazel.sh && use_bazel.sh latest) || which bazel
+# FIXME(b/137285694): Unable to build runsc with bazel 0.28.0.
+(which use_bazel.sh && use_bazel.sh 0.27.1) || which bazel
bazel version
# Load the kvm module.
@@ -92,6 +93,14 @@ build_everything() {
"${BUILD_PACKAGES[@]}"
}
+build_runsc_debian() {
+ cd ${WORKSPACE_DIR}
+
+ # TODO(b/135475885): pkg_deb is incompatible with Python3.
+ # https://github.com/bazelbuild/bazel/issues/8443
+ bazel build --host_force_python=py2 runsc:runsc-debian
+}
+
# Run simple tests runs the tests that require no special setup or
# configuration.
run_simple_tests() {
@@ -173,16 +182,24 @@ run_docker_tests() {
# These names are used to exclude tests not supported in certain
# configuration, e.g. save/restore not supported with hostnet.
- declare -a variations=("" "-kvm" "-hostnet" "-overlay")
- for v in "${variations[@]}"; do
- # Run runsc tests with docker that are tagged manual.
- bazel test \
- "${BAZEL_BUILD_FLAGS[@]}" \
- --test_env=RUNSC_RUNTIME="${RUNTIME}${v}" \
- --test_output=all \
- //runsc/test/image:image_test \
- //runsc/test/integration:integration_test
- done
+ # Run runsc tests with docker that are tagged manual.
+ #
+ # The --nocache_test_results option is used here to eliminate cached results
+ # from the previous run for the runc runtime.
+ bazel test \
+ "${BAZEL_BUILD_FLAGS[@]}" \
+ --test_env=RUNSC_RUNTIME="${RUNTIME}" \
+ --test_output=all \
+ --nocache_test_results \
+ --test_output=streamed \
+ //runsc/test/integration:integration_test \
+ //runsc/test/integration:integration_test_hostnet \
+ //runsc/test/integration:integration_test_overlay \
+ //runsc/test/integration:integration_test_kvm \
+ //runsc/test/image:image_test \
+ //runsc/test/image:image_test_overlay \
+ //runsc/test/image:image_test_hostnet \
+ //runsc/test/image:image_test_kvm
}
# Run the tests that require root.
@@ -208,8 +225,8 @@ run_runsc_do_tests() {
local runsc=$(find bazel-bin/runsc -type f -executable -name "runsc" | head -n1)
# run runsc do without root privileges.
- unshare -Ur ${runsc} --network=none --TESTONLY-unsafe-nonroot do true
- unshare -Ur ${runsc} --TESTONLY-unsafe-nonroot --network=host do --netns=false true
+ ${runsc} --rootless do true
+ ${runsc} --rootless --network=none do true
# run runsc do with root privileges.
sudo -n -E ${runsc} do true
@@ -273,6 +290,8 @@ main() {
run_syscall_tests
run_runsc_do_tests
+ build_runsc_debian
+
# Build other flavors too.
build_everything dbg