diff options
Diffstat (limited to 'test/e2e')
-rwxr-xr-x | test/e2e/runtime-handler-shim-v2/install.sh | 21 | ||||
-rwxr-xr-x | test/e2e/runtime-handler-shim-v2/test.sh | 34 | ||||
-rwxr-xr-x | test/e2e/runtime-handler-shim-v2/validate.sh | 7 | ||||
-rwxr-xr-x | test/e2e/runtime-handler/usage.sh | 4 | ||||
-rwxr-xr-x | test/e2e/shim-install.sh | 16 |
5 files changed, 71 insertions, 11 deletions
diff --git a/test/e2e/runtime-handler-shim-v2/install.sh b/test/e2e/runtime-handler-shim-v2/install.sh new file mode 100755 index 000000000..af6b5be1e --- /dev/null +++ b/test/e2e/runtime-handler-shim-v2/install.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# A sample script for installing and configuring the gvisor-containerd-shim to +# use the containerd runtime handler. + +set -ex + +{ # Step 1: Create containerd config.toml +cat <<EOF | sudo tee /etc/containerd/config.toml +disabled_plugins = ["restart"] +[plugins.linux] + shim_debug = true +[plugins.cri.containerd.runtimes.runsc] + runtime_type = "io.containerd.runsc.v1" +EOF +} + +{ # Step 2: Restart containerd +sudo pkill containerd +sudo containerd -log-level debug &> /tmp/containerd-cri.log & +} diff --git a/test/e2e/runtime-handler-shim-v2/test.sh b/test/e2e/runtime-handler-shim-v2/test.sh new file mode 100755 index 000000000..e33655ec1 --- /dev/null +++ b/test/e2e/runtime-handler-shim-v2/test.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# Runs end-to-end tests for gvisor-containerd-shim to test the use of runtime +# handler. This should work on containerd 1.2+ + +# This is meant to be run in a VM as it makes a fairly invasive install of +# containerd. + +set -ex + +# Install containerd +. ./test/e2e/containerd-install.sh + +# Install gVisor +. ./test/e2e/runsc-install.sh + +# Install gvisor-containerd-shim +. ./test/e2e/shim-install.sh + +# Test installation/configuration +. ./test/e2e/runtime-handler-shim-v2/install.sh + +# Install crictl +. ./test/e2e/crictl-install.sh + +# Test usage (the same with runtime-handler) +. ./test/e2e/runtime-handler/usage.sh + +# Run a container in the sandbox +. ./test/e2e/run-container.sh + +# Validate the pod and container +. ./test/e2e/validate.sh +. ./test/e2e/runtime-handler-shim-v2/validate.sh diff --git a/test/e2e/runtime-handler-shim-v2/validate.sh b/test/e2e/runtime-handler-shim-v2/validate.sh new file mode 100755 index 000000000..b74a059ef --- /dev/null +++ b/test/e2e/runtime-handler-shim-v2/validate.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# A sample script to validating the running containerd-shim-runsc-v1. + +set -ex + +ps aux | grep [c]ontainerd-shim-runsc-v1 diff --git a/test/e2e/runtime-handler/usage.sh b/test/e2e/runtime-handler/usage.sh index 1f8a09757..350c720c2 100755 --- a/test/e2e/runtime-handler/usage.sh +++ b/test/e2e/runtime-handler/usage.sh @@ -1,7 +1,7 @@ #!/bin/bash -# A sample script for testing the gvisor-containerd-shim # using untrusted -# workload extension. +# A sample script for testing the gvisor-containerd-shim +# using runtime handler. set -ex diff --git a/test/e2e/shim-install.sh b/test/e2e/shim-install.sh index 93587ea50..c0252bdd4 100755 --- a/test/e2e/shim-install.sh +++ b/test/e2e/shim-install.sh @@ -5,23 +5,21 @@ set -ex # Build gvisor-containerd-shim -if [ "${INSTALL_LATEST}" === "1" ]; then -{ # Step 1: Download gvisor-containerd-shim +if [ "${INSTALL_LATEST}" == "1" ]; then +{ # Step 1(release): Install gvisor-containerd-shim LATEST_RELEASE=$(wget -qO - https://api.github.com/repos/google/gvisor-containerd-shim/releases | grep -oP '(?<="browser_download_url": ")https://[^"]*' | head -1) wget -O gvisor-containerd-shim chmod +x gvisor-containerd-shim +sudo mv gvisor-containerd-shim /usr/local/bin/gvisor-containerd-shim } else +{ # Step 1(dev): Build and install gvisor-containerd-shim and containerd-shim-runsc-v1 make - mv bin/gvisor-containerd-shim gvisor-containerd-shim-dev -fi - -{ # Step 2: Copy the binary to the desired directory -sudo mv gvisor-containerd-shim-* /usr/local/bin/gvisor-containerd-shim + sudo make install } +fi - -{ # Step 3: Create the gvisor-containerd-shim.yaml +{ # Step 2: Create the gvisor-containerd-shim.yaml cat <<EOF | sudo tee /etc/containerd/gvisor-containerd-shim.yaml # This is the path to the default runc containerd-shim. runc_shim = "/usr/local/bin/containerd-shim" |