test: export initdir
parent
3c1feedfd1
commit
27fa604418
|
@ -27,7 +27,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
mkdir -p $initdir
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||
|
@ -49,7 +49,7 @@ test_setup() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sfdisk mkfs.ext3 poweroff cp umount sync
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -77,7 +77,7 @@ test_setup() {
|
|||
|
||||
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -23,7 +23,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
mkdir -p $initdir
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||
|
@ -45,7 +45,7 @@ test_setup() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sfdisk mkfs.ext3 poweroff cp umount
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -73,7 +73,7 @@ test_setup() {
|
|||
|
||||
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -54,7 +54,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
mkdir -p $initdir
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||
|
@ -77,7 +77,7 @@ test_setup() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sfdisk mkfs.btrfs btrfs poweroff cp umount sync
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -112,7 +112,7 @@ test_setup() {
|
|||
|
||||
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -25,7 +25,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
(mkdir -p "$initdir"; cd "$initdir"; mkdir -p dev sys proc etc var/run tmp run)
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||
|
@ -46,7 +46,7 @@ test_setup() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sfdisk mke2fs poweroff cp umount
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -72,7 +72,7 @@ test_setup() {
|
|||
grep -m 1 -q dracut-root-block-created $DISKIMAGE || return 1
|
||||
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -23,7 +23,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||
mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
||||
|
@ -44,7 +44,7 @@ test_setup() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sfdisk mke2fs poweroff cp umount
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -66,7 +66,7 @@ test_setup() {
|
|||
-initrd $TESTDIR/initramfs.makeroot || return 1
|
||||
grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -58,7 +58,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||
mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
||||
|
@ -78,7 +78,7 @@ test_setup() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sfdisk mke2fs poweroff cp umount dd grep
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -106,7 +106,7 @@ test_setup() {
|
|||
grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1
|
||||
eval $(grep --binary-files=text -m 1 MD_UUID $TESTDIR/root.ext2)
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -59,7 +59,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||
mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
||||
|
@ -79,7 +79,7 @@ test_setup() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sfdisk mke2fs poweroff cp umount grep
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -108,7 +108,7 @@ test_setup() {
|
|||
|
||||
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -25,7 +25,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||
mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
||||
|
@ -45,7 +45,7 @@ test_setup() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sfdisk mkfs.btrfs poweroff cp umount
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -74,7 +74,7 @@ test_setup() {
|
|||
grep -m 1 -q dracut-root-block-created $DISKIMAGE || return 1
|
||||
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -29,7 +29,7 @@ test_run() {
|
|||
test_setup() {
|
||||
mkdir -p $TESTDIR/overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
@ -47,7 +47,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/root-source
|
||||
export initdir=$TESTDIR/root-source
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||
mount dmesg ifconfig dhclient mkdir cp ping dhclient \
|
||||
|
|
|
@ -217,7 +217,7 @@ test_setup() {
|
|||
# Detect lib paths
|
||||
|
||||
(
|
||||
initdir=$TESTDIR/mnt
|
||||
export initdir=$TESTDIR/mnt
|
||||
. $basedir/dracut-functions.sh
|
||||
|
||||
for _f in modules.builtin.bin modules.builtin; do
|
||||
|
@ -282,7 +282,7 @@ test_setup() {
|
|||
|
||||
# Make client root inside server root
|
||||
(
|
||||
initdir=$TESTDIR/mnt/nfs/client
|
||||
export initdir=$TESTDIR/mnt/nfs/client
|
||||
. $basedir/dracut-functions.sh
|
||||
|
||||
dracut_install sh shutdown poweroff stty cat ps ln ip \
|
||||
|
@ -325,7 +325,7 @@ test_setup() {
|
|||
|
||||
# Make an overlay with needed tools for the test harness
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
mkdir $TESTDIR/overlay
|
||||
dracut_install poweroff shutdown
|
||||
|
|
|
@ -102,7 +102,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh shutdown poweroff stty cat ps ln ip \
|
||||
mount dmesg mkdir cp ping grep
|
||||
|
@ -118,7 +118,7 @@ test_setup() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sfdisk mkfs.ext3 poweroff cp umount
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -153,7 +153,7 @@ test_setup() {
|
|||
grep -m 1 -q dracut-root-block-created $TESTDIR/client.img || return 1
|
||||
rm $TESTDIR/client.img
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
@ -173,7 +173,7 @@ test_setup() {
|
|||
|
||||
kernel=$KVERSION
|
||||
(
|
||||
initdir=$TESTDIR/mnt
|
||||
export initdir=$TESTDIR/mnt
|
||||
. $basedir/dracut-functions.sh
|
||||
(
|
||||
cd "$initdir";
|
||||
|
|
|
@ -190,7 +190,7 @@ make_encrypted_root() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
. $basedir/dracut-functions.sh
|
||||
mkdir -p "$initdir"
|
||||
(cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
|
||||
|
@ -208,7 +208,7 @@ make_encrypted_root() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install mke2fs poweroff cp umount tune2fs
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -244,7 +244,7 @@ make_client_root() {
|
|||
|
||||
kernel=$KVERSION
|
||||
(
|
||||
initdir=$TESTDIR/mnt
|
||||
export initdir=$TESTDIR/mnt
|
||||
. $basedir/dracut-functions.sh
|
||||
mkdir -p "$initdir"
|
||||
(cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
|
||||
|
@ -278,7 +278,7 @@ make_server_root() {
|
|||
|
||||
kernel=$KVERSION
|
||||
(
|
||||
initdir=$TESTDIR/mnt
|
||||
export initdir=$TESTDIR/mnt
|
||||
. $basedir/dracut-functions.sh
|
||||
mkdir -p "$initdir"
|
||||
(
|
||||
|
@ -323,7 +323,7 @@ test_setup() {
|
|||
|
||||
# Make the test image
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -132,7 +132,7 @@ test_setup() {
|
|||
sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
|
||||
|
||||
(
|
||||
initdir=$TESTDIR/mnt
|
||||
export initdir=$TESTDIR/mnt
|
||||
. $basedir/dracut-functions.sh
|
||||
|
||||
(
|
||||
|
@ -197,7 +197,7 @@ test_setup() {
|
|||
|
||||
# Make client root inside server root
|
||||
(
|
||||
initdir=$TESTDIR/mnt/nfs/client
|
||||
export initdir=$TESTDIR/mnt/nfs/client
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh shutdown poweroff stty cat ps ln ip \
|
||||
mount dmesg mkdir cp ping grep ls
|
||||
|
@ -236,7 +236,7 @@ test_setup() {
|
|||
|
||||
# Make an overlay with needed tools for the test harness
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -57,7 +57,7 @@ test_setup() {
|
|||
kernel=$KVERSION
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
initdir=$TESTDIR/overlay/source
|
||||
export initdir=$TESTDIR/overlay/source
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||
mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
||||
|
@ -78,7 +78,7 @@ test_setup() {
|
|||
|
||||
# second, install the files needed to make the root filesystem
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install sfdisk mke2fs poweroff cp umount
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
|
@ -104,7 +104,7 @@ test_setup() {
|
|||
-initrd $TESTDIR/initramfs.makeroot || return 1
|
||||
grep -m 1 -q dracut-root-block-created $TESTDIR/root.ext2 || return 1
|
||||
(
|
||||
initdir=$TESTDIR/overlay
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
dracut_install poweroff shutdown
|
||||
inst_hook emergency 000 ./hard-off.sh
|
||||
|
|
|
@ -6,7 +6,7 @@ export PATH
|
|||
|
||||
[[ -e .testdir ]] && . .testdir
|
||||
if [[ -z "$TESTDIR" ]] || [[ ! -d "$TESTDIR" ]]; then
|
||||
TESTDIR=$(mktemp -d -t dracut-test.XXXXXX)
|
||||
TESTDIR=$(mktemp -d --tmpdir="/var/tmp" -t dracut-test.XXXXXX)
|
||||
fi
|
||||
echo "TESTDIR=\"$TESTDIR\"" > .testdir
|
||||
export TESTDIR
|
||||
|
|
Loading…
Reference in New Issue