Skip to content

Commit 2214a0f

Browse files
committed
Add critest as step to buildkite pipeline.
Add in step to buildkite pipeline for critest. Use fcnet configuration rather than the example CNI plugin configurations in tools/docker/critest This step will diff the current known status of failing tests with output in the pipeline such that we can maintain a state of known failures while not failing the pipeline on every new build. The version of ginkgo used by critest does not support output to a format file, so these changes include some scripting to capture output and compare. Current passing tests are related to image management. Current tests failing are due to network namespacing issues. Host and VM are not sharing the same network namespace. critest (crictl) creates CNI namespace to be used for pod sandbox. FC-CD will create this namespace as well as a network namespace for the VM itself, but critest cannot find the CNI namespace as it is contained within the VM's network namespace. Signed-off-by: Gavin Inglis <[email protected]>
1 parent d250127 commit 2214a0f

File tree

3 files changed

+106
-1
lines changed

3 files changed

+106
-1
lines changed

runtime/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ critest:
153153
--volume $(CURDIR)/../examples/etc/containerd/firecracker-runtime.json:/etc/containerd/firecracker-runtime.json \
154154
--volume $(CURDIR)/../tools/demo/fc-br0.interface:/etc/network/interfaces.d/fc-br0 \
155155
--volume $(CURDIR)/logs:/var/log/firecracker-containerd-test \
156+
--volume $(CURDIR)/../tools/critest:/src/runtime/critest \
156157
--volume $(GO_CACHE_VOLUME_NAME):/go \
157158
--env FICD_DM_VOLUME_GROUP=$(FICD_DM_VOLUME_GROUP) \
158159
--env FICD_DM_POOL=$(FICD_DM_POOL) \
@@ -161,7 +162,8 @@ critest:
161162
--env ACK_GINKGO_DEPRECATIONS=1.16.5 \
162163
--workdir="/src/runtime" \
163164
$(FIRECRACKER_CONTAINERD_TEST_IMAGE):$(DOCKER_IMAGE_TAG) \
164-
"make -C ../examples testtap && critest -runtime-endpoint unix:///run/firecracker-containerd/containerd.sock"
165+
"sleep 1 && critest -ginkgo.noColor -runtime-endpoint unix:///run/firecracker-containerd/containerd.sock | \
166+
./critest/critest_diff.sh"
165167

166168
clean:
167169
- rm -f containerd-shim-aws-firecracker

