|
Harald Hoyer |
d1bf89 |
From d6862983155c31896ac46dc9d43f4086850a0d44 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
d1bf89 |
From: Harald Hoyer <harald@redhat.com>
|
|
Harald Hoyer |
d1bf89 |
Date: Mon, 18 Jun 2012 19:28:44 +0200
|
|
Harald Hoyer |
d1bf89 |
Subject: [PATCH] TEST-50-MULTINIC: libnss cleanup
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
---
|
|
Harald Hoyer |
d1bf89 |
test/TEST-50-MULTINIC/test.sh | 235 +++++++++++++++++++----------------------
|
|
Harald Hoyer |
d1bf89 |
1 file changed, 110 insertions(+), 125 deletions(-)
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
diff --git a/test/TEST-50-MULTINIC/test.sh b/test/TEST-50-MULTINIC/test.sh
|
|
Harald Hoyer |
d1bf89 |
index 1655608..5c7ca6c 100755
|
|
Harald Hoyer |
d1bf89 |
--- a/test/TEST-50-MULTINIC/test.sh
|
|
Harald Hoyer |
d1bf89 |
+++ b/test/TEST-50-MULTINIC/test.sh
|
|
Harald Hoyer |
d1bf89 |
@@ -1,4 +1,6 @@
|
|
Harald Hoyer |
d1bf89 |
#!/bin/bash
|
|
Harald Hoyer |
d1bf89 |
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
|
Harald Hoyer |
d1bf89 |
+# ex: ts=8 sw=4 sts=4 et filetype=sh
|
|
Harald Hoyer |
d1bf89 |
TEST_DESCRIPTION="root filesystem on NFS with multiple nics"
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
KVERSION=${KVERSION-$(uname -r)}
|
|
Harald Hoyer |
d1bf89 |
@@ -41,15 +43,15 @@ client_test() {
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
# Need this so kvm-qemu will boot (needs non-/dev/zero local disk)
|
|
Harald Hoyer |
d1bf89 |
if ! dd if=/dev/zero of=$TESTDIR/client.img bs=1M count=1; then
|
|
Harald Hoyer |
d1bf89 |
- echo "Unable to make client sda image" 1>&2
|
|
Harald Hoyer |
d1bf89 |
- return 1
|
|
Harald Hoyer |
d1bf89 |
+ echo "Unable to make client sda image" 1>&2
|
|
Harald Hoyer |
d1bf89 |
+ return 1
|
|
Harald Hoyer |
d1bf89 |
fi
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
$testdir/run-qemu -hda $TESTDIR/client.img -m 512M -nographic \
|
|
Harald Hoyer |
d1bf89 |
- -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \
|
|
Harald Hoyer |
d1bf89 |
- -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \
|
|
Harald Hoyer |
d1bf89 |
- -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \
|
|
Harald Hoyer |
d1bf89 |
- -net socket,connect=127.0.0.1:12350 \
|
|
Harald Hoyer |
d1bf89 |
+ -net nic,macaddr=52:54:00:12:34:$mac1,model=e1000 \
|
|
Harald Hoyer |
d1bf89 |
+ -net nic,macaddr=52:54:00:12:34:$mac2,model=e1000 \
|
|
Harald Hoyer |
d1bf89 |
+ -net nic,macaddr=52:54:00:12:34:$mac3,model=e1000 \
|
|
Harald Hoyer |
d1bf89 |
+ -net socket,connect=127.0.0.1:12350 \
|
|
Harald Hoyer |
d1bf89 |
-hdc /dev/null \
|
|
Harald Hoyer |
d1bf89 |
-watchdog ib700 -watchdog-action poweroff \
|
|
Harald Hoyer |
d1bf89 |
-kernel /boot/vmlinuz-$KVERSION \
|
|
Harald Hoyer |
d1bf89 |
@@ -57,17 +59,17 @@ client_test() {
|
|
Harald Hoyer |
d1bf89 |
-initrd $TESTDIR/initramfs.testing
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
if [[ $? -ne 0 ]] || ! grep -m 1 -q OK $TESTDIR/client.img; then
|
|
Harald Hoyer |
d1bf89 |
- echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]"
|
|
Harald Hoyer |
d1bf89 |
- return 1
|
|
Harald Hoyer |
d1bf89 |
+ echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]"
|
|
Harald Hoyer |
d1bf89 |
+ return 1
|
|
Harald Hoyer |
d1bf89 |
fi
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
for i in $check ; do
|
|
Harald Hoyer |
d1bf89 |
- echo $i
|
|
Harald Hoyer |
d1bf89 |
- if ! grep -m 1 -q $i $TESTDIR/client.img; then
|
|
Harald Hoyer |
d1bf89 |
- echo "CLIENT TEST END: $test_name [FAILED - BAD IF]"
|
|
Harald Hoyer |
d1bf89 |
- return 1
|
|
Harald Hoyer |
d1bf89 |
- fi
|
|
Harald Hoyer |
d1bf89 |
+ echo $i
|
|
Harald Hoyer |
d1bf89 |
+ if ! grep -m 1 -q $i $TESTDIR/client.img; then
|
|
Harald Hoyer |
d1bf89 |
+ echo "CLIENT TEST END: $test_name [FAILED - BAD IF]"
|
|
Harald Hoyer |
d1bf89 |
+ return 1
|
|
Harald Hoyer |
d1bf89 |
+ fi
|
|
Harald Hoyer |
d1bf89 |
done
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
echo "CLIENT TEST END: $test_name [OK]"
|
|
Harald Hoyer |
d1bf89 |
@@ -77,8 +79,8 @@ client_test() {
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
test_run() {
|
|
Harald Hoyer |
d1bf89 |
if ! run_server; then
|
|
Harald Hoyer |
d1bf89 |
- echo "Failed to start server" 1>&2
|
|
Harald Hoyer |
d1bf89 |
- return 1
|
|
Harald Hoyer |
d1bf89 |
+ echo "Failed to start server" 1>&2
|
|
Harald Hoyer |
d1bf89 |
+ return 1
|
|
Harald Hoyer |
d1bf89 |
fi
|
|
Harald Hoyer |
d1bf89 |
test_client || { kill_server; return 1; }
|
|
Harald Hoyer |
d1bf89 |
}
|
|
Harald Hoyer |
d1bf89 |
@@ -90,33 +92,33 @@ test_client() {
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
# PXE Style BOOTIF=
|
|
Harald Hoyer |
d1bf89 |
client_test "MULTINIC root=nfs BOOTIF=" \
|
|
Harald Hoyer |
d1bf89 |
- 00 01 02 \
|
|
Harald Hoyer |
d1bf89 |
- "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \
|
|
Harald Hoyer |
d1bf89 |
- "eth0" || return 1
|
|
Harald Hoyer |
d1bf89 |
+ 00 01 02 \
|
|
Harald Hoyer |
d1bf89 |
+ "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \
|
|
Harald Hoyer |
d1bf89 |
+ "eth0" || return 1
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
# PXE Style BOOTIF= with dhcp root-path
|
|
Harald Hoyer |
d1bf89 |
client_test "MULTINIC root=dhcp BOOTIF=" \
|
|
Harald Hoyer |
d1bf89 |
- 00 01 02 \
|
|
Harald Hoyer |
d1bf89 |
- "root=dhcp BOOTIF=52-54-00-12-34-02" \
|
|
Harald Hoyer |
d1bf89 |
- "eth2" || return 1
|
|
Harald Hoyer |
d1bf89 |
+ 00 01 02 \
|
|
Harald Hoyer |
d1bf89 |
+ "root=dhcp BOOTIF=52-54-00-12-34-02" \
|
|
Harald Hoyer |
d1bf89 |
+ "eth2" || return 1
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
# Multinic case, where only one nic works
|
|
Harald Hoyer |
d1bf89 |
client_test "MULTINIC root=nfs ip=dhcp" \
|
|
Harald Hoyer |
d1bf89 |
- FF 00 FE \
|
|
Harald Hoyer |
d1bf89 |
- "root=nfs:192.168.50.1:/nfs/client ip=dhcp" \
|
|
Harald Hoyer |
d1bf89 |
- "eth1" || return 1
|
|
Harald Hoyer |
d1bf89 |
+ FF 00 FE \
|
|
Harald Hoyer |
d1bf89 |
+ "root=nfs:192.168.50.1:/nfs/client ip=dhcp" \
|
|
Harald Hoyer |
d1bf89 |
+ "eth1" || return 1
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
# Require two interfaces
|
|
Harald Hoyer |
d1bf89 |
client_test "MULTINIC root=nfs ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \
|
|
Harald Hoyer |
d1bf89 |
- 00 01 02 \
|
|
Harald Hoyer |
d1bf89 |
- "root=nfs:192.168.50.1:/nfs/client ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \
|
|
Harald Hoyer |
d1bf89 |
- "eth1 eth2" || return 1
|
|
Harald Hoyer |
d1bf89 |
+ 00 01 02 \
|
|
Harald Hoyer |
d1bf89 |
+ "root=nfs:192.168.50.1:/nfs/client ip=eth1:dhcp ip=eth2:dhcp bootdev=eth1" \
|
|
Harald Hoyer |
d1bf89 |
+ "eth1 eth2" || return 1
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
# Require three interfaces with dhcp root-path
|
|
Harald Hoyer |
d1bf89 |
client_test "MULTINIC root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \
|
|
Harald Hoyer |
d1bf89 |
- 00 01 02 \
|
|
Harald Hoyer |
d1bf89 |
- "root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \
|
|
Harald Hoyer |
d1bf89 |
- "eth0 eth1 eth2" || return 1
|
|
Harald Hoyer |
d1bf89 |
+ 00 01 02 \
|
|
Harald Hoyer |
d1bf89 |
+ "root=dhcp ip=eth0:dhcp ip=eth1:dhcp ip=eth2:dhcp bootdev=eth2" \
|
|
Harald Hoyer |
d1bf89 |
+ "eth0 eth1 eth2" || return 1
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
kill_server
|
|
Harald Hoyer |
d1bf89 |
return 0
|
|
Harald Hoyer |
d1bf89 |
@@ -129,86 +131,70 @@ test_setup() {
|
|
Harald Hoyer |
d1bf89 |
mkdir $TESTDIR/mnt
|
|
Harald Hoyer |
d1bf89 |
sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
- export kernel=$KVERSION
|
|
Harald Hoyer |
d1bf89 |
- export srcmods="/lib/modules/$kernel/"
|
|
Harald Hoyer |
d1bf89 |
- # Detect lib paths
|
|
Harald Hoyer |
d1bf89 |
-
|
|
Harald Hoyer |
d1bf89 |
. $basedir/dracut-functions.sh
|
|
Harald Hoyer |
d1bf89 |
- if ! [[ $libdirs ]] ; then
|
|
Harald Hoyer |
d1bf89 |
- if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
|
|
Harald Hoyer |
d1bf89 |
- && [[ -d /lib64 ]]; then
|
|
Harald Hoyer |
d1bf89 |
- libdirs+=" /lib64"
|
|
Harald Hoyer |
d1bf89 |
- [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
|
|
Harald Hoyer |
d1bf89 |
- else
|
|
Harald Hoyer |
d1bf89 |
- libdirs+=" /lib"
|
|
Harald Hoyer |
d1bf89 |
- [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
|
|
Harald Hoyer |
d1bf89 |
- fi
|
|
Harald Hoyer |
d1bf89 |
- fi
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
(
|
|
Harald Hoyer |
d1bf89 |
- initdir=$TESTDIR/mnt
|
|
Harald Hoyer |
d1bf89 |
-
|
|
Harald Hoyer |
d1bf89 |
- for _f in modules.builtin.bin modules.builtin; do
|
|
Harald Hoyer |
d1bf89 |
- [[ $srcmods/$_f ]] && break
|
|
Harald Hoyer |
d1bf89 |
- done || {
|
|
Harald Hoyer |
d1bf89 |
- dfatal "No modules.builtin.bin and modules.builtin found!"
|
|
Harald Hoyer |
d1bf89 |
- return 1
|
|
Harald Hoyer |
d1bf89 |
- }
|
|
Harald Hoyer |
d1bf89 |
+ initdir=$TESTDIR/mnt
|
|
Harald Hoyer |
d1bf89 |
+
|
|
Harald Hoyer |
d1bf89 |
+ (
|
|
Harald Hoyer |
d1bf89 |
+ cd "$initdir";
|
|
Harald Hoyer |
d1bf89 |
+ mkdir -p dev sys proc run etc var/run tmp var/lib/{dhcpd,rpcbind}
|
|
Harald Hoyer |
d1bf89 |
+ mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs}
|
|
Harald Hoyer |
d1bf89 |
+ chmod 777 var/lib/rpcbind var/lib/nfs
|
|
Harald Hoyer |
d1bf89 |
+ )
|
|
Harald Hoyer |
d1bf89 |
+
|
|
Harald Hoyer |
d1bf89 |
+ for _f in modules.builtin.bin modules.builtin; do
|
|
Harald Hoyer |
d1bf89 |
+ [[ $srcmods/$_f ]] && break
|
|
Harald Hoyer |
d1bf89 |
+ done || {
|
|
Harald Hoyer |
d1bf89 |
+ dfatal "No modules.builtin.bin and modules.builtin found!"
|
|
Harald Hoyer |
d1bf89 |
+ return 1
|
|
Harald Hoyer |
d1bf89 |
+ }
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
for _f in modules.builtin.bin modules.builtin modules.order; do
|
|
Harald Hoyer |
d1bf89 |
- [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
|
|
Harald Hoyer |
d1bf89 |
- done
|
|
Harald Hoyer |
d1bf89 |
+ [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
|
|
Harald Hoyer |
d1bf89 |
+ done
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
- dracut_install sh ls shutdown poweroff stty cat ps ln ip \
|
|
Harald Hoyer |
d1bf89 |
- dmesg mkdir cp ping exportfs \
|
|
Harald Hoyer |
d1bf89 |
- modprobe rpc.nfsd rpc.mountd showmount tcpdump \
|
|
Harald Hoyer |
d1bf89 |
- /etc/services sleep mount chmod
|
|
Harald Hoyer |
d1bf89 |
+ dracut_install sh ls shutdown poweroff stty cat ps ln ip \
|
|
Harald Hoyer |
d1bf89 |
+ dmesg mkdir cp ping exportfs \
|
|
Harald Hoyer |
d1bf89 |
+ modprobe rpc.nfsd rpc.mountd showmount tcpdump \
|
|
Harald Hoyer |
d1bf89 |
+ /etc/services sleep mount chmod
|
|
Harald Hoyer |
d1bf89 |
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
|
Harald Hoyer |
d1bf89 |
- [ -f ${_terminfodir}/l/linux ] && break
|
|
Harald Hoyer |
d1bf89 |
- done
|
|
Harald Hoyer |
d1bf89 |
- dracut_install -o ${_terminfodir}/l/linux
|
|
Harald Hoyer |
d1bf89 |
- type -P portmap >/dev/null && dracut_install portmap
|
|
Harald Hoyer |
d1bf89 |
- type -P rpcbind >/dev/null && dracut_install rpcbind
|
|
Harald Hoyer |
d1bf89 |
- [ -f /etc/netconfig ] && dracut_install /etc/netconfig
|
|
Harald Hoyer |
d1bf89 |
- type -P dhcpd >/dev/null && dracut_install dhcpd
|
|
Harald Hoyer |
d1bf89 |
- [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
|
|
Harald Hoyer |
d1bf89 |
- instmods nfsd sunrpc ipv6 lockd
|
|
Harald Hoyer |
d1bf89 |
- inst ./server-init.sh /sbin/init
|
|
Harald Hoyer |
d1bf89 |
- inst ./hosts /etc/hosts
|
|
Harald Hoyer |
d1bf89 |
- inst ./exports /etc/exports
|
|
Harald Hoyer |
d1bf89 |
- inst ./dhcpd.conf /etc/dhcpd.conf
|
|
Harald Hoyer |
d1bf89 |
- dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
|
|
Harald Hoyer |
d1bf89 |
- dracut_install rpc.idmapd /etc/idmapd.conf
|
|
Harald Hoyer |
d1bf89 |
-
|
|
Harald Hoyer |
d1bf89 |
- inst_libdir_file 'libnfsidmap_nsswitch.so*'
|
|
Harald Hoyer |
d1bf89 |
- inst_libdir_file 'libnfsidmap/*.so*'
|
|
Harald Hoyer |
d1bf89 |
- inst_libdir_file 'libnfsidmap*.so*'
|
|
Harald Hoyer |
d1bf89 |
+ [ -f ${_terminfodir}/l/linux ] && break
|
|
Harald Hoyer |
d1bf89 |
+ done
|
|
Harald Hoyer |
d1bf89 |
+ dracut_install -o ${_terminfodir}/l/linux
|
|
Harald Hoyer |
d1bf89 |
+ type -P portmap >/dev/null && dracut_install portmap
|
|
Harald Hoyer |
d1bf89 |
+ type -P rpcbind >/dev/null && dracut_install rpcbind
|
|
Harald Hoyer |
d1bf89 |
+ [ -f /etc/netconfig ] && dracut_install /etc/netconfig
|
|
Harald Hoyer |
d1bf89 |
+ type -P dhcpd >/dev/null && dracut_install dhcpd
|
|
Harald Hoyer |
d1bf89 |
+ [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
|
|
Harald Hoyer |
d1bf89 |
+ instmods nfsd sunrpc ipv6 lockd
|
|
Harald Hoyer |
d1bf89 |
+ inst ./server-init.sh /sbin/init
|
|
Harald Hoyer |
d1bf89 |
+ inst ./hosts /etc/hosts
|
|
Harald Hoyer |
d1bf89 |
+ inst ./exports /etc/exports
|
|
Harald Hoyer |
d1bf89 |
+ inst ./dhcpd.conf /etc/dhcpd.conf
|
|
Harald Hoyer |
d1bf89 |
+ dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
|
|
Harald Hoyer |
d1bf89 |
+
|
|
Harald Hoyer |
d1bf89 |
+ dracut_install rpc.idmapd /etc/idmapd.conf
|
|
Harald Hoyer |
d1bf89 |
+
|
|
Harald Hoyer |
d1bf89 |
+ inst_libdir_file 'libnfsidmap_nsswitch.so*'
|
|
Harald Hoyer |
d1bf89 |
+ inst_libdir_file 'libnfsidmap/*.so*'
|
|
Harald Hoyer |
d1bf89 |
+ inst_libdir_file 'libnfsidmap*.so*'
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
|
|
Harald Hoyer |
d1bf89 |
- | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
|
|
Harald Hoyer |
d1bf89 |
+ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
|
|
Harald Hoyer |
d1bf89 |
_nsslibs=${_nsslibs#|}
|
|
Harald Hoyer |
d1bf89 |
_nsslibs=${_nsslibs%|}
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
- inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
|
|
Harald Hoyer |
d1bf89 |
+ inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
- (
|
|
Harald Hoyer |
d1bf89 |
- cd "$initdir";
|
|
Harald Hoyer |
d1bf89 |
- mkdir -p dev sys proc etc var/run tmp var/lib/{dhcpd,rpcbind}
|
|
Harald Hoyer |
d1bf89 |
- mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs}
|
|
Harald Hoyer |
d1bf89 |
- chmod 777 var/lib/rpcbind var/lib/nfs
|
|
Harald Hoyer |
d1bf89 |
- )
|
|
Harald Hoyer |
d1bf89 |
+ inst /etc/nsswitch.conf /etc/nsswitch.conf
|
|
Harald Hoyer |
d1bf89 |
+ inst /etc/passwd /etc/passwd
|
|
Harald Hoyer |
d1bf89 |
+ inst /etc/group /etc/group
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
- inst /etc/nsswitch.conf /etc/nsswitch.conf
|
|
Harald Hoyer |
d1bf89 |
- inst /etc/passwd /etc/passwd
|
|
Harald Hoyer |
d1bf89 |
- inst /etc/group /etc/group
|
|
Harald Hoyer |
d1bf89 |
- for i in /lib*/libnss_files**;do
|
|
Harald Hoyer |
d1bf89 |
- inst_library $i
|
|
Harald Hoyer |
d1bf89 |
- done
|
|
Harald Hoyer |
d1bf89 |
+ /sbin/depmod -a -b "$initdir" $kernel
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
- /sbin/depmod -a -b "$initdir" $kernel
|
|
Harald Hoyer |
d1bf89 |
-
|
|
Harald Hoyer |
d1bf89 |
- cp -a /etc/ld.so.conf* $initdir/etc
|
|
Harald Hoyer |
d1bf89 |
- sudo ldconfig -r "$initdir"
|
|
Harald Hoyer |
d1bf89 |
+ cp -a /etc/ld.so.conf* $initdir/etc
|
|
Harald Hoyer |
d1bf89 |
+ sudo ldconfig -r "$initdir"
|
|
Harald Hoyer |
d1bf89 |
)
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
# Make client root inside server root
|
|
Harald Hoyer |
d1bf89 |
@@ -216,49 +202,48 @@ test_setup() {
|
|
Harald Hoyer |
d1bf89 |
mkdir -p $initdir
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
(
|
|
Harald Hoyer |
d1bf89 |
- dracut_install sh shutdown poweroff stty cat ps ln ip \
|
|
Harald Hoyer |
d1bf89 |
+ dracut_install sh shutdown poweroff stty cat ps ln ip \
|
|
Harald Hoyer |
d1bf89 |
mount dmesg mkdir cp ping grep ls
|
|
Harald Hoyer |
d1bf89 |
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
|
Harald Hoyer |
d1bf89 |
- [ -f ${_terminfodir}/l/linux ] && break
|
|
Harald Hoyer |
d1bf89 |
- done
|
|
Harald Hoyer |
d1bf89 |
- dracut_install -o ${_terminfodir}/l/linux
|
|
Harald Hoyer |
d1bf89 |
- inst ./client-init.sh /sbin/init
|
|
Harald Hoyer |
d1bf89 |
- (
|
|
Harald Hoyer |
d1bf89 |
- cd "$initdir"
|
|
Harald Hoyer |
d1bf89 |
- mkdir -p dev sys proc etc run
|
|
Harald Hoyer |
d1bf89 |
- mkdir -p var/lib/nfs/rpc_pipefs
|
|
Harald Hoyer |
d1bf89 |
- )
|
|
Harald Hoyer |
d1bf89 |
- inst /etc/nsswitch.conf /etc/nsswitch.conf
|
|
Harald Hoyer |
d1bf89 |
- inst /etc/passwd /etc/passwd
|
|
Harald Hoyer |
d1bf89 |
- inst /etc/group /etc/group
|
|
Harald Hoyer |
d1bf89 |
-
|
|
Harald Hoyer |
d1bf89 |
- inst_libdir_file 'libnfsidmap_nsswitch.so*'
|
|
Harald Hoyer |
d1bf89 |
- inst_libdir_file 'libnfsidmap/*.so*'
|
|
Harald Hoyer |
d1bf89 |
- inst_libdir_file 'libnfsidmap*.so*'
|
|
Harald Hoyer |
d1bf89 |
+ [ -f ${_terminfodir}/l/linux ] && break
|
|
Harald Hoyer |
d1bf89 |
+ done
|
|
Harald Hoyer |
d1bf89 |
+ dracut_install -o ${_terminfodir}/l/linux
|
|
Harald Hoyer |
d1bf89 |
+ inst ./client-init.sh /sbin/init
|
|
Harald Hoyer |
d1bf89 |
+ (
|
|
Harald Hoyer |
d1bf89 |
+ cd "$initdir"
|
|
Harald Hoyer |
d1bf89 |
+ mkdir -p dev sys proc etc run
|
|
Harald Hoyer |
d1bf89 |
+ mkdir -p var/lib/nfs/rpc_pipefs
|
|
Harald Hoyer |
d1bf89 |
+ )
|
|
Harald Hoyer |
d1bf89 |
+ inst /etc/nsswitch.conf /etc/nsswitch.conf
|
|
Harald Hoyer |
d1bf89 |
+ inst /etc/passwd /etc/passwd
|
|
Harald Hoyer |
d1bf89 |
+ inst /etc/group /etc/group
|
|
Harald Hoyer |
d1bf89 |
+
|
|
Harald Hoyer |
d1bf89 |
+ dracut_install rpc.idmapd /etc/idmapd.conf
|
|
Harald Hoyer |
d1bf89 |
+ inst_libdir_file 'libnfsidmap_nsswitch.so*'
|
|
Harald Hoyer |
d1bf89 |
+ inst_libdir_file 'libnfsidmap/*.so*'
|
|
Harald Hoyer |
d1bf89 |
+ inst_libdir_file 'libnfsidmap*.so*'
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
_nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
|
|
Harald Hoyer |
d1bf89 |
- | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
|
|
Harald Hoyer |
d1bf89 |
+ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')
|
|
Harald Hoyer |
d1bf89 |
_nsslibs=${_nsslibs#|}
|
|
Harald Hoyer |
d1bf89 |
_nsslibs=${_nsslibs%|}
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
- inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
|
|
Harald Hoyer |
d1bf89 |
+ inst_libdir_file -n "$_nsslibs" 'libnss*.so*'
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
- cp -a /etc/ld.so.conf* $initdir/etc
|
|
Harald Hoyer |
d1bf89 |
- sudo ldconfig -r "$initdir"
|
|
Harald Hoyer |
d1bf89 |
+ cp -a /etc/ld.so.conf* $initdir/etc
|
|
Harald Hoyer |
d1bf89 |
+ sudo ldconfig -r "$initdir"
|
|
Harald Hoyer |
d1bf89 |
)
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
- chroot $initdir
|
|
Harald Hoyer |
d1bf89 |
-
|
|
Harald Hoyer |
d1bf89 |
sudo umount $TESTDIR/mnt
|
|
Harald Hoyer |
d1bf89 |
rm -fr $TESTDIR/mnt
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
# Make an overlay with needed tools for the test harness
|
|
Harald Hoyer |
d1bf89 |
(
|
|
Harald Hoyer |
d1bf89 |
- initdir=$TESTDIR/overlay
|
|
Harald Hoyer |
d1bf89 |
- mkdir $TESTDIR/overlay
|
|
Harald Hoyer |
d1bf89 |
- dracut_install poweroff shutdown
|
|
Harald Hoyer |
d1bf89 |
- inst_hook emergency 000 ./hard-off.sh
|
|
Harald Hoyer |
d1bf89 |
- inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
|
Harald Hoyer |
d1bf89 |
+ initdir=$TESTDIR/overlay
|
|
Harald Hoyer |
d1bf89 |
+ mkdir $TESTDIR/overlay
|
|
Harald Hoyer |
d1bf89 |
+ dracut_install poweroff shutdown
|
|
Harald Hoyer |
d1bf89 |
+ inst_hook emergency 000 ./hard-off.sh
|
|
Harald Hoyer |
d1bf89 |
+ inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
|
Harald Hoyer |
d1bf89 |
)
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
# Make server's dracut image
|
|
Harald Hoyer |
d1bf89 |
@@ -277,8 +262,8 @@ test_setup() {
|
|
Harald Hoyer |
d1bf89 |
|
|
Harald Hoyer |
d1bf89 |
kill_server() {
|
|
Harald Hoyer |
d1bf89 |
if [[ -s $TESTDIR/server.pid ]]; then
|
|
Harald Hoyer |
d1bf89 |
- sudo kill -TERM $(cat $TESTDIR/server.pid)
|
|
Harald Hoyer |
d1bf89 |
- rm -f $TESTDIR/server.pid
|
|
Harald Hoyer |
d1bf89 |
+ sudo kill -TERM $(cat $TESTDIR/server.pid)
|
|
Harald Hoyer |
d1bf89 |
+ rm -f $TESTDIR/server.pid
|
|
Harald Hoyer |
d1bf89 |
fi
|
|
Harald Hoyer |
d1bf89 |
}
|
|
Harald Hoyer |
d1bf89 |
|