From cdee504936c3931d56065551a21d45f63f98e61e Mon Sep 17 00:00:00 2001 From: an7s <an7s@git.zephyr-software.com> Date: Sat, 23 Jan 2016 02:53:50 +0000 Subject: [PATCH] Commit du tests Former-commit-id: d4b5766679359dbaa88cf22efe4e00689498584c --- .gitattributes | 7 ++++ tests/du/data/dir1/dir2/readme | 1 + tests/du/data/dir1/hello2 | 1 + tests/du/data/dir1/yo2.xls | 1 + tests/du/data/hello1 | 1 + tests/du/data/test.tar | Bin 0 -> 10240 bytes tests/du/data/yo.txt | 1 + tests/du/test_script.sh | 57 +++++++++++++++++++++++++++++++++ 8 files changed, 69 insertions(+) create mode 100644 tests/du/data/dir1/dir2/readme create mode 100644 tests/du/data/dir1/hello2 create mode 100644 tests/du/data/dir1/yo2.xls create mode 100644 tests/du/data/hello1 create mode 100644 tests/du/data/test.tar create mode 100644 tests/du/data/yo.txt create mode 100755 tests/du/test_script.sh diff --git a/.gitattributes b/.gitattributes index 3425314b0..73bac7568 100644 --- a/.gitattributes +++ b/.gitattributes @@ -135,6 +135,13 @@ tests/bzip2/data/compression_input1 -text tests/bzip2/data/decompression_input1 -text tests/bzip2/test_script.sh -text tests/cal/test_script.sh -text +tests/du/data/dir1/dir2/readme -text +tests/du/data/dir1/hello2 -text +tests/du/data/dir1/yo2.xls -text +tests/du/data/hello1 -text +tests/du/data/test.tar -text +tests/du/data/yo.txt -text +tests/du/test_script.sh -text tests/egrep/data/data1.txt -text tests/egrep/data/data2.txt -text tests/egrep/data/khadafy.lines -text diff --git a/tests/du/data/dir1/dir2/readme b/tests/du/data/dir1/dir2/readme new file mode 100644 index 000000000..8178c76d6 --- /dev/null +++ b/tests/du/data/dir1/dir2/readme @@ -0,0 +1 @@ +readme diff --git a/tests/du/data/dir1/hello2 b/tests/du/data/dir1/hello2 new file mode 100644 index 000000000..14be0d41c --- /dev/null +++ b/tests/du/data/dir1/hello2 @@ -0,0 +1 @@ +hello2 diff --git a/tests/du/data/dir1/yo2.xls b/tests/du/data/dir1/yo2.xls new file mode 100644 index 000000000..55a3a1916 --- /dev/null +++ b/tests/du/data/dir1/yo2.xls @@ -0,0 +1 @@ +23,34,45 diff --git a/tests/du/data/hello1 b/tests/du/data/hello1 new file mode 100644 index 000000000..15b8f2a8f --- /dev/null +++ b/tests/du/data/hello1 @@ -0,0 +1 @@ +hello1 diff --git a/tests/du/data/test.tar b/tests/du/data/test.tar new file mode 100644 index 0000000000000000000000000000000000000000..adf61fcdebfc9c4ae606533f9a505c75b91bc02c GIT binary patch literal 10240 zcmeH|;R=E<6ovP@r`Q8X?cQzfc?5+5OVEOP`!*#K12tq(dF~H4x$bU$XJ^X~HSI*) zP(GZq!Z+kB_1lmNA&66B6f0#}C{j$RkT&kJy6TtaoYhi_?BtrU`KIz?W4}0;2mSqn zBW{8q@O%1`ve5q{yXL8XU1a&Oh%sr<KTS>F_m6WRq<px6|CzNGQpH%zu;$AB->JSC zQo;L52(<pcRlL2Hqu1XO9KqqE{wEsvpNw(v{}SeN$FfeeNsPq_FqhbWeb@SbUzBCV z(SB^w|1bAHX~z8@O^<%zPI|b%&jfuC009sH0T2KI5C8!X009sH0T2KI5C8!X009sH M0T2KI5cp*RccidoE&u=k literal 0 HcmV?d00001 diff --git a/tests/du/data/yo.txt b/tests/du/data/yo.txt new file mode 100644 index 000000000..f2d0f0d5c --- /dev/null +++ b/tests/du/data/yo.txt @@ -0,0 +1 @@ +yo yo yo diff --git a/tests/du/test_script.sh b/tests/du/test_script.sh new file mode 100755 index 000000000..d208e7a10 --- /dev/null +++ b/tests/du/test_script.sh @@ -0,0 +1,57 @@ +#!/bin/bash +#Everyone must point to the manual test library +TEST_LIB=$PEASOUP_HOME/tests/manual_test_lib.sh + + +#for grep, I use some data files, so I set up variables pointing to that location +TEST_DIR=$PEASOUP_HOME/tests/du +DATA_DIR=$TEST_DIR/data + +#used for filtering program names from output. +ORIG_NAME=du + +#must import the library here, as it depends on some of the above variables +. $TEST_LIB + +#run_basic_test will run both the modified program and original program using the same arguments. The first argument ot run_basic_test is the timeout value (in seconds) followed by the arguments for the programs. run_basic_test also does comparisons of stdout, stderr, and the exit status, and only does comparisons and uses timeout when the -i flag is not set. See the library for more details. + +pwd +echo "TEST_PROG: $TEST_PROG" + +run_basic_test 120 --help +run_basic_test 120 --version +run_basic_test 120 --doesnotexist +run_basic_test 120 $DATA_DIR +run_basic_test 120 -0 $DATA_DIR +run_basic_test 120 --null $DATA_DIR +run_basic_test 120 -a $DATA_DIR +run_basic_test 120 --all $DATA_DIR +run_basic_test 120 --all --apparent-size $DATA_DIR +run_basic_test 120 -a -BM $DATA_DIR +run_basic_test 120 -b $DATA_DIR +run_basic_test 120 -c $DATA_DIR +run_basic_test 120 --summarize $DATA_DIR +run_basic_test 120 -bh $DATA_DIR +run_basic_test 120 --all -h $DATA_DIR +run_basic_test 120 -L $DATA_DIR +run_basic_test 120 -l $DATA_DIR +run_basic_test 120 -m $DATA_DIR +run_basic_test 120 -P $DATA_DIR +run_basic_test 120 -S $DATA_DIR +run_basic_test 120 --si $DATA_DIR +run_basic_test 120 -s $DATA_DIR +run_basic_test 120 -t $DATA_DIR +run_basic_test 120 --time $DATA_DIR +run_basic_test 120 --time-style=full-iso $DATA_DIR +run_basic_test 120 --time-style=long-iso $DATA_DIR +run_basic_test 120 --time-style=iso $DATA_DIR +run_basic_test 120 --exclude-from=$DATA_DIR/yo.txt $DATA_DIR +run_basic_test 120 --exclude=foobar $DATA_DIR +run_basic_test 120 --exclude="*.txt" $DATA_DIR +run_basic_test 120 -x $DATA_DIR + + + +cleanup + +report_success -- GitLab