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]"
-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]"
:
}
+# 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)
--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
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;;