1#!/bin/bash
2# SPDX-License-Identifier: LGPL-2.1-or-later
3#
4# Verifies the issues described by https://github.com/systemd/systemd/issues/10191
5set -eux
6set -o pipefail
7
8rm -rf /tmp/test-prefix
9
10mkdir /tmp/test-prefix
11touch /tmp/test-prefix/file
12
13systemd-tmpfiles --remove - <<EOF
14r /tmp/test-prefix
15r /tmp/test-prefix/file
16EOF
17
18test ! -f /tmp/test-prefix/file
19test ! -f /tmp/test-prefix
20
21mkdir /tmp/test-prefix
22touch /tmp/test-prefix/file
23
24systemd-tmpfiles --remove - <<EOF
25r /tmp/test-prefix/file
26r /tmp/test-prefix
27EOF
28
29test ! -f /tmp/test-prefix/file
30test ! -f /tmp/test-prefix
31