Commit 570274e4 authored by Iustin Pop's avatar Iustin Pop
Browse files

Add more mon-collector shell tests



These test the newly-changed behaviour, and fix an inconsistency in
the hs-check target (versus hs-coverage).
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
parent 638e0a6f
......@@ -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
......
......@@ -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 "$@"
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment