ctdb-tests: Move tool tests to UNIT/ subdirectory
[samba.git] / ctdb / tests / UNIT / tool / ctdb.uptime.001.sh
1 #!/bin/sh
2
3 . "${TEST_SCRIPTS_DIR}/unit.sh"
4
5 define_test "simple ping"
6
7 setup_ctdbd <<EOF
8 NODEMAP
9 0       192.168.20.41   0x0     CURRENT RECMASTER
10 1       192.168.20.42   0x0
11 2       192.168.20.43   0x0
12 EOF
13
14 result_filter ()
15 {
16         _weekday="[A-Z][a-z][a-z]"
17         _month="[A-Z][a-z][a-z]"
18         _date="[0-9][0-9]*"
19         _time="[0-9][0-9]:[0-9][0-9]:[0-9][0-9]"
20         _year="[0-9][0-9]*"
21         _date_time="${_weekday} ${_month}  *${_date} ${_time} ${_year}"
22         _duration="(000 00:00:[0-9][0-9])"
23         sed -e "s|${_date_time}\$|DATE/TIME|" \
24             -e "s|[.0-9]* seconds|SEC seconds|" \
25             -e "s|${_duration}|(DURATION)|"
26 }
27
28
29 ok <<EOF
30 Current time of node 0        :                DATE/TIME
31 Ctdbd start time              : (DURATION) DATE/TIME
32 Time of last recovery/failover: (DURATION) DATE/TIME
33 Duration of last recovery/failover: SEC seconds
34 EOF
35
36 simple_test