mirror of
https://github.com/systemd/systemd
synced 2024-10-15 20:45:09 +00:00
test: convert TEST-04-JOURNAL to generic image
This commit is contained in:
parent
41b1b2a563
commit
9901a6ad2e
|
@ -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
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
6
test/testsuite-04.units/forever-print-hola.service
Normal file
6
test/testsuite-04.units/forever-print-hola.service
Normal 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'
|
6
test/units/testsuite-04.service
Normal file
6
test/units/testsuite-04.service
Normal file
|
@ -0,0 +1,6 @@
|
|||
[Unit]
|
||||
Description=TEST-04-JOURNAL
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||
Type=oneshot
|
Loading…
Reference in a new issue