]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/units/testsuite-62.sh
Merge pull request #30284 from YHNdnzj/fstab-wantedby-defaultdeps
[thirdparty/systemd.git] / test / units / testsuite-62.sh
CommitLineData
00d6fcee 1#!/usr/bin/env bash
7b3cec95 2# SPDX-License-Identifier: LGPL-2.1-or-later
00d6fcee
MV
3set -ex
4set -o pipefail
5
6setup() {
7 systemd-analyze log-level debug
00d6fcee 8
1c3f490f 9 for i in {0..3};
00d6fcee 10 do
1c3f490f
FS
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
4e0db87e 20 ip link property add dev "veth${i}" altname "veth${i}-altname-with-more-than-15-chars"
1c3f490f 21 ip addr add "192.168.113."$((4*i+2))/30 dev "veth${i}"
00d6fcee
MV
22 done
23}
24
e71bac72 25# shellcheck disable=SC2317
00d6fcee
MV
26teardown() {
27 set +e
28
e71bac72 29 for i in {0..3}; do
1c3f490f
FS
30 ip netns del "ns${i}"
31 ip link del "veth${i}"
00d6fcee
MV
32 done
33
34 systemd-analyze log-level info
35}
36
37KERNEL_VERSION="$(uname -r)"
38KERNEL_MAJOR="${KERNEL_VERSION%%.*}"
d1dfedcf 39KERNEL_MINOR="${KERNEL_VERSION#"$KERNEL_MAJOR".}"
00d6fcee
MV
40KERNEL_MINOR="${KERNEL_MINOR%%.*}"
41
42MAJOR_REQUIRED=5
43MINOR_REQUIRED=7
44
45if [[ "$KERNEL_MAJOR" -lt $MAJOR_REQUIRED || ("$KERNEL_MAJOR" -eq $MAJOR_REQUIRED && "$KERNEL_MINOR" -lt $MINOR_REQUIRED) ]]; then
46 echo "kernel is not 5.7+" >>/skipped
47 exit 0
48fi
49
c18f1874 50if systemctl --version | grep -q -F -- "-BPF_FRAMEWORK"; then
85445fba
YW
51 echo "bpf-framework is disabled" >>/skipped
52 exit 0
53fi
54
00d6fcee
MV
55trap teardown EXIT
56setup
57
58systemctl start --wait testsuite-62-1.service
59systemctl start --wait testsuite-62-2.service
60systemctl start --wait testsuite-62-3.service
61systemctl start --wait testsuite-62-4.service
62systemctl start --wait testsuite-62-5.service
63
07268394 64touch /testok