3 TEST_DESCRIPTION
="Ensure %j Wants directives work"
4 RUN_IN_UNPRIVILEGED_CONTAINER
=yes
6 .
$TEST_BASE_DIR/test-functions
9 create_empty_image_rootdir
11 # Create what will eventually be our root filesystem onto an overlay
14 eval $
(udevadm info
--export --query=env
--name=${LOOPDEV}p2
)
16 setup_basic_environment
18 # Set up the services.
19 cat >$initdir/etc
/systemd
/system
/specifier-j-wants.service
<< EOF
21 Description=Wants with percent-j specifier
22 Wants=specifier-j-depends-%j.service
23 After=specifier-j-depends-%j.service
27 ExecStart=test -f /tmp/test-specifier-j-%j
28 ExecStart=/bin/sh -c 'echo OK > /testok'
30 cat >$initdir/etc
/systemd
/system
/specifier-j-depends-wants.service
<< EOF
32 Description=Dependent service for percent-j specifier
36 ExecStart=touch /tmp/test-specifier-j-wants
38 cat >$initdir/etc
/systemd
/system
/testsuite.service
<< EOF
40 Description=Testsuite: Ensure %j Wants directives work
41 Wants=specifier-j-wants.service
42 After=specifier-j-wants.service
53 # mask some services that we do not want to run in these tests
54 ln -s /dev
/null
$initdir/etc
/systemd
/system
/systemd-hwdb-update.service
55 ln -s /dev
/null
$initdir/etc
/systemd
/system
/systemd-journal-catalog-update.service
56 ln -s /dev
/null
$initdir/etc
/systemd
/system
/systemd-networkd.service
57 ln -s /dev
/null
$initdir/etc
/systemd
/system
/systemd-networkd.socket
58 ln -s /dev
/null
$initdir/etc
/systemd
/system
/systemd-resolved.service