mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
Merge pull request #12992 from mrc0mmand/test-functions-fixes
Various test/test-functions fixes/improvements
This commit is contained in:
commit
869250e6b8
@ -29,7 +29,7 @@ Type=oneshot
|
||||
EOF
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -75,7 +75,7 @@ EOF
|
||||
cat >>$initdir/etc/fstab <<EOF
|
||||
/dev/mapper/varcrypt /var ext4 defaults 0 1
|
||||
EOF
|
||||
) || return 1
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root/var"
|
||||
umount $TESTDIR/root/var
|
||||
|
@ -44,7 +44,7 @@ EOF
|
||||
cp test-jobs.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -46,7 +46,7 @@ EOF
|
||||
cp test-journal.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -42,7 +42,7 @@ EOF
|
||||
cp test-rlimits.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -92,7 +92,7 @@ EOF
|
||||
dracut_install -o sesearch
|
||||
dracut_install runcon
|
||||
dracut_install checkmodule semodule semodule_package m4 make /usr/libexec/selinux/hll/pp load_policy sefcontext_compile
|
||||
) || return 1
|
||||
)
|
||||
|
||||
# mask some services that we do not want to run in these tests
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
|
||||
|
@ -40,7 +40,7 @@ EOF
|
||||
cp test-segfault.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -60,7 +60,7 @@ ExecStart=/bin/systemctl reload /
|
||||
EOF
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
ln -s /etc/systemd/system/-.mount $initdir/etc/systemd/system/root.mount
|
||||
mkdir -p $initdir/etc/systemd/system/local-fs.target.wants
|
||||
|
@ -32,7 +32,7 @@ TimeoutStopSec=270s
|
||||
EOF
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
# mask some services that we do not want to run in these tests
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
|
||||
|
@ -45,7 +45,7 @@ ExecStart=/bin/true
|
||||
EOF
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
# mask some services that we do not want to run in these tests
|
||||
|
@ -64,7 +64,7 @@ EOF
|
||||
|
||||
chmod 0755 $initdir/test-fail-on-restart.sh
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
|
@ -90,7 +90,7 @@ EOF
|
||||
|
||||
chmod 0755 $initdir/test-socket-group.sh
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
setup_nspawn_root
|
||||
|
||||
|
@ -184,7 +184,7 @@ EOF
|
||||
|
||||
chmod 0755 $initdir/test-nspawn.sh
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
|
@ -73,7 +73,7 @@ EOF
|
||||
chmod +x $initdir/test-machine-id-setup.sh
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
# mask some services that we do not want to run in these tests
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
|
||||
|
@ -30,7 +30,7 @@ test_setup() {
|
||||
cp $BUILD_DIR/src/shared/libsystemd-shared-*.so ${initdir}/usr/lib
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
# mask some services that we do not want to run in these tests
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-journal-catalog-update.service
|
||||
|
@ -38,7 +38,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
|
@ -30,7 +30,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
# mask some services that we do not want to run in these tests
|
||||
|
@ -40,7 +40,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
|
@ -38,7 +38,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -38,7 +38,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -91,7 +91,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
# mask some services that we do not want to run in these tests
|
||||
|
@ -31,7 +31,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -30,7 +30,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -40,7 +40,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -49,7 +49,7 @@ ExecStart=/bin/true
|
||||
EOF
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
# mask some services that we do not want to run in these tests
|
||||
|
@ -38,7 +38,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
|
@ -49,7 +49,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
|
@ -38,7 +38,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
|
@ -41,7 +41,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
|
@ -38,7 +38,7 @@ EOF
|
||||
cp testsuite.sh $initdir/
|
||||
|
||||
setup_testsuite
|
||||
) || return 1
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
|
@ -659,6 +659,7 @@ install_execs() {
|
||||
# some {rc,halt}.local scripts and programs are okay to not exist, the rest should
|
||||
# also, plymouth is pulled in by rescue.service, but even there the exit code
|
||||
# is ignored; as it's not present on some distros, don't fail if it doesn't exist
|
||||
dinfo "Attempting to install $i"
|
||||
inst $i || [ "${i%.local}" != "$i" ] || [ "${i%systemd-update-done}" != "$i" ] || [ "/bin/plymouth" == "$i" ]
|
||||
done
|
||||
)
|
||||
@ -1238,6 +1239,14 @@ find_binary() {
|
||||
# Install binary executable, and all shared library dependencies, if any.
|
||||
inst_binary() {
|
||||
local _bin _target
|
||||
|
||||
# In certain cases we might attempt to install a binary which is already
|
||||
# present in the test image, yet it's missing from the host system.
|
||||
# In such cases, let's check if the binary indeed exists in the image
|
||||
# before doing any other chcecks. If it does, immediately return with
|
||||
# success.
|
||||
[[ $# -eq 1 && -e $initdir/$1 ]] && return 0
|
||||
|
||||
_bin=$(find_binary "$1") || return 1
|
||||
_target=${2:-$_bin}
|
||||
[[ -e $initdir/$_target ]] && return 0
|
||||
|
@ -9,7 +9,7 @@ REPO_ROOT=${REPO_ROOT:-$(pwd)}
|
||||
sudo bash -c "echo 'deb-src http://archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse' >>/etc/apt/sources.list"
|
||||
sudo apt-get update -y
|
||||
sudo apt-get build-dep systemd -y
|
||||
sudo apt-get install -y ninja-build python3-pip python3-setuptools
|
||||
sudo apt-get install -y ninja-build python3-pip python3-setuptools quota
|
||||
pip3 install meson
|
||||
|
||||
cd $REPO_ROOT
|
||||
|
@ -32,6 +32,7 @@ PACKAGES=(cryptsetup-bin
|
||||
python3-pyparsing
|
||||
python3-setuptools
|
||||
qemu-system-x86
|
||||
quota
|
||||
strace
|
||||
unifont
|
||||
util-linux)
|
||||
|
Loading…
Reference in New Issue
Block a user