1
0
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:
Evgeny Vereshchagin 2019-07-09 02:27:39 +03:00 committed by GitHub
commit 869250e6b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 41 additions and 31 deletions

View File

@ -29,7 +29,7 @@ Type=oneshot
EOF
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -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

View File

@ -44,7 +44,7 @@ EOF
cp test-jobs.sh $initdir/
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -46,7 +46,7 @@ EOF
cp test-journal.sh $initdir/
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -42,7 +42,7 @@ EOF
cp test-rlimits.sh $initdir/
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -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

View File

@ -40,7 +40,7 @@ EOF
cp test-segfault.sh $initdir/
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -64,7 +64,7 @@ EOF
chmod 0755 $initdir/test-fail-on-restart.sh
setup_testsuite
) || return 1
)
ddebug "umount $TESTDIR/root"
umount $TESTDIR/root

View File

@ -90,7 +90,7 @@ EOF
chmod 0755 $initdir/test-socket-group.sh
setup_testsuite
) || return 1
)
setup_nspawn_root

View File

@ -184,7 +184,7 @@ EOF
chmod 0755 $initdir/test-nspawn.sh
setup_testsuite
) || return 1
)
ddebug "umount $TESTDIR/root"
umount $TESTDIR/root

View File

@ -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

View File

@ -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

View File

@ -38,7 +38,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
ddebug "umount $TESTDIR/root"
umount $TESTDIR/root

View File

@ -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

View File

@ -40,7 +40,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
ddebug "umount $TESTDIR/root"
umount $TESTDIR/root

View File

@ -38,7 +38,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -38,7 +38,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -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

View File

@ -31,7 +31,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -30,7 +30,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -40,7 +40,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -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

View File

@ -38,7 +38,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
ddebug "umount $TESTDIR/root"
umount $TESTDIR/root

View File

@ -49,7 +49,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
ddebug "umount $TESTDIR/root"
umount $TESTDIR/root

View File

@ -38,7 +38,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
ddebug "umount $TESTDIR/root"
umount $TESTDIR/root

View File

@ -41,7 +41,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
ddebug "umount $TESTDIR/root"
umount $TESTDIR/root

View File

@ -38,7 +38,7 @@ EOF
cp testsuite.sh $initdir/
setup_testsuite
) || return 1
)
setup_nspawn_root
ddebug "umount $TESTDIR/root"

View File

@ -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

View File

@ -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

View File

@ -32,6 +32,7 @@ PACKAGES=(cryptsetup-bin
python3-pyparsing
python3-setuptools
qemu-system-x86
quota
strace
unifont
util-linux)