fmf: Plumb through $TEST_* variables for unexpected messages
This will allow us to control the value from test plans, in particular for disabling at least some unexpected message checks for reverse dependency testing. We don't want to disable unexpected messages in general for fmf, as we are looking for exactly these in e.g. selinux-policy reverse dependency tests. Move from `su` to `runtest`, as with the former it's impossible to plumb through variables with non-trivial characters, as they cannot be quoted. Taken fromc38692fa4c(cherry picked from commit9544f57220)
This commit is contained in:
parent
d9b8fb2b13
commit
9d5445a99e
4 changed files with 19 additions and 9 deletions
4
Makefile
4
Makefile
|
|
@ -174,10 +174,10 @@ print-vm:
|
||||||
# without actually running them
|
# without actually running them
|
||||||
prepare-check: $(NODE_MODULES_TEST) $(VM_IMAGE) test/common
|
prepare-check: $(NODE_MODULES_TEST) $(VM_IMAGE) test/common
|
||||||
|
|
||||||
# run the browser integration tests; skip check for SELinux denials
|
# run the browser integration tests
|
||||||
# this will run all tests/check-* and format them as TAP
|
# this will run all tests/check-* and format them as TAP
|
||||||
check: prepare-check
|
check: prepare-check
|
||||||
TEST_AUDIT_NO_SELINUX=1 test/common/run-tests ${RUN_TESTS_OPTIONS}
|
test/common/run-tests ${RUN_TESTS_OPTIONS}
|
||||||
|
|
||||||
# checkout Cockpit's bots for standard test VM images and API to launch them
|
# checkout Cockpit's bots for standard test VM images and API to launch them
|
||||||
bots: $(COCKPIT_REPO_STAMP)
|
bots: $(COCKPIT_REPO_STAMP)
|
||||||
|
|
|
||||||
|
|
@ -4,3 +4,7 @@ discover:
|
||||||
how: fmf
|
how: fmf
|
||||||
execute:
|
execute:
|
||||||
how: tmt
|
how: tmt
|
||||||
|
|
||||||
|
# Let's handle them upstream only, don't break Fedora/RHEL reverse dependency gating
|
||||||
|
environment:
|
||||||
|
TEST_AUDIT_NO_SELINUX: 1
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
TESTS="$(realpath $(dirname "$0"))"
|
export TEST_BROWSER=${TEST_BROWSER:-firefox}
|
||||||
SOURCE="$(realpath $TESTS/../..)"
|
export TESTS="$(realpath $(dirname "$0"))"
|
||||||
# https://tmt.readthedocs.io/en/stable/overview.html#variables
|
export SOURCE="$(realpath $TESTS/../..)"
|
||||||
LOGS="${TMT_TEST_DATA:-$(pwd)/logs}"
|
export FILES="$(realpath $TESTS/../files)"
|
||||||
FILES="$(realpath $TESTS/../files)"
|
export LOGS="$(pwd)/logs"
|
||||||
|
|
||||||
mkdir -p "$LOGS"
|
mkdir -p "$LOGS"
|
||||||
chmod a+w "$LOGS"
|
chmod a+w "$LOGS"
|
||||||
|
|
||||||
|
|
@ -57,7 +58,9 @@ cp $FILES/binary-rec.journal /var/log/journal/binary-rec.journal
|
||||||
systemctl enable --now cockpit.socket
|
systemctl enable --now cockpit.socket
|
||||||
|
|
||||||
# Run tests as unprivileged user
|
# Run tests as unprivileged user
|
||||||
su - -c "env TEST_BROWSER=firefox SOURCE=$SOURCE LOGS=$LOGS $TESTS/run-test.sh" runtest
|
# once we drop support for RHEL 8, use this:
|
||||||
|
# runuser -u runtest --whitelist-environment=TEST_BROWSER,TEST_ALLOW_JOURNAL_MESSAGES,TEST_AUDIT_NO_SELINUX,SOURCE,LOGS $TESTS/run-test.sh
|
||||||
|
runuser -u runtest --preserve-environment env USER=runtest HOME=$(getent passwd runtest | cut -f6 -d:) $TESTS/run-test.sh
|
||||||
|
|
||||||
RC=$(cat $LOGS/exitcode)
|
RC=$(cat $LOGS/exitcode)
|
||||||
exit ${RC:-1}
|
exit ${RC:-1}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ mv .git dot-git
|
||||||
|
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
export TEST_OS="${ID}-${VERSION_ID/./-}"
|
export TEST_OS="${ID}-${VERSION_ID/./-}"
|
||||||
export TEST_AUDIT_NO_SELINUX=1
|
|
||||||
|
|
||||||
if [ "${TEST_OS#centos-}" != "$TEST_OS" ]; then
|
if [ "${TEST_OS#centos-}" != "$TEST_OS" ]; then
|
||||||
TEST_OS="${TEST_OS}-stream"
|
TEST_OS="${TEST_OS}-stream"
|
||||||
|
|
@ -30,6 +29,10 @@ fi
|
||||||
|
|
||||||
EXCLUDES=""
|
EXCLUDES=""
|
||||||
|
|
||||||
|
# make it easy to check in logs
|
||||||
|
echo "TEST_ALLOW_JOURNAL_MESSAGES: ${TEST_ALLOW_JOURNAL_MESSAGES:-}"
|
||||||
|
echo "TEST_AUDIT_NO_SELINUX: ${TEST_AUDIT_NO_SELINUX:-}"
|
||||||
|
|
||||||
RC=0
|
RC=0
|
||||||
test/common/run-tests --nondestructive --machine 127.0.0.1:22 --browser 127.0.0.1:9090 $EXCLUDES || RC=$?
|
test/common/run-tests --nondestructive --machine 127.0.0.1:22 --browser 127.0.0.1:9090 $EXCLUDES || RC=$?
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue