]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/units/testsuite-08.sh
Merge pull request #30284 from YHNdnzj/fstab-wantedby-defaultdeps
[thirdparty/systemd.git] / test / units / testsuite-08.sh
CommitLineData
7294632c
FS
1#!/usr/bin/env bash
2# SPDX-License-Identifier: LGPL-2.1-or-later
3set -eux
4set -o pipefail
5
6if systemd-detect-virt -qc; then
7 echo >&2 "This test can't run in a container"
8 exit 1
9fi
10
57d61ff3
FS
11# This test requires systemd to run in the initrd as well, which is not the case
12# for mkinitrd-based initrd (Ubuntu/Debian)
13if [[ "$(systemctl show -P InitRDTimestampMonotonic)" -eq 0 ]]; then
14 echo "systemd didn't run in the initrd, skipping the test"
15 touch /skipped
16 exit 0
17fi
18
7294632c
FS
19# We should've created a mount under /run in initrd (see the other half of the test)
20# that should've survived the transition from initrd to the real system
21test -d /run/initrd-mount-target
22mountpoint /run/initrd-mount-target
23[[ -e /run/initrd-mount-target/hello-world ]]
24
25# Copy the prepared shutdown initrd to its intended location. Check the respective
26# test.sh file for details
27mkdir -p /run/initramfs
28cp -r /shutdown-initrd/* /run/initramfs/
29
30touch /testok