Revision c7f116c0 test/hs/shelltests/htools-mon-collector.test

b/test/hs/shelltests/htools-mon-collector.test
1
# 1. Test that mon-collector won't run without specifying a personality
1
# Test that mon-collector won't run without specifying a personality
2 2
./test/hs/hpc-mon-collector
3 3
>>>= !0
4 4

  
5
# 2. Test that standard options are accepted, both at top level
5
# Test that standard options are accepted, both at top level
6 6
# and subcommands level
7 7
./test/hs/hpc-mon-collector --help
8 8
>>>= 0
......
22 22
./test/hs/hpc-mon-collector drbd --version
23 23
>>>= 0
24 24

  
25
# 3. Test that the drbd collector fails parsing /dev/null
25
# Test that the drbd collector fails parsing /dev/null
26 26
./test/hs/hpc-mon-collector drbd --drbd-status=/dev/null --drbd-pairing=/dev/null
27 27
>>>2/Malformed JSON/
28 28
>>>= !0
29 29

  
30
# 4. Test that a non-existent file is correctly reported
30
# Test that a non-existent file is correctly reported
31 31
./test/hs/hpc-mon-collector drbd --drbd-status=/dev/no-such-file --drbd-pairing=/dev/no-such-file
32 32
>>>2/Error: reading from file: .* does not exist/
33 33
>>>= !0
34 34

  
35
# 5. Test that arguments are rejected
35
# Test that arguments are rejected
36 36
./test/hs/hpc-mon-collector drbd /dev/null
37 37
>>>2/takes exactly zero arguments/
38 38
>>>= !0
39 39

  
40
# 6. Test that a standard test file is parsed correctly
40
# Test that a standard test file is parsed correctly
41 41
./test/hs/hpc-mon-collector drbd --drbd-status=$PYTESTDATA_DIR/proc_drbd83.txt --drbd-pairing=$PYTESTDATA_DIR/instance-minor-pairing.txt
42 42
>>>=0
43 43

  
44
# 7. Test that the drbd collector fails parsing /dev/zero, but is not
44
# Test that the drbd collector fails parsing /dev/zero, but is not
45 45
# stuck forever printing \NUL chars
46 46
./test/hs/hpc-mon-collector drbd --drbd-status=/dev/zero --drbd-pairing=$PYTESTDATA_DIR/instance-minor-pairing.txt
47 47
>>>2
......
78 78
# Test that a standard test file is parsed correctly
79 79
./test/hs/hpc-mon-collector diskstats -f $PYTESTDATA_DIR/proc_diskstats.txt
80 80
>>>=0
81

  
82
# Tests for lv
83
./test/hs/hpc-mon-collector lv --help
84
>>>= 0
85

  
86
./test/hs/hpc-mon-collector lv --help-completion
87
>>>= 0
88

  
89
./test/hs/hpc-mon-collector lv --version
90
>>>= 0
91

  
92
# Test that the lv collector fails parsing a non-lv data
93
./test/hs/hpc-mon-collector lv -f $PYTESTDATA_DIR/proc_diskstats.txt
94
>>>= !0
95

  
96
# Test that lv correctly reports a non-existent file
97
./test/hs/hpc-mon-collector lv --file=/proc/no-such-file
98
>>>2/Error: reading from file: .* does not exist/
99
>>>= !0
100

  
101
# Test that lv rejects arguments
102
./test/hs/hpc-mon-collector lv /dev/null
103
>>>2/takes exactly zero arguments/
104
>>>= !0
105

  
106
# Test that lv parses correctly a standard test file
107
./test/hs/hpc-mon-collector lv -f $PYTESTDATA_DIR/lvs_lv.txt
108
>>>= 0

Also available in: Unified diff