@@ -28,6 +28,11 @@ for pkg in container-selinux crun golang podman podman-tests selinux-policy; do
28
28
fi
29
29
done
30
30
31
+ fetch_selinux_denials () {
32
+ echo " Fetching AVC denials..."
33
+ ausearch -m AVC,USER_AVC,SELINUX_ERR,USER_SELINUX_ERR -ts recent
34
+ }
35
+
31
36
if [[ " $TEST_TYPE " == " e2e" ]]; then
32
37
# /tmp is often unsufficient
33
38
export TMPDIR=/var/tmp
@@ -60,19 +65,21 @@ if [[ "$TEST_TYPE" == "e2e" ]]; then
60
65
61
66
# Run podman e2e tests
62
67
pushd " $PODMAN_DIR " /podman-* /test/e2e
63
- go test -v config.go config_test.go config_" $ARCH " .go common_test.go libpod_suite_test.go run_selinux_test.go
64
- go test -v config.go config_test.go config_" $ARCH " .go common_test.go libpod_suite_test.go checkpoint_test.go
68
+ if ! go test -v config.go config_test.go config_" $ARCH " .go common_test.go libpod_suite_test.go run_selinux_test.go; then
69
+ fetch_selinux_denials
70
+ fi
71
+ if ! go test -v config.go config_test.go config_" $ARCH " .go common_test.go libpod_suite_test.go checkpoint_test.go; then
72
+ fetch_selinux_denials
73
+ fi
65
74
popd
66
75
fi
67
76
68
77
if [[ " $TEST_TYPE " == " system" ]]; then
69
78
# Run podman system tests
70
- bats /usr/share/podman/test/system/410-selinux.bats
71
- bats /usr/share/podman/test/system/520-checkpoint.bats
72
- fi
73
-
74
- # shellcheck disable=SC2181
75
- if [[ $? -ne 0 ]]; then
76
- echo " Fetching AVC denials..."
77
- ausearch -m AVC,USER_AVC,SELINUX_ERR,USER_SELINUX_ERR -ts recent
79
+ if ! bats /usr/share/podman/test/system/410-selinux.bats; then
80
+ fetch_selinux_denials
81
+ fi
82
+ if ! bats /usr/share/podman/test/system/520-checkpoint.bats; then
83
+ fetch_selinux_denials
84
+ fi
78
85
fi
0 commit comments