tools/critest/critest_diff.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#! /bin/bash
2+
#
3+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License"). You may
6+
# not use this file except in compliance with the License. A copy of the
7+
# License is located at
8+
#
9+
# http://aws.amazon.com/apache2.0/
10+
#
11+
# or in the "license" file accompanying this file. This file is distributed
12+
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13+
# express or implied. See the License for the specific language governing
14+
# permissions and limitations under the License.
15+
16+
17+
# Create temporary critest output file
18+
critest_output="$(</dev/stdin)"
19+
critest_output_file="$(mktemp)"
20+
echo "$critest_output" >> "$critest_output_file"
21+
22+
set -eu
23+
24+
# Remove up until report summary
25+
sed -i -E '0,/^Summarizing [0-9][0-9]? Failure[s]?:$/d' "$critest_output_file" # Remove empty lines
26+
sed -i '/^$/d' "$critest_output_file"
27+
28+
# Remove unnecessary error messages
29+
sed -i '/^\/.*[0-9]$/d' "$critest_output_file"
30+
sed -i '/^Ran [0-9][0-9] of [0-9][0-9] Specs in .*seconds$/d' "$critest_output_file"
31+
sed -i '/^--- FAIL: TestCRISuite.*$/d' "$critest_output_file"
32+
sed -i '/^FAIL.*$/d' "$critest_output_file"
33+
sed -i '/^Ran.*$/d' "$critest_output_file"
34+
35+
# Diff expected vs. actual
36+
diff -y <(sort critest/expected_critest_output.out) <(sort "$critest_output_file")
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[Fail] [k8s.io] Security Context SeccompProfilePath [It] runtime should support an seccomp profile that blocks setting hostname with SYS_ADMIN
2+
[Fail] [k8s.io] Security Context SeccompProfilePath [It] should support seccomp localhost/profile on the container
3+
[Fail] [k8s.io] Container runtime should support adding volume and device [BeforeEach] runtime should support starting container with volume [Conformance]
4+
[Fail] [k8s.io] Security Context bucket [It] runtime should support that ReadOnlyRootfs is false
5+
[Fail] [k8s.io] PodSandbox runtime should support basic operations on PodSandbox [It] runtime should support running PodSandbox [Conformance]
6+
[Fail] [k8s.io] Security Context NamespaceOption [It] runtime should support HostIpc is false
7+
[Fail] [k8s.io] Security Context NamespaceOption [It] runtime should support ContainerPID
8+
[Fail] [k8s.io] Security Context bucket [It] runtime should return error if RunAsGroup is set without RunAsUser
9+
[Fail] [k8s.io] Security Context NoNewPrivs [BeforeEach] should allow privilege escalation when false
10+
[Fail] [k8s.io] Networking runtime should support networking [It] runtime should support set hostname [Conformance]
11+
[Fail] [k8s.io] Security Context bucket [It] runtime should support dropping ALL capabilities
12+
[Fail] [k8s.io] Security Context bucket [It] runtime should support dropping capability
13+
[Fail] [k8s.io] Security Context SeccompProfilePath docker/default [It] runtime should support setting hostname with docker/default seccomp profile and SYS_ADMIN
14+
[Fail] [k8s.io] Security Context bucket [It] runtime should support ReadonlyPaths
15+
[Fail] [k8s.io] Security Context bucket [It] runtime should support MaskedPaths
16+
[Fail] [k8s.io] PodSandbox runtime should support basic operations on PodSandbox [It] runtime should support removing PodSandbox [Conformance]
17+
[Fail] [k8s.io] Container Mount Propagation runtime should support mount propagation [BeforeEach] mount with 'rshared' should support propagation from host to container and vice versa
18+
[Fail] [k8s.io] Security Context bucket [It] runtime should support that ReadOnlyRootfs is true
19+
[Fail] [k8s.io] Security Context NamespaceOption [It] runtime should support HostPID
20+
[Fail] [k8s.io] Security Context bucket [It] runtime should support RunAsUserName
21+
[Fail] [k8s.io] Container runtime should support log [BeforeEach] runtime should support starting container with log [Conformance]
22+
[Fail] [k8s.io] Container Mount Propagation runtime should support mount propagation [BeforeEach] mount with 'rslave' should support propagation from host to container
23+
[Fail] [k8s.io] Security Context bucket [It] runtime should support SupplementalGroups
24+
[Fail] [k8s.io] Security Context bucket [It] runtime should support Privileged is true
25+
[Fail] [k8s.io] Security Context NamespaceOption [It] runtime should support HostNetwork is true
26+
[Fail] [k8s.io] Security Context SeccompProfilePath [It] runtime should not support a custom seccomp profile without using localhost/ as a prefix
27+
[Fail] [k8s.io] Security Context SeccompProfilePath [It] runtime should ignore a seccomp profile that blocks setting hostname when privileged
28+
[Fail] [k8s.io] Streaming runtime should support streaming interfaces [It] runtime should support exec with tty=false and stdin=false [Conformance]
29+
[Fail] [k8s.io] Multiple Containers [Conformance] when running multiple containers in a pod [BeforeEach] should support network
30+
[Fail] [k8s.io] Container runtime should support basic operations on container [BeforeEach] runtime should support stopping container [Conformance]
31+
[Fail] [k8s.io] Multiple Containers [Conformance] when running multiple containers in a pod [BeforeEach] should support container exec
32+
[Fail] [k8s.io] Security Context NoNewPrivs [BeforeEach] should not allow privilege escalation when true
33+
[Fail] [k8s.io] Container runtime should support basic operations on container [BeforeEach] runtime should support execSync [Conformance]
34+
[Fail] [k8s.io] Container runtime should support basic operations on container [BeforeEach] runtime should support execSync with timeout [Conformance]
35+
[Fail] [k8s.io] Streaming runtime should support streaming interfaces [It] runtime should support attach [Conformance]
36+
[Fail] [k8s.io] Container runtime should support basic operations on container [BeforeEach] runtime should support starting container [Conformance]
37+
[Fail] [k8s.io] Security Context SeccompProfilePath [It] runtime should not block setting host name with unconfined seccomp and SYS_ADMIN
38+
[Fail] [k8s.io] PodSandbox runtime should support sysctls [It] should support unsafe sysctls
39+
[Fail] [k8s.io] PodSandbox runtime should support basic operations on PodSandbox [It] runtime should support stopping PodSandbox [Conformance]
40+
[Fail] [k8s.io] Streaming runtime should support streaming interfaces [It] runtime should support exec with tty=true and stdin=true [Conformance]
41+
[Fail] [k8s.io] Security Context SeccompProfilePath docker/default [It] runtime should block sethostname with docker/default seccomp profile and no extra caps
42+
[Fail] [k8s.io] Security Context SeccompProfilePath docker/default [It] should support seccomp docker/default on the container
43+
[Fail] [k8s.io] Networking runtime should support networking [It] runtime should support DNS config [Conformance]
44+
[Fail] [k8s.io] Security Context bucket [It] runtime should support RunAsUser
45+
[Fail] [k8s.io] Container runtime should support log [BeforeEach] runtime should support reopening container log [Conformance]
46+
[Fail] [k8s.io] Container runtime should support adding volume and device [BeforeEach] runtime should support starting container with volume when host path is a symlink [Conformance]
47+
[Fail] [k8s.io] Security Context bucket [It] runtime should support adding capability
48+
[Fail] [k8s.io] Multiple Containers [Conformance] when running multiple containers in a pod [BeforeEach] should support container log
49+
[Fail] [k8s.io] Streaming runtime should support streaming interfaces [It] runtime should support portforward [Conformance]
50+
[Fail] [k8s.io] Container Mount Propagation runtime should support mount propagation [BeforeEach] mount with 'rprivate' should not support propagation
51+
[Fail] [k8s.io] Container runtime should support basic operations on container [BeforeEach] runtime should support creating container [Conformance]
52+
[Fail] [k8s.io] Container runtime should support basic operations on container [BeforeEach] runtime should support removing running container [Conformance]
53+
[Fail] [k8s.io] Security Context NamespaceOption [It] runtime should support PodPID
54+
[Fail] [k8s.io] Container runtime should support basic operations on container [BeforeEach] runtime should support listing container stats [Conformance]
55+
[Fail] [k8s.io] Networking runtime should support networking [It] runtime should support port mapping with host port and container port [Conformance]
56+
[Fail] [k8s.io] Security Context bucket [It] runtime should support RunAsGroup
57+
[Fail] [k8s.io] Security Context SeccompProfilePath [It] should support seccomp unconfined on the container
58+
[Fail] [k8s.io] PodSandbox runtime should support sysctls [It] should support safe sysctls
59+
[Fail] [k8s.io] Security Context bucket [It] runtime should support adding ALL capabilities
60+
[Fail] [k8s.io] Security Context SeccompProfilePath [It] should support seccomp default which is unconfined on the container
61+
[Fail] [k8s.io] Container runtime should support basic operations on container [BeforeEach] runtime should support removing stopped container [Conformance]
62+
[Fail] [k8s.io] Security Context bucket [It] runtime should support Privileged is false
63+
[Fail] [k8s.io] Security Context NamespaceOption [It] runtime should support HostIpc is true
64+
[Fail] [k8s.io] Security Context NamespaceOption [It] runtime should support HostNetwork is false
65+
[Fail] [k8s.io] Streaming runtime should support streaming interfaces [It] runtime should support portforward in host network
66+
[Fail] [k8s.io] Networking runtime should support networking [It] runtime should support port mapping with only container port [Conformance]
67+
[Fail] [k8s.io] Container runtime should support basic operations on container [BeforeEach] runtime should support removing created container [Conformance]

0 commit comments

Comments
 (0)