Compare commits
No commits in common. "8cf85bb5750766cf0cff53b0b73be5a5a39279f5" and "92cad3f82dd314cd4d84a85448c499b9e71a7ae8" have entirely different histories.
8cf85bb575
...
92cad3f82d
|
@ -13,12 +13,13 @@ check_result_qemu() {
|
||||||
[[ -f $initdir/failed ]] && cp -a $initdir/failed $TESTDIR
|
[[ -f $initdir/failed ]] && cp -a $initdir/failed $TESTDIR
|
||||||
cryptsetup luksOpen ${LOOPDEV}p2 varcrypt <$TESTDIR/keyfile
|
cryptsetup luksOpen ${LOOPDEV}p2 varcrypt <$TESTDIR/keyfile
|
||||||
mount /dev/mapper/varcrypt $initdir/var
|
mount /dev/mapper/varcrypt $initdir/var
|
||||||
save_journal $initdir/var/log/journal
|
cp -a $initdir/var/log/journal $TESTDIR
|
||||||
|
rm -r $initdir/var/log/journal/*
|
||||||
_umount_dir $initdir/var
|
_umount_dir $initdir/var
|
||||||
_umount_dir $initdir
|
_umount_dir $initdir
|
||||||
cryptsetup luksClose /dev/mapper/varcrypt
|
cryptsetup luksClose /dev/mapper/varcrypt
|
||||||
[[ -f $TESTDIR/failed ]] && cat $TESTDIR/failed
|
[[ -f $TESTDIR/failed ]] && cat $TESTDIR/failed
|
||||||
echo $JOURNAL_LIST
|
ls -l $TESTDIR/journal/*/*.journal
|
||||||
test -s $TESTDIR/failed && ret=$(($ret+1))
|
test -s $TESTDIR/failed && ret=$(($ret+1))
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,9 +46,7 @@ test_create_image() {
|
||||||
cp systemd_test.if $initdir/systemd-test-module
|
cp systemd_test.if $initdir/systemd-test-module
|
||||||
dracut_install -o sesearch
|
dracut_install -o sesearch
|
||||||
dracut_install runcon
|
dracut_install runcon
|
||||||
dracut_install checkmodule semodule semodule_package m4 make load_policy sefcontext_compile
|
dracut_install checkmodule semodule semodule_package m4 make /usr/libexec/selinux/hll/pp load_policy sefcontext_compile
|
||||||
dracut_install -o /usr/libexec/selinux/hll/pp # Fedora/RHEL/...
|
|
||||||
dracut_install -o /usr/lib/selinux/hll/pp # Debian/Ubuntu/...
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@ test_create_image() {
|
||||||
setup_basic_environment
|
setup_basic_environment
|
||||||
mask_supporting_services
|
mask_supporting_services
|
||||||
|
|
||||||
../create-busybox-container $initdir/testsuite-13.nc-container
|
../create-busybox-container $initdir/nc-container
|
||||||
initdir="$initdir/testsuite-13.nc-container" dracut_install nc ip
|
initdir="$initdir/nc-container" dracut_install nc ip
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@ check_result_nspawn() {
|
||||||
cat $1/testok
|
cat $1/testok
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
save_journal $1/var/log/journal
|
cp -a $1/var/log/journal $TESTDIR
|
||||||
|
rm -r $1/var/log/journal/*
|
||||||
_umount_dir $initdir
|
_umount_dir $initdir
|
||||||
[[ -n "$TIMED_OUT" ]] && _ret=$(($_ret+1))
|
[[ -n "$TIMED_OUT" ]] && _ret=$(($_ret+1))
|
||||||
return $_ret
|
return $_ret
|
||||||
|
@ -54,7 +55,8 @@ check_result_qemu() {
|
||||||
cat $initdir/testok
|
cat $initdir/testok
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
save_journal $initdir/var/log/journal
|
cp -a $initdir/var/log/journal $TESTDIR
|
||||||
|
rm -r $initdir/var/log/journal/*
|
||||||
_umount_dir $initdir
|
_umount_dir $initdir
|
||||||
[[ -n "$TIMED_OUT" ]] && _ret=$(($_ret+1))
|
[[ -n "$TIMED_OUT" ]] && _ret=$(($_ret+1))
|
||||||
return $_ret
|
return $_ret
|
||||||
|
|
|
@ -4,61 +4,44 @@ set -e
|
||||||
BUILD_DIR="$($(dirname "$0")/../tools/find-build-dir.sh)"
|
BUILD_DIR="$($(dirname "$0")/../tools/find-build-dir.sh)"
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
args="$@"
|
args="$@"
|
||||||
|
do_clean=0
|
||||||
else
|
else
|
||||||
args="setup run clean-again"
|
args="setup run clean-again"
|
||||||
|
do_clean=1
|
||||||
fi
|
fi
|
||||||
args_no_clean=$(sed -r 's/(^| )clean($| )/ /g' <<<$args)
|
|
||||||
do_clean=$( [ "$args" = "$args_no_clean" ]; echo $? )
|
|
||||||
|
|
||||||
ninja -C "$BUILD_DIR"
|
ninja -C "$BUILD_DIR"
|
||||||
|
|
||||||
declare -A results
|
declare -A results
|
||||||
declare -A times
|
|
||||||
|
|
||||||
COUNT=0
|
COUNT=0
|
||||||
FAILURES=0
|
FAILURES=0
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
# Let's always do the cleaning operation first, because it destroys the image
|
|
||||||
# cache.
|
|
||||||
if [ $do_clean = 1 ]; then
|
if [ $do_clean = 1 ]; then
|
||||||
for TEST in TEST-??-* ; do
|
for TEST in TEST-??-* ; do
|
||||||
( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" clean )
|
( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" clean )
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pass_blacklist() {
|
|
||||||
for marker in $BLACKLIST_MARKERS; do
|
|
||||||
if [ -f "$1/$marker" ]; then
|
|
||||||
echo "========== BLACKLISTED: $1 ($marker) =========="
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
for TEST in TEST-??-* ; do
|
for TEST in TEST-??-* ; do
|
||||||
COUNT=$(($COUNT+1))
|
COUNT=$(($COUNT+1))
|
||||||
|
|
||||||
pass_blacklist $TEST || continue
|
|
||||||
start=$(date +%s)
|
|
||||||
|
|
||||||
echo -e "\n--x-- Running $TEST --x--"
|
echo -e "\n--x-- Running $TEST --x--"
|
||||||
set +e
|
set +e
|
||||||
( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" $args_no_clean )
|
( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" $args )
|
||||||
RESULT=$?
|
RESULT=$?
|
||||||
set -e
|
set -e
|
||||||
echo "--x-- Result of $TEST: $RESULT --x--"
|
echo "--x-- Result of $TEST: $RESULT --x--"
|
||||||
|
|
||||||
results["$TEST"]="$RESULT"
|
results["$TEST"]="$RESULT"
|
||||||
times["$TEST"]=$(( $(date +%s) - $start ))
|
|
||||||
|
|
||||||
[ "$RESULT" -ne "0" ] && FAILURES=$(($FAILURES+1))
|
[ "$RESULT" -ne "0" ] && FAILURES=$(($FAILURES+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $FAILURES -eq 0 -a $do_clean = 1 ]; then
|
if [ $FAILURES -eq 0 -a $do_clean = 1 ]; then
|
||||||
for TEST in ${!results[@]}; do
|
for TEST in TEST-??-* ; do
|
||||||
( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" clean-again )
|
( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" clean-again )
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
@ -67,9 +50,11 @@ echo ""
|
||||||
|
|
||||||
for TEST in ${!results[@]}; do
|
for TEST in ${!results[@]}; do
|
||||||
RESULT="${results[$TEST]}"
|
RESULT="${results[$TEST]}"
|
||||||
time="${times[$TEST]}"
|
if [ "$RESULT" -eq "0" ] ; then
|
||||||
string=$([ "$RESULT" = "0" ] && echo "SUCCESS" || echo "FAIL")
|
echo "$TEST: SUCCESS"
|
||||||
printf "%-35s %-8s (%3s s)\n" "${TEST}:" "${string}" "$time"
|
else
|
||||||
|
echo "$TEST: FAIL"
|
||||||
|
fi
|
||||||
done | sort
|
done | sort
|
||||||
|
|
||||||
if [ "$FAILURES" -eq 0 ] ; then
|
if [ "$FAILURES" -eq 0 ] ; then
|
||||||
|
|
|
@ -675,7 +675,7 @@ cleanup_loopdev() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
trap cleanup_loopdev EXIT INT QUIT PIPE
|
trap cleanup_loopdev EXIT
|
||||||
|
|
||||||
create_empty_image() {
|
create_empty_image() {
|
||||||
if [ -z "$IMAGE_NAME" ]; then
|
if [ -z "$IMAGE_NAME" ]; then
|
||||||
|
@ -790,39 +790,16 @@ check_asan_reports() {
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
save_journal() {
|
|
||||||
if [ -n "${ARTIFACT_DIRECTORY}" ]; then
|
|
||||||
dest="${ARTIFACT_DIRECTORY}/${testname}.journal"
|
|
||||||
else
|
|
||||||
dest="$TESTDIR/system.journal"
|
|
||||||
fi
|
|
||||||
|
|
||||||
for j in $1/*; do
|
|
||||||
/usr/lib/systemd/systemd-journal-remote \
|
|
||||||
-o $dest \
|
|
||||||
--getter="journalctl -o export -D $j"
|
|
||||||
|
|
||||||
if [ -n "${TEST_SHOW_JOURNAL}" ]; then
|
|
||||||
echo "---- $j ----"
|
|
||||||
journalctl --no-pager -o short-monotonic --no-hostname --priority=${TEST_SHOW_JOURNAL} -D $j
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm -r $j
|
|
||||||
done
|
|
||||||
|
|
||||||
# we want to print this sometime later, so save this in a variable
|
|
||||||
JOURNAL_LIST="$(ls -l $dest*)"
|
|
||||||
}
|
|
||||||
|
|
||||||
check_result_nspawn() {
|
check_result_nspawn() {
|
||||||
local ret=1
|
local ret=1
|
||||||
local journald_report=""
|
local journald_report=""
|
||||||
local pids=""
|
local pids=""
|
||||||
[[ -e $1/testok ]] && ret=0
|
[[ -e $1/testok ]] && ret=0
|
||||||
[[ -f $1/failed ]] && cp -a $1/failed $TESTDIR
|
[[ -f $1/failed ]] && cp -a $1/failed $TESTDIR
|
||||||
save_journal $1/var/log/journal
|
cp -a $1/var/log/journal $TESTDIR
|
||||||
|
rm -r $1/var/log/journal/*
|
||||||
[[ -f $TESTDIR/failed ]] && cat $TESTDIR/failed
|
[[ -f $TESTDIR/failed ]] && cat $TESTDIR/failed
|
||||||
echo $JOURNAL_LIST
|
ls -l $TESTDIR/journal/*/*.journal
|
||||||
test -s $TESTDIR/failed && ret=$(($ret+1))
|
test -s $TESTDIR/failed && ret=$(($ret+1))
|
||||||
[ -n "$TIMED_OUT" ] && ret=$(($ret+1))
|
[ -n "$TIMED_OUT" ] && ret=$(($ret+1))
|
||||||
check_asan_reports "$1" || ret=$(($ret+1))
|
check_asan_reports "$1" || ret=$(($ret+1))
|
||||||
|
@ -836,11 +813,12 @@ check_result_qemu() {
|
||||||
mount_initdir
|
mount_initdir
|
||||||
[[ -e $initdir/testok ]] && ret=0
|
[[ -e $initdir/testok ]] && ret=0
|
||||||
[[ -f $initdir/failed ]] && cp -a $initdir/failed $TESTDIR
|
[[ -f $initdir/failed ]] && cp -a $initdir/failed $TESTDIR
|
||||||
save_journal $initdir/var/log/journal
|
cp -a $initdir/var/log/journal $TESTDIR
|
||||||
|
rm -r $initdir/var/log/journal/*
|
||||||
check_asan_reports "$initdir" || ret=$(($ret+1))
|
check_asan_reports "$initdir" || ret=$(($ret+1))
|
||||||
_umount_dir $initdir
|
_umount_dir $initdir
|
||||||
[[ -f $TESTDIR/failed ]] && cat $TESTDIR/failed
|
[[ -f $TESTDIR/failed ]] && cat $TESTDIR/failed
|
||||||
echo $JOURNAL_LIST
|
ls -l $TESTDIR/journal/*/*.journal
|
||||||
test -s $TESTDIR/failed && ret=$(($ret+1))
|
test -s $TESTDIR/failed && ret=$(($ret+1))
|
||||||
[ -n "$TIMED_OUT" ] && ret=$(($ret+1))
|
[ -n "$TIMED_OUT" ] && ret=$(($ret+1))
|
||||||
return $ret
|
return $ret
|
||||||
|
@ -941,12 +919,6 @@ install_config_files() {
|
||||||
|
|
||||||
# set the hostname
|
# set the hostname
|
||||||
echo systemd-testsuite > $initdir/etc/hostname
|
echo systemd-testsuite > $initdir/etc/hostname
|
||||||
|
|
||||||
# let's set up just one image with the traditional verbose output
|
|
||||||
if [ ${IMAGE_NAME} != "basic" ]; then
|
|
||||||
mkdir -p $initdir/etc/systemd/system.conf.d
|
|
||||||
echo -e '[Manager]\nStatusUnitFormat=name' >$initdir/etc/systemd/system.conf.d/status.conf
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
install_basic_tools() {
|
install_basic_tools() {
|
||||||
|
|
|
@ -33,8 +33,7 @@ fi
|
||||||
|
|
||||||
function check_bind_tmp_path {
|
function check_bind_tmp_path {
|
||||||
# https://github.com/systemd/systemd/issues/4789
|
# https://github.com/systemd/systemd/issues/4789
|
||||||
local _root="/var/lib/machines/testsuite-13.bind-tmp-path"
|
local _root="/var/lib/machines/bind-tmp-path"
|
||||||
rm -rf "$_root"
|
|
||||||
/usr/lib/systemd/tests/testdata/create-busybox-container "$_root"
|
/usr/lib/systemd/tests/testdata/create-busybox-container "$_root"
|
||||||
>/tmp/bind
|
>/tmp/bind
|
||||||
systemd-nspawn --register=no -D "$_root" --bind=/tmp/bind /bin/sh -c 'test -e /tmp/bind'
|
systemd-nspawn --register=no -D "$_root" --bind=/tmp/bind /bin/sh -c 'test -e /tmp/bind'
|
||||||
|
@ -42,8 +41,7 @@ function check_bind_tmp_path {
|
||||||
|
|
||||||
function check_norbind {
|
function check_norbind {
|
||||||
# https://github.com/systemd/systemd/issues/13170
|
# https://github.com/systemd/systemd/issues/13170
|
||||||
local _root="/var/lib/machines/testsuite-13.norbind-path"
|
local _root="/var/lib/machines/norbind-path"
|
||||||
rm -rf "$_root"
|
|
||||||
mkdir -p /tmp/binddir/subdir
|
mkdir -p /tmp/binddir/subdir
|
||||||
echo -n "outer" > /tmp/binddir/subdir/file
|
echo -n "outer" > /tmp/binddir/subdir/file
|
||||||
mount -t tmpfs tmpfs /tmp/binddir/subdir
|
mount -t tmpfs tmpfs /tmp/binddir/subdir
|
||||||
|
@ -55,9 +53,8 @@ function check_norbind {
|
||||||
function check_notification_socket {
|
function check_notification_socket {
|
||||||
# https://github.com/systemd/systemd/issues/4944
|
# https://github.com/systemd/systemd/issues/4944
|
||||||
local _cmd='echo a | $(busybox which nc) -U -u -w 1 /run/systemd/nspawn/notify'
|
local _cmd='echo a | $(busybox which nc) -U -u -w 1 /run/systemd/nspawn/notify'
|
||||||
# /testsuite-13.nc-container is prepared by test.sh
|
systemd-nspawn --register=no -D /nc-container /bin/sh -x -c "$_cmd"
|
||||||
systemd-nspawn --register=no -D /testsuite-13.nc-container /bin/sh -x -c "$_cmd"
|
systemd-nspawn --register=no -D /nc-container -U /bin/sh -x -c "$_cmd"
|
||||||
systemd-nspawn --register=no -D /testsuite-13.nc-container -U /bin/sh -x -c "$_cmd"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function run {
|
function run {
|
||||||
|
@ -70,8 +67,7 @@ function run {
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local _root="/var/lib/machines/testsuite-13.unified-$1-cgns-$2-api-vfs-writable-$3"
|
local _root="/var/lib/machines/unified-$1-cgns-$2-api-vfs-writable-$3"
|
||||||
rm -rf "$_root"
|
|
||||||
/usr/lib/systemd/tests/testdata/create-busybox-container "$_root"
|
/usr/lib/systemd/tests/testdata/create-busybox-container "$_root"
|
||||||
SYSTEMD_NSPAWN_UNIFIED_HIERARCHY="$1" SYSTEMD_NSPAWN_USE_CGNS="$2" SYSTEMD_NSPAWN_API_VFS_WRITABLE="$3" systemd-nspawn --register=no -D "$_root" -b
|
SYSTEMD_NSPAWN_UNIFIED_HIERARCHY="$1" SYSTEMD_NSPAWN_USE_CGNS="$2" SYSTEMD_NSPAWN_API_VFS_WRITABLE="$3" systemd-nspawn --register=no -D "$_root" -b
|
||||||
SYSTEMD_NSPAWN_UNIFIED_HIERARCHY="$1" SYSTEMD_NSPAWN_USE_CGNS="$2" SYSTEMD_NSPAWN_API_VFS_WRITABLE="$3" systemd-nspawn --register=no -D "$_root" --private-network -b
|
SYSTEMD_NSPAWN_UNIFIED_HIERARCHY="$1" SYSTEMD_NSPAWN_USE_CGNS="$2" SYSTEMD_NSPAWN_API_VFS_WRITABLE="$3" systemd-nspawn --register=no -D "$_root" --private-network -b
|
||||||
|
|
Loading…
Reference in New Issue