test: move TEST-22-TMPFILES setup to static files

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-12-10 13:32:20 +01:00
parent c1d6c135bc
commit c0b97b0fc8
13 changed files with 9 additions and 20 deletions

View File

@ -9,23 +9,9 @@ test_setup() {
# create the basic filesystem layout # create the basic filesystem layout
setup_basic_environment setup_basic_environment
mask_supporting_services mask_supporting_services
inst_binary mv
inst_binary stat
inst_binary seq
inst_binary xargs
inst_binary mkfifo
inst_binary readlink
# setup the testsuite service
cp testsuite.service $initdir/etc/systemd/system/
setup_testsuite
mkdir -p $initdir/testsuite
cp run-tmpfiles-tests.sh $initdir/testsuite/
cp test-*.sh $initdir/testsuite/
# create dedicated rootfs for nspawn (located in $TESTDIR/nspawn-root) # create dedicated rootfs for nspawn (located in $TESTDIR/nspawn-root)
setup_nspawn_root setup_nspawn_root
} }
do_test "$@" do_test "$@" 22

View File

@ -58,15 +58,19 @@ BASICTOOLS=(
ln ln
loadkeys loadkeys
login login
mkfifo
mktemp
modprobe modprobe
mount mount
mv mv
nc nc
readlink
rm rm
rmdir rmdir
sed sed
setfont setfont
setsid setsid
seq
sh sh
sleep sleep
socat socat

View File

@ -1,12 +1,11 @@
[Unit] [Unit]
Description=Testsuite service Description=TEST-22-TMPFILES
After=systemd-tmpfiles-setup.service After=systemd-tmpfiles-setup.service
Before=getty-pre.target Before=getty-pre.target
Wants=getty-pre.target Wants=getty-pre.target
[Service] [Service]
WorkingDirectory=/testsuite ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
ExecStart=/testsuite/run-tmpfiles-tests.sh
Type=oneshot Type=oneshot
StandardOutput=tty StandardOutput=tty
StandardError=tty StandardError=tty

View File

@ -5,8 +5,8 @@ set -e
>/failed >/failed
for t in test-*.sh; do for t in ${0%.sh}.*.sh; do
echo "Running $t"; ./$t echo "Running $t"; ./$t
done done
touch /testok touch /testok