Skip to content

Commit beeded7

Browse files
committed
testing: Add IGNORE_UNPRIV_USERNS_TESTS to skip tests that use userns
Signed-off-by: Alexey Gladkov <[email protected]>
1 parent 124a819 commit beeded7

File tree

3 files changed

+16
-1
lines changed
  • features
    • overlayfs/tests/ts0001-guess-overlayfs
    • rootfs/tests/ts0001-guess-rootfs
  • testing/tests

3 files changed

+16
-1
lines changed

features/overlayfs/tests/ts0001-guess-overlayfs/run

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash -eu
22

3+
[ -z "${IGNORE_UNPRIV_USERNS_TESTS-}" ] ||
4+
exit 127
5+
36
cwd="${0%/*}"
47

58
export GUESS_SUFFIX=add:guess-root

features/rootfs/tests/ts0001-guess-rootfs/run

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash -eu
22

3+
[ -z "${IGNORE_UNPRIV_USERNS_TESTS-}" ] ||
4+
exit 127
5+
36
cwd="${0%/*}"
47

58
export GUESS_SUFFIX=add:guess-root

testing/tests/run

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ for testsuite in "$@"; do
2929
num="$(printf '%4s' "$i")"
3030
i=$(( $i + 1 ))
3131

32-
echo "[$num/$max] ${ts##*/}"
32+
echo -n "[$num/$max] ${ts##*/} "
3333
fi
3434

3535
{
@@ -38,6 +38,15 @@ for testsuite in "$@"; do
3838
echo "rc=$rc";
3939
} > "$ts"/output 2>&1
4040

41+
if [ "$rc" = 127 ]; then
42+
[ -z "${VERBOSE:-${V:-}}" ] ||
43+
echo "[skipped]"
44+
rm -f -- "$ts"/output
45+
continue
46+
fi
47+
[ -z "${VERBOSE:-${V:-}}" ] ||
48+
echo
49+
4150
[ ! -f "$ts"/expect.in ] ||
4251
sed \
4352
-e "s#@ts@#${ts##*/}#g" \

0 commit comments

Comments
 (0)