diff --git a/Makefile.am b/Makefile.am index 90ad0ecac0146173bfa86607b384932937f30e48..713abd8e85190e24e33171efa014b60ebb7af3af 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1535,7 +1535,7 @@ check-local: check-dirs $(GENERATED_FILES) .PHONY: hs-check hs-check: htest/test htest/hpc-htools htest/hpc-mon-collector $(HS_BUILT_TEST_HELPERS) - @rm -f test.tix + @rm -f *.tix ./htest/test HBINARY="./htest/hpc-htools" ./htest/offline-test.sh diff --git a/htest/cli-tests-defs.sh b/htest/cli-tests-defs.sh index b12cb853dd517d25f0d18675c850af33f847d5f6..1facff4b808391849efc75b4749e6c550e720611 100644 --- a/htest/cli-tests-defs.sh +++ b/htest/cli-tests-defs.sh @@ -22,6 +22,7 @@ HBINARY=${HBINARY:-./htest/hpc-htools} export TESTDATA_DIR=${TOP_SRCDIR:-.}/htest/data +export PYTESTDATA_DIR=${TOP_SRCDIR:-.}/test/data hbal() { HTOOLS=hbal $HBINARY "$@" diff --git a/htest/shelltests/htools-mon-collector.test b/htest/shelltests/htools-mon-collector.test index 1208dc182179e5d6f420f0f7d13729e6f023133a..de276e168764bdfd4774c891a563572cbd69b0f7 100644 --- a/htest/shelltests/htools-mon-collector.test +++ b/htest/shelltests/htools-mon-collector.test @@ -2,7 +2,27 @@ ./htest/hpc-mon-collector >>>= !0 -# 2. Test that the drbd collector fails parsing /dev/null +# 2. Test that standard options are accepted, both at top level +# and subcommands level +./htest/hpc-mon-collector --help +>>>= 0 + +./htest/hpc-mon-collector --help-completion +>>>= 0 + +./htest/hpc-mon-collector --version +>>>= 0 + +./htest/hpc-mon-collector drbd --help +>>>= 0 + +./htest/hpc-mon-collector drbd --help-completion +>>>= 0 + +./htest/hpc-mon-collector drbd --version +>>>= 0 + +# 3. Test that the drbd collector fails parsing /dev/null ./htest/hpc-mon-collector drbd /dev/null >>>2 Error: "" @@ -10,7 +30,21 @@ Error: "" Failed reading: versionInfo >>>= !0 -# 3. Test that the drbd collector fails parsing /dev/zero, but is not +# 4. Test that a non-existent file is correctly reported +./htest/hpc-mon-collector drbd /dev/no-such-file +>>>2/Error: reading from file: .* does not exist/ +>>>= !0 + +# 5. Test that multiple files are rejected +./htest/hpc-mon-collector drbd /dev/null /dev/null +>>>2/takes only one argument/ +>>>= !0 + +# 6. Test that a standard test file is parsed correctly +./htest/hpc-mon-collector drbd $PYTESTDATA_DIR/proc_drbd83.txt +>>>=0 + +# 7. Test that the drbd collector fails parsing /dev/zero, but is not # stuck forever printing \NUL chars ./htest/hpc-mon-collector drbd /dev/zero >>>2