From fff21b99e45136510a0148eada57ff28966dc27e Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Tue, 14 May 2019 16:00:53 -0700 Subject: [PATCH] kokoro: run tests with a default docker container runtime We want to know that our environment set up properly and docker tests pass with a native runtime. PiperOrigin-RevId: 248229294 Change-Id: I06c221e5eeed6e01bdd1aa935333c57e8eadc498 --- kokoro/run_tests.sh | 11 +++++++++++ runsc/test/testutil/docker.go | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/kokoro/run_tests.sh b/kokoro/run_tests.sh index aa88b5cbf..9d630362e 100755 --- a/kokoro/run_tests.sh +++ b/kokoro/run_tests.sh @@ -142,10 +142,21 @@ EOF run_docker_tests() { cd ${WORKSPACE_DIR} + # Run tests with a default runtime (runc). + bazel test \ + "${BAZEL_BUILD_FLAGS[@]}" \ + --test_env=RUNSC_RUNTIME="" \ + --test_output=all \ + //runsc/test/image:image_test + # 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 + # FIXME(b/132073574): we need to flush arp tables, otherwise tests fail with + # timeout. + sudo ip neigh show + sudo ip neigh flush dev docker0 # Run runsc tests with docker that are tagged manual. bazel test \ "${BAZEL_BUILD_FLAGS[@]}" \ diff --git a/runsc/test/testutil/docker.go b/runsc/test/testutil/docker.go index e103e930c..81f5a9ef0 100644 --- a/runsc/test/testutil/docker.go +++ b/runsc/test/testutil/docker.go @@ -31,8 +31,8 @@ import ( ) func getRuntime() string { - r := os.Getenv("RUNSC_RUNTIME") - if r == "" { + r, ok := os.LookupEnv("RUNSC_RUNTIME") + if !ok { return "runsc-test" } return r