summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2012-07-20 11:20:12 +0200
committerHarald Hoyer <harald@redhat.com>2012-07-20 11:20:12 +0200
commita0af318a8d4ec16fec401e563b56b74c6a8c6253 (patch)
treebeea39361751436b89ea2a668078cd5af3e099da /test
parentc008b0ce102c63c1c94486b072397ee69612736d (diff)
downloaddracut-a0af318a8d4ec16fec401e563b56b74c6a8c6253.tar.gz
dracut-a0af318a8d4ec16fec401e563b56b74c6a8c6253.tar.bz2
dracut-a0af318a8d4ec16fec401e563b56b74c6a8c6253.zip
testsuite: fixups and color
Diffstat (limited to 'test')
-rwxr-xr-xtest/TEST-12-RAID-DEG/test.sh6
-rwxr-xr-xtest/TEST-30-ISCSI/test.sh2
-rw-r--r--test/test-functions16
3 files changed, 20 insertions, 4 deletions
diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh
index 05e5f8a2..96c84f80 100755
--- a/test/TEST-12-RAID-DEG/test.sh
+++ b/test/TEST-12-RAID-DEG/test.sh
@@ -9,15 +9,15 @@ KVERSION=${KVERSION-$(uname -r)}
client_run() {
echo "CLIENT TEST START: $@"
- cp --sparse=always $TESTDIR/disk2.img $TESTDIR/disk2.img.new
- cp --sparse=always $TESTDIR/disk3.img $TESTDIR/disk3.img.new
+ cp --sparse=always --reflink=auto $TESTDIR/disk2.img $TESTDIR/disk2.img.new
+ cp --sparse=always --reflink=auto $TESTDIR/disk3.img $TESTDIR/disk3.img.new
$testdir/run-qemu \
-hda $TESTDIR/root.ext2 -m 256M -nographic \
-hdc $TESTDIR/disk2.img.new \
-hdd $TESTDIR/disk3.img.new \
-net none -kernel /boot/vmlinuz-$KVERSION \
- -append "$@ root=LABEL=root rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL " \
+ -append "$* root=LABEL=root rw quiet rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL " \
-initrd $TESTDIR/initramfs.testing
if ! grep -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then
echo "CLIENT TEST END: $@ [FAIL]"
diff --git a/test/TEST-30-ISCSI/test.sh b/test/TEST-30-ISCSI/test.sh
index c5dba809..1b1924ba 100755
--- a/test/TEST-30-ISCSI/test.sh
+++ b/test/TEST-30-ISCSI/test.sh
@@ -45,7 +45,7 @@ run_client() {
-net nic,macaddr=52:54:00:12:34:00,model=e1000 \
-net socket,connect=127.0.0.1:12330 \
-kernel /boot/vmlinuz-$KVERSION \
- -append "$@ rw quiet rd.retry=5 rd.debug rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \
+ -append "$* rw quiet rd.retry=5 rd.debug rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \
-initrd $TESTDIR/initramfs.testing
if ! grep -m 1 -q iscsi-OK $TESTDIR/client.img; then
echo "CLIENT TEST END: $test_name [FAILED - BAD EXIT]"
diff --git a/test/test-functions b/test/test-functions
index 968551f6..13e23b22 100644
--- a/test/test-functions
+++ b/test/test-functions
@@ -15,6 +15,16 @@ command -v test_check &>/dev/null || test_check() {
:
}
+# terminal sequence to set color to a 'success' color (currently: green)
+function SETCOLOR_SUCCESS() { echo -en '\033[0;32m'; }
+# terminal sequence to set color to a 'failure' color (currently: red)
+function SETCOLOR_FAILURE() { echo -en '\033[0;31m'; }
+# terminal sequence to set color to a 'warning' color (currently: yellow)
+function SETCOLOR_WARNING() { echo -en '\033[0;33m'; }
+# terminal sequence to reset to the default color.
+function SETCOLOR_NORMAL() { echo -en '\033[0;39m'; }
+
+
while (($# > 0)); do
case $1 in
--run)
@@ -34,7 +44,9 @@ while (($# > 0)); do
--all)
echo -n "TEST: $TEST_DESCRIPTION ";
if ! test_check 2&>test.log ; then
+ SETCOLOR_WARNING
echo "[SKIPPED]"
+ SETCOLOR_NORMAL
exit 0;
fi
if [ "$V" != "1" ]; then
@@ -61,9 +73,13 @@ while (($# > 0)); do
set +o pipefail
if [ $ret -eq 0 ]; then
rm test.log
+ SETCOLOR_SUCCESS
echo "[OK]"
+ SETCOLOR_NORMAL
else
+ SETCOLOR_FAILURE
echo "[FAILED]"
+ SETCOLOR_NORMAL
echo "see $(pwd)/test.log"
fi
exit $ret;;