]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test: export initdir
authorHarald Hoyer <harald@redhat.com>
Mon, 9 Jul 2012 13:30:15 +0000 (15:30 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 9 Jul 2012 13:30:15 +0000 (15:30 +0200)
15 files changed:
test/TEST-01-BASIC/test.sh
test/TEST-02-SYSTEMD/test.sh
test/TEST-03-USR-MOUNT/test.sh
test/TEST-10-RAID/test.sh
test/TEST-11-LVM/test.sh
test/TEST-12-RAID-DEG/test.sh
test/TEST-13-ENC-RAID-LVM/test.sh
test/TEST-15-BTRFSRAID/test.sh
test/TEST-16-DMSQUASH/test.sh
test/TEST-20-NFS/test.sh
test/TEST-30-ISCSI/test.sh
test/TEST-40-NBD/test.sh
test/TEST-50-MULTINIC/test.sh
test/old.TEST-14-IMSM/test.sh
test/test-functions

index 35e05bba6ba11ef6a0844d0f0da470a064c3ded9..f8522e6b16c8edfe3fd51e3544638129239e63ad 100755 (executable)
@@ -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
index b535dbed020a33fce21f8630695e49593dc2c63e..5a121c0aeea7f52b12be86a07207686fc0e500e8 100755 (executable)
@@ -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
index d966c3c0ca1e8ebcb1771caeec3faa603cf177ce..f3237d39cf3b2fe42443394e63dde62d70fbd34e 100755 (executable)
@@ -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
index ef6d0c289a6319313624d0554187e0cf7ac1330f..d2b19217c4dfede688d15b86734c41be9e67eedb 100755 (executable)
@@ -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
index 034cc4c0d66b5cb065cd5d78ead9d90bddb7e565..61ebdfab456c0ced044ef10bd0ebbfffcf023291 100755 (executable)
@@ -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
index c6038bd2fef827e457693776710856c6da2dcb8c..05e5f8a2e819e77ff6dfa4110e73fd517d90db16 100755 (executable)
@@ -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
index 658de8ffbd27371090c455c458234403353c3b0e..f0f7d3469bbaf1e90aa7aef02a0741fefa11e5ed 100755 (executable)
@@ -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
index 5918b5ee55c7bd184884086cab3d6847efd0c9dd..61ccae33302d108864e333305e9996b904712227 100755 (executable)
@@ -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
index 5cd9986e48102a5f3702e95ccc56622a8817b6f5..4dc133ceef726bc0f3d23cb2e9a7a425dbbe9c13 100755 (executable)
@@ -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 \
index 57bf5124afd53f64510641a5f02033087563e60b..a44f6c0c448f3fa26bb47f973ddcd8cc7fcacba3 100755 (executable)
@@ -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
index 8c577f0144ed1a518615724560b3d852f56917ce..c5dba809000af2ac71f480bf22170b8ba1cb5255 100755 (executable)
@@ -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";
index f5465b675e4c51ac0b6a6e67a4e0b4dfd7fda3ed..94efb8a5d24c6a291949e39fe319c36b3fd901e4 100755 (executable)
@@ -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
index a96669e37a5074376c39c1b33b1545842fe75199..74f10d88be532383d554016fe01a6460c77a13e8 100755 (executable)
@@ -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
index 5b9438efa6b403fbbe2b73594c396abbee7563f6..cd2d715c3eebc27d33750f59c0ab26c4f9f2d761 100755 (executable)
@@ -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
index 451837f04887f0a7948e3f7be4cfb92b9357b790..10d78ed66c5765a5df09e19b4515407244aab957 100644 (file)
@@ -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