Skip to content

Commit 31c4aac

Browse files
LaszloGombosjohannbg
authored andcommitted
test: do not bring up the network interface if it is not needed
Notice that TEST-04 does not explicitelly includes dhclient and dhclient-script for the rootfs. Apply the same principle for all local tests that do not need networking. This should make the tests run faster and slightly more reliable. This change also brings us to a better place where network-legacy files are only gets included via proper dracut module inclusion.
1 parent e2fdb30 commit 31c4aac

File tree

10 files changed

+20
-40
lines changed

10 files changed

+20
-40
lines changed

test/TEST-01-BASIC/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@ test_setup() {
3838
mkdir -p -- dev sys proc etc var/run tmp
3939
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
4040
)
41-
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
42-
mount dmesg dhclient mkdir cp ping dhclient \
41+
inst_multiple sh df free ls shutdown poweroff stty cat ps ln \
42+
mount dmesg mkdir cp \
4343
umount strace less setsid dd sync
4444
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
4545
[ -f ${_terminfodir}/l/linux ] && break
4646
done
4747
inst_multiple -o ${_terminfodir}/l/linux
48-
inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script"
49-
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
5048

5149
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
5250
inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"

test/TEST-02-SYSTEMD/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,13 @@ test_setup() {
3636
mkdir -p -- dev sys proc etc var/run tmp
3737
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
3838
)
39-
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
40-
mount dmesg dhclient mkdir cp ping dhclient \
39+
inst_multiple sh df free ls shutdown poweroff stty cat ps ln \
40+
mount dmesg mkdir cp \
4141
umount strace less setsid systemd-analyze dd sync
4242
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
4343
[ -f ${_terminfodir}/l/linux ] && break
4444
done
4545
inst_multiple -o ${_terminfodir}/l/linux
46-
inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script"
47-
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
4846

4947
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
5048
inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,13 @@ test_setup() {
5858
mkdir -p -- dev sys proc etc var/run tmp
5959
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
6060
)
61-
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
62-
mount dmesg dhclient mkdir cp ping dhclient \
61+
inst_multiple sh df free ls shutdown poweroff stty cat ps ln \
62+
mount dmesg mkdir cp \
6363
umount strace less setsid dd sync
6464
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
6565
[ -f ${_terminfodir}/l/linux ] && break
6666
done
6767
inst_multiple -o ${_terminfodir}/l/linux
68-
inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script"
69-
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
7068

7169
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
7270
inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"

test/TEST-10-RAID/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ test_setup() {
3838
mkdir -p -- dev sys proc etc var/run tmp
3939
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
4040
)
41-
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
42-
mount dmesg dhclient mkdir cp ping dhclient dd sync
41+
inst_multiple sh df free ls shutdown poweroff stty cat ps ln \
42+
mount dmesg mkdir cp dd sync
4343
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
4444
[ -f ${_terminfodir}/l/linux ] && break
4545
done
@@ -53,8 +53,6 @@ test_setup() {
5353

5454
inst_simple /etc/os-release
5555
inst ./test-init.sh /sbin/init
56-
inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script"
57-
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
5856
inst_multiple grep
5957
inst_multiple -o /lib/systemd/systemd-shutdown
6058
find_binary plymouth > /dev/null && inst_multiple plymouth

test/TEST-11-LVM/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ test_setup() {
3939
mkdir -p -- dev sys proc etc var/run tmp
4040
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
4141
)
42-
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
43-
mount dmesg dhclient mkdir cp ping dhclient dd sync
42+
inst_multiple sh df free ls shutdown poweroff stty cat ps ln \
43+
mount dmesg mkdir cp dd sync
4444
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
4545
[ -f ${_terminfodir}/l/linux ] && break
4646
done
4747
inst_multiple -o ${_terminfodir}/l/linux
48-
inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script"
49-
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
5048

5149
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
5250
inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"

test/TEST-12-RAID-DEG/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,12 @@ test_setup() {
7070
mkdir -p -- dev sys proc etc var/run tmp
7171
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
7272
)
73-
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
74-
mount dmesg dhclient mkdir cp ping dhclient dd sync
73+
inst_multiple sh df free ls shutdown poweroff stty cat ps ln \
74+
mount dmesg mkdir cp dd sync
7575
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
7676
[ -f ${_terminfodir}/l/linux ] && break
7777
done
7878
inst_multiple -o ${_terminfodir}/l/linux
79-
inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script"
80-
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
8179

8280
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
8381
inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"

test/TEST-13-ENC-RAID-LVM/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,12 @@ test_setup() {
6767
mkdir -p -- dev sys proc etc var/run tmp
6868
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
6969
)
70-
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
71-
mount dmesg dhclient mkdir cp ping dhclient dd
70+
inst_multiple sh df free ls shutdown poweroff stty cat ps ln \
71+
mount dmesg mkdir cp dd
7272
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
7373
[ -f ${_terminfodir}/l/linux ] && break
7474
done
7575
inst_multiple -o ${_terminfodir}/l/linux
76-
inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script"
77-
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
7876

7977
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
8078
inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"

test/TEST-14-IMSM/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,13 @@ test_setup() {
6464
mkdir -p -- dev sys proc etc var/run tmp
6565
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
6666
)
67-
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
68-
mount dmesg dhclient mkdir cp ping dhclient dd sync
67+
inst_multiple sh df free ls shutdown poweroff stty cat ps ln \
68+
mount dmesg mkdir cp dd sync
6969
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
7070
[ -f ${_terminfodir}/l/linux ] && break
7171
done
7272
inst_multiple -o ${_terminfodir}/l/linux
7373
inst_simple /etc/os-release
74-
inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script"
75-
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
7674

7775
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
7876
inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"

test/TEST-15-BTRFSRAID/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,12 @@ test_setup() {
4242
mkdir -p -- dev sys proc etc var/run tmp
4343
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
4444
)
45-
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
46-
mount dmesg dhclient mkdir cp ping dhclient sync dd
45+
inst_multiple sh df free ls shutdown poweroff stty cat ps ln \
46+
mount dmesg mkdir cp sync dd
4747
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
4848
[ -f ${_terminfodir}/l/linux ] && break
4949
done
5050
inst_multiple -o ${_terminfodir}/l/linux
51-
inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script"
52-
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
5351

5452
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
5553
inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"

test/TEST-17-LVM-THIN/test.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@ test_setup() {
3737
mkdir -p -- dev sys proc etc var/run tmp
3838
mkdir -p root usr/bin usr/lib usr/lib64 usr/sbin
3939
)
40-
inst_multiple sh df free ls shutdown poweroff stty cat ps ln ip \
41-
mount dmesg dhclient mkdir cp ping dhclient dd sync
40+
inst_multiple sh df free ls shutdown poweroff stty cat ps ln \
41+
mount dmesg mkdir cp dd sync
4242
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
4343
[ -f ${_terminfodir}/l/linux ] && break
4444
done
4545
inst_multiple -o ${_terminfodir}/l/linux
46-
inst "$basedir/modules.d/35network-legacy/dhclient-script.sh" "/sbin/dhclient-script"
47-
inst "$basedir/modules.d/35network-legacy/ifup.sh" "/sbin/ifup"
4846

4947
inst_simple "${basedir}/modules.d/99base/dracut-lib.sh" "/lib/dracut-lib.sh"
5048
inst_simple "${basedir}/modules.d/99base/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh"

0 commit comments

Comments
 (0)