From: Harald Hoyer Date: Fri, 20 Jul 2012 09:20:12 +0000 (+0200) Subject: testsuite: fixups and color X-Git-Tag: 021~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0af318a8d4ec16fec401e563b56b74c6a8c6253;p=platform%2Fupstream%2Fdracut.git testsuite: fixups and color --- diff --git a/test/TEST-12-RAID-DEG/test.sh b/test/TEST-12-RAID-DEG/test.sh index 05e5f8a..96c84f8 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 c5dba80..1b1924b 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 968551f..13e23b2 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;;