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
17 mask_supporting_services
19 # Set up the services.
20 cat >$initdir/etc
/systemd
/system
/specifier-j-wants.service
<< EOF
22 Description=Wants with percent-j specifier
23 Wants=specifier-j-depends-%j.service
24 After=specifier-j-depends-%j.service
28 ExecStart=test -f /tmp/test-specifier-j-%j
29 ExecStart=/bin/sh -c 'echo OK > /testok'
31 cat >$initdir/etc
/systemd
/system
/specifier-j-depends-wants.service
<< EOF
33 Description=Dependent service for percent-j specifier
37 ExecStart=touch /tmp/test-specifier-j-wants
39 cat >$initdir/etc
/systemd
/system
/testsuite.service
<< EOF
41 Description=Testsuite: Ensure %j Wants directives work
42 Wants=specifier-j-wants.service
43 After=specifier-j-wants.service