test: convert TEST-04-JOURNAL to generic image

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-12-09 19:19:05 +01:00
parent 41b1b2a563
commit 9901a6ad2e
6 changed files with 17 additions and 26 deletions

View File

@ -14,31 +14,8 @@ test_setup() {
setup_basic_environment
mask_supporting_services
# setup the testsuite service
cat >$initdir/etc/systemd/system/testsuite.service <<EOF
[Unit]
Description=Testsuite service
[Service]
ExecStart=/test-journal.sh
Type=oneshot
EOF
cat >$initdir/etc/systemd/system/forever-print-hola.service <<EOF
[Unit]
Description=ForeverPrintHola service
[Service]
Type=simple
ExecStart=/bin/sh -x -c 'while :; do printf "Hola\n" || touch /i-lose-my-logs; sleep 1; done'
EOF
cp test-journal.sh $initdir/
setup_testsuite
)
setup_nspawn_root
}
do_test "$@"
do_test "$@" 04

View File

@ -12,6 +12,8 @@ install_subdir('test-path',
install_dir : testdata_dir)
install_subdir('test-umount',
install_dir : testdata_dir)
install_subdir('testsuite-04.units',
install_dir : testdata_dir)
if conf.get('ENABLE_RESOLVE') == 1
install_subdir('test-resolve',

View File

@ -220,7 +220,7 @@ init=$PATH_TO_INIT \
console=$CONSOLE \
selinux=0 \
$_cgroup_args \
SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/units: \
SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-$1.units:/usr/lib/systemd/tests/testdata/units: \
systemd.unit=testsuite.target \
systemd.wants=testsuite-$1.service ${_end}
$KERNEL_APPEND \
@ -267,7 +267,7 @@ run_nspawn() {
--register=no
--kill-signal=SIGKILL
--directory=$TESTDIR/$1
--setenv=SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/units:
--setenv=SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-$2.units:/usr/lib/systemd/tests/testdata/units:
$PATH_TO_INIT
$KERNEL_APPEND
systemd.unit=testsuite.target

View File

@ -0,0 +1,6 @@
[Unit]
Description=ForeverPrintHola service
[Service]
Type=simple
ExecStart=sh -x -c 'while :; do printf "Hola\n" || touch /i-lose-my-logs; sleep 1; done'

View File

@ -0,0 +1,6 @@
[Unit]
Description=TEST-04-JOURNAL
[Service]
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot