diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-11-27 17:57:51 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2020-01-31 15:04:05 +0100 |
commit | db23d83bd49bb04ffb96ce130d2ff004a60a248b (patch) | |
tree | d284bc10890002a2b3b20a663d2a820f14dc49b5 /test/TEST-44-LOG-NAMESPACE/test.sh | |
parent | journald: add ability to activate by varlink socket (diff) | |
download | systemd-db23d83bd49bb04ffb96ce130d2ff004a60a248b.tar.xz systemd-db23d83bd49bb04ffb96ce130d2ff004a60a248b.zip |
test: add simple test for log namespaces
Diffstat (limited to 'test/TEST-44-LOG-NAMESPACE/test.sh')
-rwxr-xr-x | test/TEST-44-LOG-NAMESPACE/test.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/TEST-44-LOG-NAMESPACE/test.sh b/test/TEST-44-LOG-NAMESPACE/test.sh new file mode 100755 index 0000000000..4dfb4418db --- /dev/null +++ b/test/TEST-44-LOG-NAMESPACE/test.sh @@ -0,0 +1,39 @@ +#!/bin/bash +set -e +TEST_DESCRIPTION="test log namespaces" + +. $TEST_BASE_DIR/test-functions + +test_setup() { + create_empty_image_rootdir + + ( + LOG_LEVEL=5 + eval $(udevadm info --export --query=env --name=${LOOPDEV}p2) + + setup_basic_environment + + mask_supporting_services + + # setup the testsuite service + cat >$initdir/etc/systemd/system/testsuite.service <<EOF +[Unit] +Description=Testsuite service +Before=getty-pre.target +Wants=getty-pre.target +Wants=systemd-journald@foobar.socket systemd-journald-varlink@foobar.socket +After=systemd-journald@foobar.socket systemd-journald-varlink@foobar.socket + +[Service] +ExecStart=/testsuite.sh +Type=oneshot +LogTarget=foobar +EOF + cp testsuite.sh $initdir/ + + setup_testsuite + ) + setup_nspawn_root +} + +do_test "$@" |