tests,ci: Move "test-basic" (bare mode) to installed test
Our CI uses default Docker, which has SELinux labeling but is rather evil in returning `EOPNOTSUPP` to any attempts to set `security.selinux`, even if to the same value. The previous fire 🔥 for this was: https://github.com/ostreedev/ostree/pull/759 The `bare` repo mode really only makes sense as uid 0, so our installed test framework is a good match for this. However, the unit tests *do* work in a privileged container even as non-root, and *also* should work on SELinux-disabled systems. So let's teach the test framework how to skip in those situations. I tested this both in a priv container (my default builder) and an unpriv container (like our CI). At the same time, start executing the `test-basic.sh` from an installed test, so we get better coverage than before. This is just the start - all of the sysroot tests really need the same treatment. Closes: #1217 Approved by: jlebon
This commit is contained in:
1 parent
25a7c4bd4e
commit
5963d5a2a9
7 files changed
+60
-8
No files matched your search
@@ -6,3 +6,5 @@ if lvm lvs atomicos/docker-pool &>/dev/null; then
|
||||
lvm lvremove -f atomicos/docker-pool
|
||||
fi
|
||||
lvm lvextend -r -l +100%FREE atomicos/root
|
||||
ostree admin unlock
|
||||
rsync -rlv ./ostree/insttree/usr/ /usr/
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Run test-basic.sh as root.
|
||||
# https://github.com/ostreedev/ostree/pull/1199
|
||||
|
||||
set -xeuo pipefail
|
||||
|
||||
dn=$(dirname $0)
|
||||
. ${dn}/libinsttest.sh
|
||||
|
||||
# Use /var/tmp to hopefully use XFS + O_TMPFILE etc.
|
||||
tempdir=$(mktemp -d /var/tmp/tap-test.XXXXXX)
|
||||
touch ${tempdir}/.testtmp
|
||||
function cleanup () {
|
||||
if test -f ${tempdir}/.testtmp; then
|
||||
rm "${tempdir}" -rf
|
||||
fi
|
||||
}
|
||||
trap cleanup EXIT
|
||||
cd ${tempdir}
|
||||
# This sort of bypasses the installed-tests spec;
|
||||
# fixing that would require installing g-d-t-r, though
|
||||
# more ideally we architect things with a "control" container
|
||||
# distinct from the host.
|
||||
/usr/libexec/installed-tests/libostree/test-basic.sh
|
||||
Reference in new issue
Block a user