Skip to content

Commit 8b2afb0

Browse files
committed
fix: make testsuite pass on OpenSuse and Arch
This removes some hard assumptions about the file system layout. It also hardens the tests with network interface renaming rules and guards.
1 parent 44fd1c1 commit 8b2afb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+470
-349
lines changed

test/TEST-01-BASIC/test-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
. /lib/dracut-lib.sh
55

6-
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
6+
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
77
command -v plymouth > /dev/null 2>&1 && plymouth --quit
88
exec > /dev/console 2>&1
99

test/TEST-01-BASIC/test.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ test_setup() {
3737
cd "$initdir" || exit
3838
mkdir -p -- dev sys proc etc var/run tmp
3939
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
40-
for i in bin sbin lib lib64; do
41-
ln -sfnr usr/$i $i
42-
done
4340
)
4441
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
4542
mount dmesg dhclient mkdir cp ping dhclient \

test/TEST-02-SYSTEMD/test-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
. /lib/dracut-lib.sh
55

6-
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
6+
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
77
command -v plymouth > /dev/null 2>&1 && plymouth --quit
88
exec > /dev/console 2>&1
99

test/TEST-02-SYSTEMD/test.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ test_setup() {
3535
cd "$initdir" || exit
3636
mkdir -p -- dev sys proc etc var/run tmp
3737
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
38-
for i in bin sbin lib lib64; do
39-
ln -sfnr usr/$i $i
40-
done
4138
mkdir -p -- var/lib/nfs/rpc_pipefs
4239
)
4340
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \

test/TEST-03-USR-MOUNT/test-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
. /lib/dracut-lib.sh
55

6-
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
6+
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
77
command -v plymouth > /dev/null 2>&1 && plymouth --quit
88
exec > /dev/console 2>&1
99

test/TEST-03-USR-MOUNT/test.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ test_setup() {
5757
cd "$initdir" || exit
5858
mkdir -p -- dev sys proc etc var/run tmp
5959
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
60-
for i in bin sbin lib lib64; do
61-
ln -sfnr usr/$i $i
62-
done
6360
)
6461
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
6562
mount dmesg dhclient mkdir cp ping dhclient \

test/TEST-04-FULL-SYSTEMD/test-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
. /lib/dracut-lib.sh
55

6-
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
6+
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
77
command -v plymouth > /dev/null 2>&1 && plymouth --quit
88
exec > /dev/console 2>&1
99

test/TEST-04-FULL-SYSTEMD/test.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,7 @@ test_setup() {
9090
return 1
9191
fi
9292
inst /sbin/init
93-
inst /lib/systemd/system/systemd-remount-fs.service
94-
inst /lib/systemd/systemd-remount-fs
95-
inst /lib/systemd/system/systemd-journal-flush.service
96-
inst /lib/systemd/system/slices.target
97-
inst_multiple -o /lib/systemd/system/dracut*
93+
inst_multiple -o {,/usr}/lib/systemd/system/"dracut*"
9894

9995
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
10096
inst_binary "${basedir}/dracut-util" "/usr/bin/dracut-util"
@@ -112,7 +108,7 @@ test_setup() {
112108
/etc/shadow \
113109
/etc/group \
114110
/etc/shells \
115-
/etc/nsswitch.conf \
111+
{,/usr}/etc/nsswitch.conf \
116112
/etc/pam.conf \
117113
/etc/securetty \
118114
/etc/os-release \
@@ -200,7 +196,7 @@ EOF
200196
ln -fs /proc/self/mounts "$initdir"/etc/mtab
201197

202198
# install any Execs from the service files
203-
grep -Eho '^Exec[^ ]*=[^ ]+' "$initdir"/lib/systemd/system/*.service \
199+
grep -Eho '^Exec[^ ]*=[^ ]+' "$initdir"{,/usr}/lib/systemd/system/*.service \
204200
| while read -r i || [ -n "$i" ]; do
205201
i=${i##Exec*=}
206202
i=${i##-}

test/TEST-10-RAID/test-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
. /lib/dracut-lib.sh
55

6-
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
6+
export PATH=/usr/sbin:/usr/bin:/sbin:/bin
77
command -v plymouth > /dev/null 2>&1 && plymouth --quit
88
exec > /dev/console 2>&1
99

test/TEST-10-RAID/test.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ test_setup() {
3737
cd "$initdir" || exit
3838
mkdir -p -- dev sys proc etc var/run tmp
3939
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
40-
for i in bin sbin lib lib64; do
41-
ln -sfnr usr/$i $i
42-
done
4340
)
4441
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
4542
mount dmesg dhclient mkdir cp ping dhclient dd sync

0 commit comments

Comments
 (0)