github.com/dmaizel/tests@v0.0.0-20210728163746-cae6a2d9cee8/integration/sandbox_cgroup/sandbox_cgroup_test.sh (about) 1 #!/bin/bash 2 # 3 # Copyright (c) 2020-2021 Intel Corporation 4 # 5 # SPDX-License-Identifier: Apache-2.0 6 # 7 # This will enable the sandbox_cgroup_only 8 # to true in order to test that ctr is 9 # working properly when this feature is 10 # enabled 11 12 set -o errexit 13 set -o nounset 14 set -o pipefail 15 set -o errtrace 16 17 dir_path=$(dirname "$0") 18 source "${dir_path}/../../lib/common.bash" 19 source "${dir_path}/../../.ci/lib.sh" 20 tests_repo="${tests_repo:-github.com/kata-containers/tests}" 21 TEST_SANDBOX_CGROUP_ONLY="${TEST_SANDBOX_CGROUP_ONLY:-}" 22 23 if [ -z "${TEST_SANDBOX_CGROUP_ONLY}" ]; then 24 info "Skip: TEST_SANDBOX_CGROUP_ONLY variable is not set" 25 exit 0 26 fi 27 28 function setup() { 29 sudo systemctl restart containerd 30 clean_env_ctr 31 CONTAINERD_RUNTIME="io.containerd.kata.v2" 32 check_processes 33 } 34 35 function test_stability() { 36 pushd "${GOPATH}/src/${tests_repo}" 37 ".ci/set_kata_config.sh" sandbox_cgroup_only true 38 sudo -E PATH="$PATH" bash -c "make stability" 39 ".ci/set_kata_config.sh" sandbox_cgroup_only false 40 popd 41 } 42 43 function teardown() { 44 clean_env_ctr 45 check_processes 46 } 47 48 trap teardown EXIT 49 50 echo "Running setup" 51 setup 52 53 echo "Running stability integration tests with sandbox cgroup enabled" 54 test_stability