]> git.ipfire.org Git - thirdparty/systemd.git/blob - test/units/testsuite-62.sh
man/systemd.mount: tmpfs automatically gains After=swap.target dep
[thirdparty/systemd.git] / test / units / testsuite-62.sh
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: LGPL-2.1-or-later
3 set -ex
4 set -o pipefail
5
6 setup() {
7 systemd-analyze log-level debug
8
9 for i in {0..3};
10 do
11 ip netns del "ns${i}" || true
12 ip link del "veth${i}" || true
13 ip netns add "ns${i}"
14 ip link add "veth${i}" type veth peer name "veth${i}_"
15 ip link set "veth${i}_" netns "ns${i}"
16 ip -n "ns${i}" link set dev "veth${i}_" up
17 ip -n "ns${i}" link set dev lo up
18 ip -n "ns${i}" addr add "192.168.113."$((4*i+1))/30 dev "veth${i}_"
19 ip link set dev "veth${i}" up
20 ip addr add "192.168.113."$((4*i+2))/30 dev "veth${i}"
21 done
22 }
23
24 # shellcheck disable=SC2317
25 teardown() {
26 set +e
27
28 for i in {0..3}; do
29 ip netns del "ns${i}"
30 ip link del "veth${i}"
31 done
32
33 systemd-analyze log-level info
34 }
35
36 KERNEL_VERSION="$(uname -r)"
37 KERNEL_MAJOR="${KERNEL_VERSION%%.*}"
38 KERNEL_MINOR="${KERNEL_VERSION#"$KERNEL_MAJOR".}"
39 KERNEL_MINOR="${KERNEL_MINOR%%.*}"
40
41 MAJOR_REQUIRED=5
42 MINOR_REQUIRED=7
43
44 if [[ "$KERNEL_MAJOR" -lt $MAJOR_REQUIRED || ("$KERNEL_MAJOR" -eq $MAJOR_REQUIRED && "$KERNEL_MINOR" -lt $MINOR_REQUIRED) ]]; then
45 echo "kernel is not 5.7+" >>/skipped
46 exit 0
47 fi
48
49 if systemctl --version | grep -q -F -- "-BPF_FRAMEWORK"; then
50 echo "bpf-framework is disabled" >>/skipped
51 exit 0
52 fi
53
54 trap teardown EXIT
55 setup
56
57 systemctl start --wait testsuite-62-1.service
58 systemctl start --wait testsuite-62-2.service
59 systemctl start --wait testsuite-62-3.service
60 systemctl start --wait testsuite-62-4.service
61 systemctl start --wait testsuite-62-5.service
62
63 touch /testok