summaryrefslogtreecommitdiffstats
path: root/test/TEST-60-BONDBRIDGEVLAN/client-init.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:54:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:54:25 +0000
commit9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a (patch)
tree2efb72864cc69e174c9c5ee33efb88a5f1553b48 /test/TEST-60-BONDBRIDGEVLAN/client-init.sh
parentInitial commit. (diff)
downloaddracut-9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a.tar.xz
dracut-9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a.zip
Adding upstream version 060+5.upstream/060+5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/TEST-60-BONDBRIDGEVLAN/client-init.sh')
-rwxr-xr-xtest/TEST-60-BONDBRIDGEVLAN/client-init.sh64
1 files changed, 64 insertions, 0 deletions
diff --git a/test/TEST-60-BONDBRIDGEVLAN/client-init.sh b/test/TEST-60-BONDBRIDGEVLAN/client-init.sh
new file mode 100755
index 0000000..b1d1db4
--- /dev/null
+++ b/test/TEST-60-BONDBRIDGEVLAN/client-init.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+exec > /dev/console 2>&1
+export PATH=/usr/sbin:/usr/bin:/sbin:/bin
+strstr() { [ "${1#*"$2"*}" != "$1" ]; }
+CMDLINE=$(while read -r line; do echo "$line"; done < /proc/cmdline)
+export TERM=linux
+export PS1='initramfs-test:\w\$ '
+stty sane
+echo "made it to the rootfs! Powering down."
+
+testnum=$(grep -Eo "rd.dracut.test.num=[^[:space:]]+" /proc/cmdline | sed -nr 's/.*=(.*)/\1/p')
+netmodule=$(grep -Eo "rd.dracut.test.net-module=[^[:space:]]+" /proc/cmdline | sed -nr 's/.*=(.*)/\1/p')
+
+(
+ echo OK
+
+ ip -o -4 address show scope global | while read -r _ if rest; do echo "$if"; done | sort
+
+ case "$testnum" in
+ 1)
+ ping -c 2 192.168.50.1 > /dev/null
+ echo PING1=$?
+ ping -c 2 192.168.54.1 > /dev/null
+ echo PING2=$?
+ ping -c 2 192.168.55.1 > /dev/null
+ echo PING3=$?
+ ping -c 2 192.168.56.1 > /dev/null
+ echo PING4=$?
+ ping -c 2 192.168.57.1 > /dev/null
+ echo PING5=$?
+ ;;
+ 2)
+ ping -c 2 192.168.51.1 > /dev/null
+ echo PING1=$?
+ ip link show net3 | grep "master bond0" > /dev/null
+ echo NET3=$?
+ ip link show net4 | grep "master bond0" > /dev/null
+ echo NET4=$?
+ ;;
+ 3)
+ ping -c 2 192.168.51.1 > /dev/null
+ echo PING1=$?
+ ip link show net1 | grep "master br0" > /dev/null
+ echo NET1=$?
+ ip link show net5 | grep "master br0" > /dev/null
+ echo NET5=$?
+
+ ;;
+ esac
+
+ case "$netmodule" in
+ network-legacy)
+ for i in /run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-*; do
+ basename "$i"
+ grep -v 'UUID=' "$i"
+ done
+ ;;
+ esac
+
+ echo EOF
+) | dd oflag=direct,dsync of=/dev/sda
+
+strstr "$CMDLINE" "rd.shell" && sh -i
+poweroff -f