diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2012-04-18 13:48:43 +1000 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2012-04-18 13:48:43 +1000 |
commit | 618d247420a36bf6d0a0026e85b77205ed122657 (patch) | |
tree | d9f012301156901cc1fff641a37d49938093f502 | |
parent | b3d098ced7c1f334e3fcdc61f9a47f15149681c5 (diff) | |
parent | 116f19b808ace4a74bcf56a638923dcd1e1e975d (diff) | |
download | samba-618d247420a36bf6d0a0026e85b77205ed122657.tar.gz samba-618d247420a36bf6d0a0026e85b77205ed122657.tar.xz samba-618d247420a36bf6d0a0026e85b77205ed122657.zip |
Merge remote branch 'martins/master'
(This used to be ctdb commit abe7ebe6c531f912efe4ebc1daade4d2af67574c)
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.init.001.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.init.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.init.002.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.init.002.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.001.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.002.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.002.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.003.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.003.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.004.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.004.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.005.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.005.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.006.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.006.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.007.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.007.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.008.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.008.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.009.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.009.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.010.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.010.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.011.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.011.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.012.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.012.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.013.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.013.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.014.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.014.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.monitor.015.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.monitor.015.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.multi.001.sh (renamed from ctdb/tests/eventscripts/multievent/10.interface.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.releaseip.001.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.releaseip.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.releaseip.002.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.releaseip.002.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.startup.001.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.startup.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.startup.002.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.startup.002.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.takeip.001.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.takeip.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.takeip.002.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.takeip.002.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/10.interface.takeip.003.sh (renamed from ctdb/tests/eventscripts/simple/10.interface.takeip.003.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.001.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.002.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.002.sh) | 4 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.003.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.003.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.004.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.004.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.005.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.005.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.006.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.006.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.007.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.007.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.008.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.008.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.009.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.009.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.010.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.010.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.011.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.011.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/13.per_ip_routing.012.sh (renamed from ctdb/tests/eventscripts/multievent/13.per_ip_routing.012.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/40.vsftpd.monitor.001.sh (renamed from ctdb/tests/eventscripts/simple/40.vsftpd.monitor.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/41.httpd.monitor.001.sh (renamed from ctdb/tests/eventscripts/simple/41.httpd.monitor.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.001.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.050.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.050.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.051.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.051.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.101.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.101.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.102.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.102.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.103.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.103.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.104.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.104.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.105.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.105.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.106.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.106.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.107.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.107.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.108.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.108.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.109.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.109.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.110.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.110.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/50.samba.monitor.111.sh (renamed from ctdb/tests/eventscripts/simple/50.samba.monitor.111.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.001.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.100.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.100.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.101.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.101.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.111.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.111.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.112.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.112.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.121.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.121.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.122.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.122.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.131.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.131.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.132.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.132.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.141.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.141.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.142.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.142.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.151.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.151.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.152.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.152.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.153.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.153.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.161.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.161.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.monitor.162.sh (renamed from ctdb/tests/eventscripts/simple/60.nfs.monitor.162.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.multi.001.sh (renamed from ctdb/tests/eventscripts/multievent/60.nfs.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.multi.002.sh (renamed from ctdb/tests/eventscripts/multievent/60.nfs.002.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.multi.003.sh (renamed from ctdb/tests/eventscripts/multievent/60.nfs.003.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.multi.004.sh (renamed from ctdb/tests/eventscripts/multievent/60.nfs.004.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.multi.005.sh (renamed from ctdb/tests/eventscripts/multievent/60.nfs.005.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.nfs.multi.006.sh (renamed from ctdb/tests/eventscripts/multievent/60.nfs.006.sh) | 2 | ||||
l--------- | ctdb/tests/eventscripts/etc-ctdb/interface_modify.sh | 1 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/run_tests.sh | 53 | ||||
-rw-r--r-- | ctdb/tests/eventscripts/scripts/local.sh (renamed from ctdb/tests/eventscripts/common.sh) | 181 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/stubs/ctdb | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0001.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0002.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0003.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0004.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0005.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0006.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0070.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0071.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0072.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0075.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0080.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0081.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0090.sh | 2 | ||||
-rwxr-xr-x | ctdb/tests/onnode/0091.sh | 2 | ||||
-rw-r--r-- | ctdb/tests/onnode/common.sh | 103 | ||||
-rwxr-xr-x | ctdb/tests/onnode/run_tests.sh | 31 | ||||
-rw-r--r-- | ctdb/tests/onnode/scripts/local.sh | 81 | ||||
-rw-r--r-- | ctdb/tests/scripts/common.sh | 9 | ||||
-rwxr-xr-x | ctdb/tests/scripts/ctdb_test_env | 8 | ||||
-rw-r--r-- | ctdb/tests/scripts/ctdb_test_functions.bash | 64 | ||||
-rwxr-xr-x | ctdb/tests/scripts/run_tests | 117 | ||||
-rw-r--r-- | ctdb/tests/scripts/unit.sh | 141 | ||||
-rwxr-xr-x | ctdb/tests/simple/00_ctdb_onnode.sh | 2 | ||||
-rw-r--r-- | ctdb/tests/takeover/common.sh | 70 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.001.sh (renamed from ctdb/tests/takeover/testcases/lcp2.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.002.sh (renamed from ctdb/tests/takeover/testcases/lcp2.002.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.003.sh (renamed from ctdb/tests/takeover/testcases/lcp2.003.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.004.sh (renamed from ctdb/tests/takeover/testcases/lcp2.004.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.005.sh (renamed from ctdb/tests/takeover/testcases/lcp2.005.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.006.sh (renamed from ctdb/tests/takeover/testcases/lcp2.006.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.007.sh (renamed from ctdb/tests/takeover/testcases/lcp2.007.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.008.sh (renamed from ctdb/tests/takeover/testcases/lcp2.008.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.009.sh (renamed from ctdb/tests/takeover/testcases/lcp2.009.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.010.sh (renamed from ctdb/tests/takeover/testcases/lcp2.010.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.011.sh | 45 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.012.sh | 31 | ||||
-rwxr-xr-x | ctdb/tests/takeover/lcp2.013.sh | 31 | ||||
-rwxr-xr-x | ctdb/tests/takeover/nondet.001.sh (renamed from ctdb/tests/takeover/testcases/nondet.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/nondet.002.sh (renamed from ctdb/tests/takeover/testcases/nondet.002.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/nondet.003.sh (renamed from ctdb/tests/takeover/testcases/nondet.003.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/run_tests.sh | 31 | ||||
-rw-r--r-- | ctdb/tests/takeover/scripts/local.sh | 36 | ||||
-rw-r--r-- | ctdb/tests/takeover/simulation/README (renamed from ctdb/tests/takeover/README) | 0 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/ctdb_takeover.py (renamed from ctdb/tests/takeover/ctdb_takeover.py) | 2 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/hey_jude.py | 24 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/ip_groups1.py (renamed from ctdb/tests/takeover/ip_groups1.py) | 0 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/ip_groups2.py (renamed from ctdb/tests/takeover/ip_groups2.py) | 0 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/ip_groups3.py (renamed from ctdb/tests/takeover/ip_groups3.py) | 0 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/ip_groups4.py (renamed from ctdb/tests/takeover/ip_groups4.py) | 0 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/ip_groups5.py (renamed from ctdb/tests/takeover/ip_groups5.py) | 0 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/mgmt_simple.py (renamed from ctdb/tests/takeover/mgmt_simple.py) | 0 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/node_group.py (renamed from ctdb/tests/takeover/node_group.py) | 0 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/node_group_extra.py (renamed from ctdb/tests/takeover/node_group_extra.py) | 0 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/node_group_simple.py (renamed from ctdb/tests/takeover/node_group_simple.py) | 0 | ||||
-rwxr-xr-x | ctdb/tests/takeover/simulation/nondet_path_01.py (renamed from ctdb/tests/takeover/nondet_path_01.py) | 0 | ||||
-rw-r--r-- | ctdb/tests/tool/common.sh | 79 | ||||
-rwxr-xr-x | ctdb/tests/tool/func.parse_nodestring.001.sh (renamed from ctdb/tests/tool/testcases/func.parse_nodestring.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/tool/func.parse_nodestring.002.sh (renamed from ctdb/tests/tool/testcases/func.parse_nodestring.002.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/tool/func.parse_nodestring.003.sh (renamed from ctdb/tests/tool/testcases/func.parse_nodestring.003.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/tool/run_tests.sh | 35 | ||||
-rw-r--r-- | ctdb/tests/tool/scripts/local.sh | 38 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.nodestatus.001.sh (renamed from ctdb/tests/tool/testcases/stubby.nodestatus.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.nodestatus.002.sh (renamed from ctdb/tests/tool/testcases/stubby.nodestatus.002.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.nodestatus.003.sh (renamed from ctdb/tests/tool/testcases/stubby.nodestatus.003.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.nodestatus.004.sh (renamed from ctdb/tests/tool/testcases/stubby.nodestatus.004.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.nodestatus.005.sh | 34 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.status.001.sh (renamed from ctdb/tests/tool/testcases/stubby.status.001.sh) | 2 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.status.002.sh (renamed from ctdb/tests/tool/testcases/stubby.status.002.sh) | 2 |
147 files changed, 722 insertions, 751 deletions
diff --git a/ctdb/tests/eventscripts/simple/10.interface.init.001.sh b/ctdb/tests/eventscripts/10.interface.init.001.sh index 5a61ab3efd..fae1a78d50 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.init.001.sh +++ b/ctdb/tests/eventscripts/10.interface.init.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "no public addresses" diff --git a/ctdb/tests/eventscripts/simple/10.interface.init.002.sh b/ctdb/tests/eventscripts/10.interface.init.002.sh index 43bacd5231..ba33f927c3 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.init.002.sh +++ b/ctdb/tests/eventscripts/10.interface.init.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all interfaces up" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.001.sh b/ctdb/tests/eventscripts/10.interface.monitor.001.sh index 411355f105..42ef42d81b 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.001.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "no public addresses" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.002.sh b/ctdb/tests/eventscripts/10.interface.monitor.002.sh index 43bacd5231..ba33f927c3 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.002.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all interfaces up" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.003.sh b/ctdb/tests/eventscripts/10.interface.monitor.003.sh index 5dd432816b..1eb7916b93 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.003.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.003.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "1 interface down" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.004.sh b/ctdb/tests/eventscripts/10.interface.monitor.004.sh index d215c40019..69ffbd00cd 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.004.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.004.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all interfaces up, 1 is a bond" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.005.sh b/ctdb/tests/eventscripts/10.interface.monitor.005.sh index 00db01fe63..8cf7bbc9c0 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.005.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.005.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "1 bond, no active slaves" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.006.sh b/ctdb/tests/eventscripts/10.interface.monitor.006.sh index 862a972373..3c483a3516 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.006.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.006.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "1 bond, active slaves, link down" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.007.sh b/ctdb/tests/eventscripts/10.interface.monitor.007.sh index 004247ef67..c45900e3b2 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.007.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.007.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "unknown interface, up" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.008.sh b/ctdb/tests/eventscripts/10.interface.monitor.008.sh index aa59151c2a..f73302b30d 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.008.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.008.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "unknown interface, down, up" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.009.sh b/ctdb/tests/eventscripts/10.interface.monitor.009.sh index ab890f3442..1b785ffdc8 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.009.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.009.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "CTDB_PARTIALLY_ONLINE_INTERFACES, 1 down" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.010.sh b/ctdb/tests/eventscripts/10.interface.monitor.010.sh index 476d2c9f69..4d233193fb 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.010.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.010.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "CTDB_PARTIALLY_ONLINE_INTERFACES, all down" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.011.sh b/ctdb/tests/eventscripts/10.interface.monitor.011.sh index 3e5ba34ace..21775d41ce 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.011.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.011.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "CTDB_PARTIALLY_ONLINE_INTERFACES, 1 bond down" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.012.sh b/ctdb/tests/eventscripts/10.interface.monitor.012.sh index d27c423e44..dbe84b7729 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.012.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.012.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "CTDB_PARTIALLY_ONLINE_INTERFACES, 1 bond down" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.013.sh b/ctdb/tests/eventscripts/10.interface.monitor.013.sh index 88e884dc84..0fcdcd8d15 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.013.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.013.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "1 bond, active slaves, link down" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.014.sh b/ctdb/tests/eventscripts/10.interface.monitor.014.sh index 97cf253c3b..ab23d307c2 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.014.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.014.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "spurious addresses on interface, no action" diff --git a/ctdb/tests/eventscripts/simple/10.interface.monitor.015.sh b/ctdb/tests/eventscripts/10.interface.monitor.015.sh index 6810733b54..ff54b69d9b 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.monitor.015.sh +++ b/ctdb/tests/eventscripts/10.interface.monitor.015.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "spurious addresses on interface, delete them" diff --git a/ctdb/tests/eventscripts/multievent/10.interface.001.sh b/ctdb/tests/eventscripts/10.interface.multi.001.sh index 5ef254c536..da8dcf188d 100755 --- a/ctdb/tests/eventscripts/multievent/10.interface.001.sh +++ b/ctdb/tests/eventscripts/10.interface.multi.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "takeip, removeip" diff --git a/ctdb/tests/eventscripts/simple/10.interface.releaseip.001.sh b/ctdb/tests/eventscripts/10.interface.releaseip.001.sh index cd38cff67c..934b3dc30e 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.releaseip.001.sh +++ b/ctdb/tests/eventscripts/10.interface.releaseip.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "error - no args given" diff --git a/ctdb/tests/eventscripts/simple/10.interface.releaseip.002.sh b/ctdb/tests/eventscripts/10.interface.releaseip.002.sh index d08d27c7e0..9bcb7f11d6 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.releaseip.002.sh +++ b/ctdb/tests/eventscripts/10.interface.releaseip.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "error - remove a non-existent ip" diff --git a/ctdb/tests/eventscripts/simple/10.interface.startup.001.sh b/ctdb/tests/eventscripts/10.interface.startup.001.sh index 411355f105..42ef42d81b 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.startup.001.sh +++ b/ctdb/tests/eventscripts/10.interface.startup.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "no public addresses" diff --git a/ctdb/tests/eventscripts/simple/10.interface.startup.002.sh b/ctdb/tests/eventscripts/10.interface.startup.002.sh index 43bacd5231..ba33f927c3 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.startup.002.sh +++ b/ctdb/tests/eventscripts/10.interface.startup.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all interfaces up" diff --git a/ctdb/tests/eventscripts/simple/10.interface.takeip.001.sh b/ctdb/tests/eventscripts/10.interface.takeip.001.sh index cd38cff67c..934b3dc30e 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.takeip.001.sh +++ b/ctdb/tests/eventscripts/10.interface.takeip.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "error - no args given" diff --git a/ctdb/tests/eventscripts/simple/10.interface.takeip.002.sh b/ctdb/tests/eventscripts/10.interface.takeip.002.sh index 9ee361a326..8960b08997 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.takeip.002.sh +++ b/ctdb/tests/eventscripts/10.interface.takeip.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "add an ip" diff --git a/ctdb/tests/eventscripts/simple/10.interface.takeip.003.sh b/ctdb/tests/eventscripts/10.interface.takeip.003.sh index ce78be90b0..203cff05be 100755 --- a/ctdb/tests/eventscripts/simple/10.interface.takeip.003.sh +++ b/ctdb/tests/eventscripts/10.interface.takeip.003.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "error - add same IP twice" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.001.sh b/ctdb/tests/eventscripts/13.per_ip_routing.001.sh index 0bcf8e3055..3d22864edf 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.001.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "not configured" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.002.sh b/ctdb/tests/eventscripts/13.per_ip_routing.002.sh index 9a32df09f1..3198ef36ed 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.002.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "missing config, no takeip, ipreallocated" @@ -8,7 +8,7 @@ setup_ctdb setup_ctdb_policy_routing required_result 1 <<EOF -error: CTDB_PER_IP_ROUTING_CONF=/home/martins/samba/ctdb/tests/eventscripts/etc-ctdb/policy_routing file not found +error: CTDB_PER_IP_ROUTING_CONF=${TEST_SUBDIR}/etc-ctdb/policy_routing file not found EOF simple_test_event "ipreallocated" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.003.sh b/ctdb/tests/eventscripts/13.per_ip_routing.003.sh index 832101f91d..c1e0d01294 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.003.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.003.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "empty config, ipreallocated" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.004.sh b/ctdb/tests/eventscripts/13.per_ip_routing.004.sh index 49d2b4efa1..88ffac369c 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.004.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.004.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "empty config, takeip" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.005.sh b/ctdb/tests/eventscripts/13.per_ip_routing.005.sh index 3ebacbedbb..822f39f044 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.005.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.005.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "1 IP configured, takeip" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.006.sh b/ctdb/tests/eventscripts/13.per_ip_routing.006.sh index d458556372..ed9df846fe 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.006.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.006.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "1 IP configured, takeip, releaseip" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.007.sh b/ctdb/tests/eventscripts/13.per_ip_routing.007.sh index 53e9d3866a..f7332ac50b 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.007.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.007.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "1 IP configured, ipreallocated" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.008.sh b/ctdb/tests/eventscripts/13.per_ip_routing.008.sh index 282ec07364..db37cbb241 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.008.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.008.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "1 IP configured, takeip twice" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.009.sh b/ctdb/tests/eventscripts/13.per_ip_routing.009.sh index 771651e94a..3e33e903c2 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.009.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.009.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "All IPs configured, takeip" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.010.sh b/ctdb/tests/eventscripts/13.per_ip_routing.010.sh index f7caf1c98d..4704b9f04c 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.010.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.010.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "All IPs configured, takeip all on node" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.011.sh b/ctdb/tests/eventscripts/13.per_ip_routing.011.sh index 18b51d4b78..65adbb5d5a 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.011.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.011.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "__auto_link_local__, takeip all on node" diff --git a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.012.sh b/ctdb/tests/eventscripts/13.per_ip_routing.012.sh index c2720646d6..198551f877 100755 --- a/ctdb/tests/eventscripts/multievent/13.per_ip_routing.012.sh +++ b/ctdb/tests/eventscripts/13.per_ip_routing.012.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "1 IP configured, takeip, releaseip, ipreallocated" diff --git a/ctdb/tests/eventscripts/simple/40.vsftpd.monitor.001.sh b/ctdb/tests/eventscripts/40.vsftpd.monitor.001.sh index 0f8b1a53c6..fdad12ae9a 100755 --- a/ctdb/tests/eventscripts/simple/40.vsftpd.monitor.001.sh +++ b/ctdb/tests/eventscripts/40.vsftpd.monitor.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "not managed, check no-op" diff --git a/ctdb/tests/eventscripts/simple/41.httpd.monitor.001.sh b/ctdb/tests/eventscripts/41.httpd.monitor.001.sh index 0a9ceac428..f400eaa89b 100755 --- a/ctdb/tests/eventscripts/simple/41.httpd.monitor.001.sh +++ b/ctdb/tests/eventscripts/41.httpd.monitor.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "not managed, check no-op" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.001.sh b/ctdb/tests/eventscripts/50.samba.monitor.001.sh index 77fc2eb852..ac3708f5fd 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.001.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "not managed, check no-op" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.050.sh b/ctdb/tests/eventscripts/50.samba.monitor.050.sh index 7a1b422bd2..f4b00bb857 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.050.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.050.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "auto-start, simple" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.051.sh b/ctdb/tests/eventscripts/50.samba.monitor.051.sh index 3a53ac8aaa..c9f1a96bc0 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.051.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.051.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "auto-stop, simple" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.101.sh b/ctdb/tests/eventscripts/50.samba.monitor.101.sh index d4b80bbf8f..cf3b53a8f1 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.101.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.101.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all OK" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.102.sh b/ctdb/tests/eventscripts/50.samba.monitor.102.sh index 2f1f446fe8..a2263f3c60 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.102.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.102.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "winbind down" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.103.sh b/ctdb/tests/eventscripts/50.samba.monitor.103.sh index 8854780cad..6f71a96760 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.103.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.103.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "port 445 down" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.104.sh b/ctdb/tests/eventscripts/50.samba.monitor.104.sh index a29e7838b3..9de022376b 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.104.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.104.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "port 139 down" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.105.sh b/ctdb/tests/eventscripts/50.samba.monitor.105.sh index 624c4a502c..9936eff806 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.105.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.105.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "non-existent share path" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.106.sh b/ctdb/tests/eventscripts/50.samba.monitor.106.sh index f54cc06c68..8fabfb33b6 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.106.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.106.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "non-existent share - not checked" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.107.sh b/ctdb/tests/eventscripts/50.samba.monitor.107.sh index e4151f3743..4c776ac8aa 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.107.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.107.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "port 139 down, default tcp checker, debug" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.108.sh b/ctdb/tests/eventscripts/50.samba.monitor.108.sh index d06a16f90a..fcd5d27960 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.108.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.108.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "port 139 down, ctdb checktcpport not implemented" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.109.sh b/ctdb/tests/eventscripts/50.samba.monitor.109.sh index 4bc854b623..f90ba629db 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.109.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.109.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "port 139 down, ctdb checktcpport not implemented, debug" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.110.sh b/ctdb/tests/eventscripts/50.samba.monitor.110.sh index 80264cc24e..639cc515fe 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.110.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.110.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "port 139 down, ctdb checktcpport/nmap not implemented, debug" diff --git a/ctdb/tests/eventscripts/simple/50.samba.monitor.111.sh b/ctdb/tests/eventscripts/50.samba.monitor.111.sh index 4651290663..c7f924cd7f 100755 --- a/ctdb/tests/eventscripts/simple/50.samba.monitor.111.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.111.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "port 139 down, ctdb checktcpport/nmap/netstat not implemented" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.001.sh b/ctdb/tests/eventscripts/60.nfs.monitor.001.sh index 5b260ac6fb..c62e5cf878 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.001.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "not managed, check no-op" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.100.sh b/ctdb/tests/eventscripts/60.nfs.monitor.100.sh index 95f4dc6fb6..e846d82735 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.100.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.100.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "get RPC service fail limits/actions" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.101.sh b/ctdb/tests/eventscripts/60.nfs.monitor.101.sh index 657db97a07..1a68927810 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.101.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.101.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all services available" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.111.sh b/ctdb/tests/eventscripts/60.nfs.monitor.111.sh index 8dcde029dd..414fcc8066 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.111.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.111.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "knfsd down, 1 iteration" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.112.sh b/ctdb/tests/eventscripts/60.nfs.monitor.112.sh index de796ebd07..666a38aaaf 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.112.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.112.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "knfsd down, 6 iterations" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.121.sh b/ctdb/tests/eventscripts/60.nfs.monitor.121.sh index 062c3f6f5c..6d27f60b27 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.121.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.121.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "lockd down, 15 iterations" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.122.sh b/ctdb/tests/eventscripts/60.nfs.monitor.122.sh index b93dba7b97..fc5cea87c7 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.122.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.122.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "lockd down, 15 iterations, back up after 10" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.131.sh b/ctdb/tests/eventscripts/60.nfs.monitor.131.sh index 84d20b761c..1cf72a9284 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.131.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.131.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "rquotad down, 5 iterations" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.132.sh b/ctdb/tests/eventscripts/60.nfs.monitor.132.sh index fad9a4c590..b8f3f2b041 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.132.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.132.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "rquotad down, 5 iterations, back up after 1" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.141.sh b/ctdb/tests/eventscripts/60.nfs.monitor.141.sh index 377de6e229..c77b1a7b05 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.141.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.141.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "statd down, 6 iterations" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.142.sh b/ctdb/tests/eventscripts/60.nfs.monitor.142.sh index 3ca3cf64a7..4373d8d642 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.142.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.142.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "statd down, 8 iterations, back up after 2" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.151.sh b/ctdb/tests/eventscripts/60.nfs.monitor.151.sh index af2dd26f5d..ea9aa7830e 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.151.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.151.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "mountd down, 1 iteration" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.152.sh b/ctdb/tests/eventscripts/60.nfs.monitor.152.sh index 9aad819b74..c4eb4194ae 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.152.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.152.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "mountd down, 10 iterations" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.153.sh b/ctdb/tests/eventscripts/60.nfs.monitor.153.sh index 6b2750c82c..cf33e39bbc 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.153.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.153.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "mountd down, 10 iterations, back up after 5" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.161.sh b/ctdb/tests/eventscripts/60.nfs.monitor.161.sh index 4abe68eaba..1e07c181c2 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.161.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.161.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "2nd share missing" diff --git a/ctdb/tests/eventscripts/simple/60.nfs.monitor.162.sh b/ctdb/tests/eventscripts/60.nfs.monitor.162.sh index 865b1c635a..ccd4ca84ea 100755 --- a/ctdb/tests/eventscripts/simple/60.nfs.monitor.162.sh +++ b/ctdb/tests/eventscripts/60.nfs.monitor.162.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "2nd share missing, skipping share checks" diff --git a/ctdb/tests/eventscripts/multievent/60.nfs.001.sh b/ctdb/tests/eventscripts/60.nfs.multi.001.sh index a6608db83e..e578c56c32 100755 --- a/ctdb/tests/eventscripts/multievent/60.nfs.001.sh +++ b/ctdb/tests/eventscripts/60.nfs.multi.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "takeip, ipreallocated -> reconfigure" diff --git a/ctdb/tests/eventscripts/multievent/60.nfs.002.sh b/ctdb/tests/eventscripts/60.nfs.multi.002.sh index 93f645a618..0c203cdf25 100755 --- a/ctdb/tests/eventscripts/multievent/60.nfs.002.sh +++ b/ctdb/tests/eventscripts/60.nfs.multi.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "takeip, monitor -> reconfigure" diff --git a/ctdb/tests/eventscripts/multievent/60.nfs.003.sh b/ctdb/tests/eventscripts/60.nfs.multi.003.sh index 929eaf2ae5..31867b2789 100755 --- a/ctdb/tests/eventscripts/multievent/60.nfs.003.sh +++ b/ctdb/tests/eventscripts/60.nfs.multi.003.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "takeip, monitor -> reconfigure, replay error" diff --git a/ctdb/tests/eventscripts/multievent/60.nfs.004.sh b/ctdb/tests/eventscripts/60.nfs.multi.004.sh index addbf44c9c..6220ad346c 100755 --- a/ctdb/tests/eventscripts/multievent/60.nfs.004.sh +++ b/ctdb/tests/eventscripts/60.nfs.multi.004.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "takeip, monitor -> reconfigure, replay timedout" diff --git a/ctdb/tests/eventscripts/multievent/60.nfs.005.sh b/ctdb/tests/eventscripts/60.nfs.multi.005.sh index 9e652013ca..1a8200c9fc 100755 --- a/ctdb/tests/eventscripts/multievent/60.nfs.005.sh +++ b/ctdb/tests/eventscripts/60.nfs.multi.005.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "takeip, monitor -> reconfigure, replay disabled" diff --git a/ctdb/tests/eventscripts/multievent/60.nfs.006.sh b/ctdb/tests/eventscripts/60.nfs.multi.006.sh index 35f8b836e1..21beaadcea 100755 --- a/ctdb/tests/eventscripts/multievent/60.nfs.006.sh +++ b/ctdb/tests/eventscripts/60.nfs.multi.006.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${EVENTSCRIPTS_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "reconfigure (synthetic), twice" # This checks that the lock is released... diff --git a/ctdb/tests/eventscripts/etc-ctdb/interface_modify.sh b/ctdb/tests/eventscripts/etc-ctdb/interface_modify.sh deleted file mode 120000 index 94f555c30d..0000000000 --- a/ctdb/tests/eventscripts/etc-ctdb/interface_modify.sh +++ /dev/null @@ -1 +0,0 @@ -../../../config/interface_modify.sh
\ No newline at end of file diff --git a/ctdb/tests/eventscripts/run_tests.sh b/ctdb/tests/eventscripts/run_tests.sh deleted file mode 100755 index 406689a0d6..0000000000 --- a/ctdb/tests/eventscripts/run_tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh - -# Eventscript unit test harness. - -cd $(dirname "$0") -export EVENTSCRIPTS_TESTS_DIR=$(pwd) - -test_dir=$(dirname "$EVENTSCRIPTS_TESTS_DIR") - -export EVENTSCRIPT_TESTS_CAT_RESULTS_OPTS="" -export EVENTSCRIPT_TESTS_DIFF_RESULTS=false - -opts="-d" - -for i ; do - case "$i" in - -v) - export EVENTSCRIPT_TESTS_VERBOSE="yes" - shift - ;; - -T) - # This will cause tests to fail but is good for debugging - # individual tests when they fail. - export EVENTSCRIPTS_TESTS_TRACE="sh -x" - shift - ;; - -A) - # Useful for detecting whitespace differences in results - export EVENTSCRIPT_TESTS_CAT_RESULTS_OPTS="-A" - shift - ;; - -D) - # Useful for detecting whitespace differences in results - export EVENTSCRIPT_TESTS_DIFF_RESULTS=true - shift - ;; - -*) - opts="$opts $i" - shift - ;; - *) - break - esac -done - -tests="" -if [ -z "$*" ] ; then - tests=$(ls simple/[0-9][0-9].*.*.[0-9][0-9][0-9].sh simple/[0-9][0-9].*.*.[0-9][0-9][0-9]/run_test.sh 2>/dev/null) -fi - -"$test_dir/scripts/run_tests" $opts "$@" $tests || exit 1 - -exit 0 diff --git a/ctdb/tests/eventscripts/common.sh b/ctdb/tests/eventscripts/scripts/local.sh index 44c975e034..6d7de89465 100644 --- a/ctdb/tests/eventscripts/common.sh +++ b/ctdb/tests/eventscripts/scripts/local.sh @@ -1,8 +1,5 @@ # Hey Emacs, this is a -*- shell-script -*- !!! :-) -# Print a message and exit. -die () { echo "$@" >&2 ; exit 1 ; } - # Augment PATH with relevant stubs/ directories. We do this by actually # setting PATH, and also by setting $EVENTSCRIPTS_PATH and then # prepending that to $PATH in rc.local to avoid the PATH reset in @@ -10,45 +7,29 @@ die () { echo "$@" >&2 ; exit 1 ; } EVENTSCRIPTS_PATH="" -if [ -d "${EVENTSCRIPTS_TESTS_DIR}/stubs" ] ; then - EVENTSCRIPTS_PATH="${EVENTSCRIPTS_TESTS_DIR}/stubs" -fi - -export EVENTSCRIPTS_TESTCASE_DIR=$(dirname "$0") -if [ $(basename "$EVENTSCRIPTS_TESTCASE_DIR") = "eventscripts" ] ; then - # Just a test script, no testcase subdirectory. - EVENTSCRIPTS_TESTCASE_DIR="$EVENTSCRIPTS_TESTS_DIR" -else - if [ -d "${EVENTSCRIPTS_TESTCASE_DIR}/stubs" ] ; then - EVENTSCRIPTS_PATH="${EVENTSCRIPTS_TESTCASE_DIR}/stubs:${EVENTSCRIPTS_PATH}" - fi +if [ -d "${TEST_SUBDIR}/stubs" ] ; then + EVENTSCRIPTS_PATH="${TEST_SUBDIR}/stubs" fi export EVENTSCRIPTS_PATH PATH="${EVENTSCRIPTS_PATH}:${PATH}" -if [ -d "${EVENTSCRIPTS_TESTCASE_DIR}/etc" ] ; then - CTDB_ETCDIR="${EVENTSCRIPTS_TESTCASE_DIR}/etc" -elif [ -d "${EVENTSCRIPTS_TESTS_DIR}/etc" ] ; then - CTDB_ETCDIR="${EVENTSCRIPTS_TESTS_DIR}/etc" +if [ -d "${TEST_SUBDIR}/etc" ] ; then + CTDB_ETCDIR="${TEST_SUBDIR}/etc" else die "Unable to set \$CTDB_ETCDIR" fi export CTDB_ETCDIR -if [ -d "${EVENTSCRIPTS_TESTCASE_DIR}/etc-ctdb" ] ; then - CTDB_BASE="${EVENTSCRIPTS_TESTCASE_DIR}/etc-ctdb" -elif [ -d "${EVENTSCRIPTS_TESTCASE_DIR}/etc/ctdb" ] ; then - CTDB_BASE="${EVENTSCRIPTS_TESTCASE_DIR}/etc/ctdb" -elif [ -d "${EVENTSCRIPTS_TESTS_DIR}/etc-ctdb" ] ; then - CTDB_BASE="${EVENTSCRIPTS_TESTS_DIR}/etc-ctdb" +if [ -d "${TEST_SUBDIR}/etc-ctdb" ] ; then + CTDB_BASE="${TEST_SUBDIR}/etc-ctdb" else die "Unable to set \$CTDB_BASE" fi export CTDB_BASE -export EVENTSCRIPTS_TESTS_VAR_DIR="${EVENTSCRIPTS_TESTS_DIR}/var" +export EVENTSCRIPTS_TESTS_VAR_DIR="${TEST_SUBDIR}/var" if [ "$EVENTSCRIPTS_TESTS_VAR_DIR" != "/var" ] ; then rm -r "$EVENTSCRIPTS_TESTS_VAR_DIR" fi @@ -57,7 +38,7 @@ export CTDB_VARDIR="$EVENTSCRIPTS_TESTS_VAR_DIR/ctdb" ###################################################################### -if [ "$EVENTSCRIPT_TESTS_VERBOSE" = "yes" ] ; then +if "$TEST_VERBOSE" ; then debug () { echo "$@" ; } else debug () { : ; } @@ -86,6 +67,11 @@ setup_generic () for i in $(seq 1 3) ; do _s="${EVENTSCRIPTS_TESTS_VAR_DIR}/shares/${i}_existing" mkdir -p "$_s" + # Shares must begin with / + case "$_s" in + /*) : ;; + *) _s="${PWD}/$_s" + esac FAKE_SHARES="${FAKE_SHARES}${FAKE_SHARES:+ }${_s}" done @@ -665,12 +651,7 @@ define_test () { desc="$1" - _f="$0" - _f="${_f#./}" # strip leading ./ - _f="${_f#simple/}" # strip leading simple/ - _f="${_f#multievent/}" # strip leading multievent/ - _f="${_f%%/*}" # if subdir, strip off file - _f="${_f%.sh}" # strip off .sh suffix if any + _f=$(basename "$0" ".sh") # Remaining format should be NN.service.event.NNN or NN.service.NNN: _num="${_f##*.}" @@ -691,133 +672,13 @@ define_test () printf "%-17s %-10s %-4s - %s\n\n" "$script" "$event" "$_num" "$desc" } -# Set the required result for a test. -# - Argument 1 is exit code. -# - Argument 2, if present is the required test output but "--" -# indicates empty output. -# If argument 2 is not present or null then read required test output -# from stdin. -required_result () -{ - required_rc="${1:-0}" - if [ -n "$2" ] ; then - if [ "$2" = "--" ] ; then - required_output="" - else - required_output="$2" - fi - else - if ! tty -s ; then - required_output=$(cat) - else - required_output="" - fi - fi -} - -ok () -{ - required_result 0 "$@" -} - -ok_null () -{ - ok -- -} - -result_print () -{ - _passed="$1" - _out="$2" - _rc="$3" - _iteration="$4" - - if [ "$EVENTSCRIPT_TESTS_VERBOSE" = "yes" ] || ! $_passed ; then - if [ -n "$_iteration" ] ; then - cat <<EOF - -================================================== -Iteration $_iteration -EOF - fi - -cat <<EOF --------------------------------------------------- -Output (Exit status: ${_rc}): --------------------------------------------------- -EOF - echo "$_out" | cat $EVENTSCRIPT_TESTS_CAT_RESULTS_OPTS - fi - - if ! $_passed ; then - cat <<EOF --------------------------------------------------- -Required output (Exit status: ${required_rc}): --------------------------------------------------- -EOF - echo "$required_output" | cat $EVENTSCRIPT_TESTS_CAT_RESULTS_OPTS - - if $EVENTSCRIPT_TESTS_DIFF_RESULTS ; then - _outr=$(mktemp) - echo "$required_output" >"$_outr" - - _outf=$(mktemp) - echo "$_out" >"$_outf" - - cat <<EOF --------------------------------------------------- -Diff: --------------------------------------------------- -EOF - diff -u "$_outr" "$_outf" | cat -A - rm "$_outr" "$_outf" - fi - fi -} - -result_footer () +_extra_header () { - _passed="$1" - - if [ "$EVENTSCRIPT_TESTS_VERBOSE" = "yes" ] || ! $_passed ; then - - cat <<EOF --------------------------------------------------- + cat <<EOF CTDB_BASE="$CTDB_BASE" CTDB_ETCDIR="$CTDB_ETCDIR" ctdb client is "$(which ctdb)" --------------------------------------------------- EOF - fi - - if $_passed ; then - echo "PASSED" - return 0 - else - echo - echo "FAILED" - return 1 - fi -} - -result_check () -{ - _rc=$? - - if [ -n "$OUT_FILTER" ] ; then - _fout=$(echo "$_out" | eval sed -r $OUT_FILTER) - else - _fout="$_out" - fi - - if [ "$_fout" = "$required_output" -a $_rc = $required_rc ] ; then - _passed=true - else - _passed=false - fi - - result_print "$_passed" "$_out" "$_rc" - result_footer "$_passed" } # Run an eventscript once. The test passes if the return code and @@ -834,10 +695,12 @@ simple_test () { [ -n "$event" ] || die 'simple_test: $event not set' + _extra_header=$(_extra_header) + echo "Running eventscript \"$script $event${1:+ }$*\"" - _out=$($EVENTSCRIPTS_TESTS_TRACE "${CTDB_BASE}/events.d/$script" "$event" "$@" 2>&1) + _out=$($TEST_COMMAND_TRACE "${CTDB_BASE}/events.d/$script" "$event" "$@" 2>&1) - result_check + result_check "$_extra_header" } simple_test_event () @@ -931,8 +794,8 @@ iterate_test () _result=false fi - result_print "$_passed" "$_out" "$_rc" "$iteration" + result_print "$_passed" "$_out" "$_rc" "Iteration $iteration" done - result_footer "$_result" + result_footer "$_result" "$(_extra_header)" } diff --git a/ctdb/tests/eventscripts/stubs/ctdb b/ctdb/tests/eventscripts/stubs/ctdb index 81d275af70..e43784e3bb 100755 --- a/ctdb/tests/eventscripts/stubs/ctdb +++ b/ctdb/tests/eventscripts/stubs/ctdb @@ -126,7 +126,7 @@ ip_reallocate () fi _flags="${_flags}${_flags:+,}${_this}" done - "$(dirname ${EVENTSCRIPTS_TESTS_DIR})/bin/ctdb_takeover_tests" \ + "$(dirname ${TEST_SUBDIR})/bin/ctdb_takeover_tests" \ "ctdb_takeover_run_core" "$_flags" <"$FAKE_CTDB_IP_LAYOUT" | sort >"$_t" mv "$_t" "$FAKE_CTDB_IP_LAYOUT" diff --git a/ctdb/tests/onnode/0001.sh b/ctdb/tests/onnode/0001.sh index 3c2d541ef4..28533748f2 100755 --- a/ctdb/tests/onnode/0001.sh +++ b/ctdb/tests/onnode/0001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE all hostname" diff --git a/ctdb/tests/onnode/0002.sh b/ctdb/tests/onnode/0002.sh index b18d91efa2..c3c8c77a0e 100755 --- a/ctdb/tests/onnode/0002.sh +++ b/ctdb/tests/onnode/0002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE -q all hostname" diff --git a/ctdb/tests/onnode/0003.sh b/ctdb/tests/onnode/0003.sh index d925799261..d79bca2806 100755 --- a/ctdb/tests/onnode/0003.sh +++ b/ctdb/tests/onnode/0003.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE -p all hostname" diff --git a/ctdb/tests/onnode/0004.sh b/ctdb/tests/onnode/0004.sh index a6e6424ace..d0986b2ffd 100755 --- a/ctdb/tests/onnode/0004.sh +++ b/ctdb/tests/onnode/0004.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE -pq all hostname" diff --git a/ctdb/tests/onnode/0005.sh b/ctdb/tests/onnode/0005.sh index af237da9a3..0eccbb04a3 100755 --- a/ctdb/tests/onnode/0005.sh +++ b/ctdb/tests/onnode/0005.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE 3 hostname" diff --git a/ctdb/tests/onnode/0006.sh b/ctdb/tests/onnode/0006.sh index aa6eeba89e..b027850240 100755 --- a/ctdb/tests/onnode/0006.sh +++ b/ctdb/tests/onnode/0006.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE -v 3 hostname" diff --git a/ctdb/tests/onnode/0070.sh b/ctdb/tests/onnode/0070.sh index f38c95f5fd..902d78b231 100755 --- a/ctdb/tests/onnode/0070.sh +++ b/ctdb/tests/onnode/0070.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE ok hostname" diff --git a/ctdb/tests/onnode/0071.sh b/ctdb/tests/onnode/0071.sh index 8a1cb59dd7..ebf2f61fcd 100755 --- a/ctdb/tests/onnode/0071.sh +++ b/ctdb/tests/onnode/0071.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE ok hostname" diff --git a/ctdb/tests/onnode/0072.sh b/ctdb/tests/onnode/0072.sh index d80361a435..cb29e3b9a2 100755 --- a/ctdb/tests/onnode/0072.sh +++ b/ctdb/tests/onnode/0072.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE ok hostname" diff --git a/ctdb/tests/onnode/0075.sh b/ctdb/tests/onnode/0075.sh index aa2e8be0ba..6ce9b9b190 100755 --- a/ctdb/tests/onnode/0075.sh +++ b/ctdb/tests/onnode/0075.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE con hostname" diff --git a/ctdb/tests/onnode/0080.sh b/ctdb/tests/onnode/0080.sh index 095f65b224..bca478ada5 100755 --- a/ctdb/tests/onnode/0080.sh +++ b/ctdb/tests/onnode/0080.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE recmaster hostname" diff --git a/ctdb/tests/onnode/0081.sh b/ctdb/tests/onnode/0081.sh index e593934f66..412db87e4c 100755 --- a/ctdb/tests/onnode/0081.sh +++ b/ctdb/tests/onnode/0081.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE lvsmaster hostname" diff --git a/ctdb/tests/onnode/0090.sh b/ctdb/tests/onnode/0090.sh index 1147e34c10..dd50c51b70 100755 --- a/ctdb/tests/onnode/0090.sh +++ b/ctdb/tests/onnode/0090.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE natgw hostname" diff --git a/ctdb/tests/onnode/0091.sh b/ctdb/tests/onnode/0091.sh index 5239eef1b4..528eec16df 100755 --- a/ctdb/tests/onnode/0091.sh +++ b/ctdb/tests/onnode/0091.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${ONNODE_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" cmd="$ONNODE natgw hostname" diff --git a/ctdb/tests/onnode/common.sh b/ctdb/tests/onnode/common.sh deleted file mode 100644 index f920bc398a..0000000000 --- a/ctdb/tests/onnode/common.sh +++ /dev/null @@ -1,103 +0,0 @@ -# Hey Emacs, this is a -*- shell-script -*- !!! :-) - -# Set indirectly by run_tests at top level. -unset CTDB_NODES_SOCKETS - -# Default to just "onnode". -: ${ONNODE:=onnode} - -# Augment PATH with relevant stubs/ directories. - -if [ -d "${ONNODE_TESTS_DIR}/stubs" ] ; then - PATH="${ONNODE_TESTS_DIR}/stubs:$PATH" -fi - -export ONNODE_TESTCASE_DIR=$(dirname "$0") -if [ $(basename "$ONNODE_TESTCASE_DIR") = "onnode" ] ; then - # Just a test script, no testcase subdirectory. - ONNODE_TESTCASE_DIR="$ONNODE_TESTS_DIR" -else - if [ -d "${ONNODE_TESTCASE_DIR}/stubs" ] ; then - PATH="${ONNODE_TESTCASE_DIR}/stubs:$PATH" - fi -fi - -# Find CTDB nodes file. -if [ -z "$CTDB_NODES_FILE" ] ; then - if [ -r "${ONNODE_TESTCASE_DIR}/nodes" ] ; then - CTDB_NODES_FILE="${ONNODE_TESTCASE_DIR}/nodes" - elif [ -r "${ONNODE_TESTS_DIR}/nodes" ] ; then - CTDB_NODES_FILE="${ONNODE_TESTS_DIR}/nodes" - else - CTDB_NODES_FILE="${CTDB_BASE:-/etc/ctdb}/nodes" - fi -fi - -export CTDB_NODES_FILE - -export ONNODE_TESTS_VAR_DIR="${ONNODE_TESTS_DIR}/var" -mkdir -p "$ONNODE_TESTS_VAR_DIR" - -if [ -z "$CTDB_BASE" ] ; then - export CTDB_BASE=$(dirname "$CTDB_NODES_FILE") -fi - -define_test () -{ - _f="$0" - _f="${_f#./}" # strip leading ./ - _f="${_f%%/*}" # if subdir, strip off file - _f="${_f%.sh}" # strip off .sh suffix if any - - echo "$_f $1 - $2" -} - -# Set output for ctdb command. Option 1st argument is return code. -ctdb_set_output () -{ - _out="$ONNODE_TESTS_VAR_DIR/ctdb.out" - cat >"$_out" - - _rc="$ONNODE_TESTS_VAR_DIR/ctdb.rc" - echo "${1:-0}" >"$_rc" - - trap "rm -f $_out $_rc" 0 -} - -required_result () -{ - required_rc="${1:-0}" - required_output=$(cat) -} - -simple_test () -{ - _sort="cat" - if [ "$1" = "-s" ] ; then - shift - _sort="sort" - fi - _out=$("$@" 2>&1) - _rc=$? - _out=$(echo "$_out" | $_sort ) - - if [ "$_out" = "$required_output" -a $_rc = $required_rc ] ; then - echo "PASSED" - else - cat <<EOF -CTDB_NODES_FILE="${CTDB_NODES_FILE}" -CTDB_BASE="$CTDB_BASE" -$(which ctdb) - -################################################## -Required output (Exit status: ${required_rc}): -################################################## -$required_output -################################################## -Actual output (Exit status: ${_rc}): -################################################## -$_out -EOF - return 1 - fi -} diff --git a/ctdb/tests/onnode/run_tests.sh b/ctdb/tests/onnode/run_tests.sh deleted file mode 100755 index e5fa7e28c2..0000000000 --- a/ctdb/tests/onnode/run_tests.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -# Run some onnode unit tests. - -cd $(dirname "$0") -export ONNODE_TESTS_DIR=$(pwd) - -test_dir=$(dirname "$ONNODE_TESTS_DIR") - -opts="-d" - -for i ; do - case "$i" in - -*) - opts="$opts $i" - shift - ;; - *) - break - esac -done - -tests="" -if [ -z "$*" ] ; then - tests=$(ls ./[0-9][0-9][0-9][0-9].sh ./[0-9][0-9][0-9][0-9]/run_test.sh 2>/dev/null) -fi - -"$test_dir/scripts/run_tests" $opts "$@" $tests || exit 1 - -echo "All OK" -exit 0 diff --git a/ctdb/tests/onnode/scripts/local.sh b/ctdb/tests/onnode/scripts/local.sh new file mode 100644 index 0000000000..d6dd41c293 --- /dev/null +++ b/ctdb/tests/onnode/scripts/local.sh @@ -0,0 +1,81 @@ +# Hey Emacs, this is a -*- shell-script -*- !!! :-) + +# Set indirectly by run_tests at top level. +unset CTDB_NODES_SOCKETS + +# Default to just "onnode". +: ${ONNODE:=onnode} + +# Augment PATH with relevant stubs/ directories. + +if [ -d "${TEST_SUBDIR}/stubs" ] ; then + PATH="${TEST_SUBDIR}/stubs:$PATH" +fi + +# Find CTDB nodes file. +if [ -z "$CTDB_NODES_FILE" ] ; then + if [ -r "${TEST_SUBDIR}/nodes" ] ; then + CTDB_NODES_FILE="${TEST_SUBDIR}/nodes" + else + CTDB_NODES_FILE="${CTDB_BASE:-/etc/ctdb}/nodes" + fi +fi + +export CTDB_NODES_FILE + +export ONNODE_TESTS_VAR_DIR="${TEST_SUBDIR}/var" +mkdir -p "$ONNODE_TESTS_VAR_DIR" + +if [ -z "$CTDB_BASE" ] ; then + export CTDB_BASE=$(dirname "$CTDB_NODES_FILE") +fi + +define_test () +{ + _f=$(basename "$0") + + echo "$_f $1 - $2" +} + +# Set output for ctdb command. Option 1st argument is return code. +ctdb_set_output () +{ + _out="$ONNODE_TESTS_VAR_DIR/ctdb.out" + cat >"$_out" + + _rc="$ONNODE_TESTS_VAR_DIR/ctdb.rc" + echo "${1:-0}" >"$_rc" + + trap "rm -f $_out $_rc" 0 +} + +_extra_header () +{ + cat <<EOF +CTDB_NODES_FILE="${CTDB_NODES_FILE}" +CTDB_BASE="$CTDB_BASE" +$(which ctdb) + +EOF +} + +simple_test () +{ + _sort="cat" + if [ "$1" = "-s" ] ; then + shift + _sort="sort" + fi + + _out=$("$@" 2>&1) + _rc=$? + _out=$(echo "$_out" | $_sort ) + + # Can't do this inline or it affects return code + _extra_header="$(_extra_header)" + + # Get the return code back into $? + (exit $_rc) + + result_check "$_extra_header" +} diff --git a/ctdb/tests/scripts/common.sh b/ctdb/tests/scripts/common.sh new file mode 100644 index 0000000000..581663c438 --- /dev/null +++ b/ctdb/tests/scripts/common.sh @@ -0,0 +1,9 @@ +# Hey Emacs, this is a -*- shell-script -*- !!! :-) + +# Common variables and functions for all CTDB tests. + +# Print a message and exit. +die () +{ + echo "$1" >&2 ; exit ${2:-1} +} diff --git a/ctdb/tests/scripts/ctdb_test_env b/ctdb/tests/scripts/ctdb_test_env index f550d7945f..18d100f3d8 100755 --- a/ctdb/tests/scripts/ctdb_test_env +++ b/ctdb/tests/scripts/ctdb_test_env @@ -1,14 +1,14 @@ #!/bin/bash -ctdb_test_scripts_dir=$(cd $(dirname $0) ; pwd) -export CTDB_DIR=$(dirname $(dirname $ctdb_test_scripts_dir)) +export TEST_SCRIPTS_DIR=$(cd $(dirname $0) ; pwd) +export CTDB_DIR=$(dirname $(dirname $TEST_SCRIPTS_DIR)) var_dir=$CTDB_DIR/tests/var ###################################################################### ctdb_tools_dir=$CTDB_DIR/tools -PATH="${ctdb_test_scripts_dir}:${ctdb_tools_dir}:${PATH}" +PATH="${TEST_SCRIPTS_DIR}:${ctdb_tools_dir}:${PATH}" export CTDB_TIMEOUT=60 @@ -17,7 +17,7 @@ export CTDB_TIMEOUT=60 if [ -n "$CTDB_TEST_REMOTE_DIR" ] ; then CTDB_TEST_WRAPPER="${CTDB_TEST_REMOTE_DIR}/test_wrap" else - CTDB_TEST_WRAPPER="${ctdb_test_scripts_dir}/test_wrap" + CTDB_TEST_WRAPPER="${TEST_SCRIPTS_DIR}/test_wrap" fi export CTDB_TEST_WRAPPER diff --git a/ctdb/tests/scripts/ctdb_test_functions.bash b/ctdb/tests/scripts/ctdb_test_functions.bash index 063f1c3a3e..70c5b5d10b 100644 --- a/ctdb/tests/scripts/ctdb_test_functions.bash +++ b/ctdb/tests/scripts/ctdb_test_functions.bash @@ -8,51 +8,6 @@ fail () ###################################################################### -ctdb_test_begin () -{ - local name="$1" - - teststarttime=$(date '+%s') - testduration=0 - - echo "--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--" - echo "Running test $name ($(date '+%T'))" - echo "--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--" -} - -ctdb_test_end () -{ - local name="$1" ; shift - local status="$1" ; shift - # "$@" is command-line - - local interp="SKIPPED" - local statstr=" (reason $*)" - if [ -n "$status" ] ; then - if [ $status -eq 0 ] ; then - interp="PASSED" - statstr="" - echo "ALL OK: $*" - else - interp="FAILED" - statstr=" (status $status)" - testfailures=$(($testfailures+1)) - fi - fi - - testduration=$(($(date +%s)-$teststarttime)) - - echo "==========================================================================" - echo "TEST ${interp}: ${name}${statstr} (duration: ${testduration}s)" - echo "==========================================================================" - -} - -test_exit () -{ - exit $(($testfailures+0)) -} - ctdb_check_time_logs () { local threshold=20 @@ -116,7 +71,8 @@ ctdb_test_exit () echo "*** TEST COMPLETED (RC=$status) AT $(date '+%F %T'), CLEANING UP..." - if [ -n "$CTDB_TEST_REAL_CLUSTER" -a $status -ne 0 ] ; then + if [ -n "$CTDB_TEST_REAL_CLUSTER" -a -n "$CTDB_TEST_TIME_LOGGING" -a \ + $status -ne 0 ] ; then ctdb_check_time_logs fi @@ -143,22 +99,6 @@ ctdb_test_exit_hook_add () ctdb_test_exit_hook="${ctdb_test_exit_hook}${ctdb_test_exit_hook:+ ; }$*" } -ctdb_test_run () -{ - local name="$1" ; shift - - [ -n "$1" ] || set -- "$name" - - ctdb_test_begin "$name" - - local status=0 - "$@" || status=$? - - ctdb_test_end "$name" "$status" "$*" - - return $status -} - ctdb_test_usage() { local status=${1:-2} diff --git a/ctdb/tests/scripts/run_tests b/ctdb/tests/scripts/run_tests index 1ce089d852..3a5ec96b74 100755 --- a/ctdb/tests/scripts/run_tests +++ b/ctdb/tests/scripts/run_tests @@ -5,12 +5,21 @@ # the arguments that it sees. . $(dirname $0)/ctdb_test_env : -. ctdb_test_functions.bash +. "${TEST_SCRIPTS_DIR}/common.sh" usage() { cat <<EOF Usage: run_tests [OPTIONS] [TESTS] +Options: + -s Print a summary of tests results after running all tests + -v Verbose - print test output for non-failures (only some tests) + -A Use "cat -A" to print test output (only some tests) + -D Show diff between failed/expected test output (some tests only) + -X Trace certain scripts run by tests using -x (only some tests) + -d Print descriptions of tests instead of filenames (dodgy!) + -q Quiet - don't show tests being run (hint: use with -s) + -x Trace this script with the -x option EOF exit 1 } @@ -21,7 +30,12 @@ with_summary=false with_desc=false quiet=false -temp=$(getopt -n "$prog" -o "xdhqs" -l help -- "$@") +export TEST_VERBOSE=false +export TEST_COMMAND_TRACE="" +export TEST_CAT_RESULTS_OPTS="" +export TEST_DIFF_RESULTS=false + +temp=$(getopt -n "$prog" -o "xdhqsvXAD" -l help -- "$@") [ $? != 0 ] && usage @@ -33,6 +47,10 @@ while true ; do -d) with_desc=true ; shift ;; # 4th line of output is description -q) quiet=true ; shift ;; -s) with_summary=true ; shift ;; + -v) TEST_VERBOSE=true ; shift ;; + -X) TEST_COMMAND_TRACE="sh -x" ; shift ;; + -A) TEST_CAT_RESULTS_OPTS="-A" ; shift ;; + -D) TEST_DIFF_RESULTS=true ; shift ;; --) shift ; break ;; *) usage ;; esac @@ -46,8 +64,66 @@ fi ###################################################################### +ctdb_test_begin () +{ + local name="$1" + + teststarttime=$(date '+%s') + testduration=0 + + echo "--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--" + echo "Running test $name ($(date '+%T'))" + echo "--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--" +} + +ctdb_test_end () +{ + local name="$1" ; shift + local status="$1" ; shift + # "$@" is command-line + + local interp="SKIPPED" + local statstr=" (reason $*)" + if [ -n "$status" ] ; then + if [ $status -eq 0 ] ; then + interp="PASSED" + statstr="" + echo "ALL OK: $*" + else + interp="FAILED" + statstr=" (status $status)" + fi + fi + + testduration=$(($(date +%s)-$teststarttime)) + + echo "==========================================================================" + echo "TEST ${interp}: ${name}${statstr} (duration: ${testduration}s)" + echo "==========================================================================" + +} + +ctdb_test_run () +{ + local name="$1" ; shift + + [ -n "$1" ] || set -- "$name" + + ctdb_test_begin "$name" + + local status=0 + "$@" || status=$? + + ctdb_test_end "$name" "$status" "$*" + + return $status +} + +###################################################################### + tests_total=0 tests_passed=0 +tests_failed=0 summary="" rows=$(if tty -s ; then stty size ; else echo x 80 ; fi | sed -e 's@.* @@' -e 's@^0$@80@') @@ -58,10 +134,16 @@ sf=$(mktemp) set -o pipefail -for f; do - [ -x $f ] || fail "test \"$f\" is not executable" +run_one_test () +{ + _f="$1" + + [ -x "$_f" ] || die "test \"$_f\" is not executable" tests_total=$(($tests_total + 1)) - ctdb_test_run "$f" | tee "$tf" | show_progress + + export TEST_SUBDIR=$(dirname "$_f") + + ctdb_test_run "$_f" | tee "$tf" | show_progress status=$? if $with_summary ; then if [ $status -eq 0 ] ; then @@ -69,12 +151,29 @@ for f; do t=" PASSED " else t="*FAILED*" + tests_failed=$(($tests_failed + 1)) fi if $with_desc ; then desc=$(tail -n +4 $tf | head -n 1) - f="$desc" + _f="$desc" + fi + echo "$t $_f" >>"$sf" + fi +} + +for f ; do + if [ -d "$f" ] ; then + # This expands the most probable problem cases like "." and "..". + if [ $(dirname "$f") = "." ] ; then + f=$(cd "$f" ; pwd) fi - echo "$t $f" >>"$sf" + for i in $(ls "${f%/}/"*".sh" 2>/dev/null) ; do + run_one_test "$i" + done + elif [ -f "$f" ] ; then + run_one_test "$f" + else + die "test \"$f\" is not recognised" fi done @@ -89,4 +188,6 @@ fi rm -f "$sf" -test_exit +if [ $tests_failed -gt 0 ] ; then + exit 1 +fi diff --git a/ctdb/tests/scripts/unit.sh b/ctdb/tests/scripts/unit.sh new file mode 100644 index 0000000000..6f92d6cb16 --- /dev/null +++ b/ctdb/tests/scripts/unit.sh @@ -0,0 +1,141 @@ +# Hey Emacs, this is a -*- shell-script -*- !!! :-) + +. "${TEST_SCRIPTS_DIR}/common.sh" + +# Common variables and functions for CTDB unit tests. + +# Set the required result for a test. +# - Argument 1 is exit code. +# - Argument 2, if present is the required test output but "--" +# indicates empty output. +# If argument 2 is not present or null then read required test output +# from stdin. +required_result () +{ + required_rc="${1:-0}" + if [ -n "$2" ] ; then + if [ "$2" = "--" ] ; then + required_output="" + else + required_output="$2" + fi + else + if ! tty -s ; then + required_output=$(cat) + else + required_output="" + fi + fi +} + +ok () +{ + required_result 0 "$@" +} + +ok_null () +{ + ok -- +} + +result_print () +{ + _passed="$1" + _out="$2" + _rc="$3" + _extra_header="$4" + + if "$TEST_VERBOSE" || ! $_passed ; then + if [ -n "$_extra_header" ] ; then + cat <<EOF + +================================================== +$_extra_header +EOF + fi + +cat <<EOF +-------------------------------------------------- +Output (Exit status: ${_rc}): +-------------------------------------------------- +EOF + echo "$_out" | cat $TEST_CAT_RESULTS_OPTS + fi + + if ! $_passed ; then + cat <<EOF +-------------------------------------------------- +Required output (Exit status: ${required_rc}): +-------------------------------------------------- +EOF + echo "$required_output" | cat $TEST_CAT_RESULTS_OPTS + + if $TEST_DIFF_RESULTS ; then + _outr=$(mktemp) + echo "$required_output" >"$_outr" + + _outf=$(mktemp) + echo "$_out" >"$_outf" + + cat <<EOF +-------------------------------------------------- +Diff: +-------------------------------------------------- +EOF + diff -u "$_outr" "$_outf" | cat -A + rm "$_outr" "$_outf" + fi + fi +} + +result_footer () +{ + _passed="$1" + _extra_footer="$2" + + if "$TEST_VERBOSE" || ! $_passed ; then + if [ -n "$_extra_footer" ] ; then + cat <<EOF +-------------------------------------------------- +$_extra_footer +-------------------------------------------------- +EOF + fi + fi + + if $_passed ; then + echo "PASSED" + return 0 + else + echo + echo "FAILED" + return 1 + fi +} + +result_check () +{ + _rc=$? + + _extra_header="$1" + + if [ -n "$OUT_FILTER" ] ; then + _fout=$(echo "$_out" | eval sed -r $OUT_FILTER) + else + _fout="$_out" + fi + + if [ "$_fout" = "$required_output" -a $_rc = $required_rc ] ; then + _passed=true + else + _passed=false + fi + + result_print "$_passed" "$_out" "$_rc" "$_extra_header" + result_footer "$_passed" +} + +local="${TEST_SUBDIR}/scripts/local.sh" +if [ -r "$local" ] ; then + . "$local" +fi diff --git a/ctdb/tests/simple/00_ctdb_onnode.sh b/ctdb/tests/simple/00_ctdb_onnode.sh index fa5e25affc..3d8221a58c 100755 --- a/ctdb/tests/simple/00_ctdb_onnode.sh +++ b/ctdb/tests/simple/00_ctdb_onnode.sh @@ -31,7 +31,7 @@ onnode all onnode all true # We're seeing some weirdness with CTDB controls timing out. We're # wondering if time is jumping forward, so this creates a time log on # each node that we can examine later if tests fail weirdly. -if [ -n "$CTDB_TEST_REAL_CLUSTER" ] ; then +if [ -n "$CTDB_TEST_REAL_CLUSTER" -a -n "$CTDB_TEST_TIME_LOGGING" ] ; then echo "Starting time logging on each node..." f="/var/log/ctdb.test.time.log" onnode -p all "[ -f $f ] || while : ; do date '+%s %N' ; sleep 1 ; done >$f 2>&1 </dev/null &" & diff --git a/ctdb/tests/takeover/common.sh b/ctdb/tests/takeover/common.sh deleted file mode 100644 index 716e4d5fc7..0000000000 --- a/ctdb/tests/takeover/common.sh +++ /dev/null @@ -1,70 +0,0 @@ -# Hey Emacs, this is a -*- shell-script -*- !!! :-) - -# Print a message and exit. -die () { echo "$@" >&2 ; exit 1 ; } - -test_prog="$(dirname ${TAKEOVER_TESTS_DIR})/bin/ctdb_takeover_tests ctdb_takeover_run_core" - -define_test () -{ - _f="$0" - _f="${_f#./}" # strip leading ./ - _f="${_f#testcases/}" # strip leading testcases/ - _f="${_f%.sh}" # strip off .sh suffix if any - - case "$_f" in - nondet.*) - algorithm="nondet" - export CTDB_LCP2="no" - ;; - lcp2.*) - algorithm="lcp2" - export CTDB_LCP2="yes" - ;; - *) - die "Unknown algorithm for testcase \"$_f\"" - esac - - printf "%-12s - %s\n" "$_f" "$1" -} - -required_result () -{ - required_rc="${1:-0}" - required_output=$(cat) -} - -simple_test () -{ - _states="$1" - _out=$($test_prog $_states 2>&1) - _rc=$? - - if [ "$algorithm" = "lcp2" -a -n "$CTDB_TEST_LOGLEVEL" ] ; then - OUT_FILTER='s@^.*:@DATE TIME \[PID\]:@' - fi - - if [ -n "$OUT_FILTER" ] ; then - _fout=$(echo "$_out" | sed -r "$OUT_FILTER") - else - _fout="$_out" - fi - - if [ "$_fout" = "$required_output" -a $_rc = $required_rc ] ; then - echo "PASSED" - else - cat <<EOF -Algorithm: $algorithm - -################################################## -Required output (Exit status: ${required_rc}): -################################################## -$required_output -################################################## -Actual output (Exit status: ${_rc}): -################################################## -$_out -EOF - return 1 - fi -} diff --git a/ctdb/tests/takeover/testcases/lcp2.001.sh b/ctdb/tests/takeover/lcp2.001.sh index f792f5989f..8772318d6e 100755 --- a/ctdb/tests/takeover/testcases/lcp2.001.sh +++ b/ctdb/tests/takeover/lcp2.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 3 -> 1 healthy" diff --git a/ctdb/tests/takeover/testcases/lcp2.002.sh b/ctdb/tests/takeover/lcp2.002.sh index 17b85ee771..f3f6f0a6b1 100755 --- a/ctdb/tests/takeover/testcases/lcp2.002.sh +++ b/ctdb/tests/takeover/lcp2.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 3 -> 2 healthy" diff --git a/ctdb/tests/takeover/testcases/lcp2.003.sh b/ctdb/tests/takeover/lcp2.003.sh index f47ad88aad..f6cfe57b2d 100755 --- a/ctdb/tests/takeover/testcases/lcp2.003.sh +++ b/ctdb/tests/takeover/lcp2.003.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 1 -> all healthy" diff --git a/ctdb/tests/takeover/testcases/lcp2.004.sh b/ctdb/tests/takeover/lcp2.004.sh index a277bf6eef..c067184d38 100755 --- a/ctdb/tests/takeover/testcases/lcp2.004.sh +++ b/ctdb/tests/takeover/lcp2.004.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 1 -> all healthy, info logging" diff --git a/ctdb/tests/takeover/testcases/lcp2.005.sh b/ctdb/tests/takeover/lcp2.005.sh index 3dbe532cb6..4a8c0ea982 100755 --- a/ctdb/tests/takeover/testcases/lcp2.005.sh +++ b/ctdb/tests/takeover/lcp2.005.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 1 -> all healthy, debug logging" diff --git a/ctdb/tests/takeover/testcases/lcp2.006.sh b/ctdb/tests/takeover/lcp2.006.sh index 639796d6c2..13bb40fd69 100755 --- a/ctdb/tests/takeover/testcases/lcp2.006.sh +++ b/ctdb/tests/takeover/lcp2.006.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 0 -> 1 healthy" diff --git a/ctdb/tests/takeover/testcases/lcp2.007.sh b/ctdb/tests/takeover/lcp2.007.sh index b15fcd8313..76fa06e212 100755 --- a/ctdb/tests/takeover/testcases/lcp2.007.sh +++ b/ctdb/tests/takeover/lcp2.007.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 0 -> 2 healthy" diff --git a/ctdb/tests/takeover/testcases/lcp2.008.sh b/ctdb/tests/takeover/lcp2.008.sh index 48d8532cfd..f5c0af3a7c 100755 --- a/ctdb/tests/takeover/testcases/lcp2.008.sh +++ b/ctdb/tests/takeover/lcp2.008.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 0 -> all healthy" diff --git a/ctdb/tests/takeover/testcases/lcp2.009.sh b/ctdb/tests/takeover/lcp2.009.sh index df706369b8..e862c92807 100755 --- a/ctdb/tests/takeover/testcases/lcp2.009.sh +++ b/ctdb/tests/takeover/lcp2.009.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 3 healthy -> all disconnected" diff --git a/ctdb/tests/takeover/testcases/lcp2.010.sh b/ctdb/tests/takeover/lcp2.010.sh index c47b6528cd..20b1c98e65 100755 --- a/ctdb/tests/takeover/testcases/lcp2.010.sh +++ b/ctdb/tests/takeover/lcp2.010.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "2 disjoint groups of nodes/addresses, a node becomes healthy" diff --git a/ctdb/tests/takeover/lcp2.011.sh b/ctdb/tests/takeover/lcp2.011.sh new file mode 100755 index 0000000000..f752aa345e --- /dev/null +++ b/ctdb/tests/takeover/lcp2.011.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "2 disjoint groups of nodes/addresses, continue a stopped node" + +# Another LCP2 1.0 bug + +export CTDB_TEST_LOGLEVEL=0 + +required_result <<EOF +10.11.19.46 3 +10.11.19.45 3 +10.11.19.44 1 +10.11.18.46 1 +10.11.18.45 3 +10.11.18.44 1 +10.11.17.46 3 +10.11.17.45 3 +10.11.17.44 1 +10.11.16.46 1 +10.11.16.45 3 +10.11.16.44 1 +9.11.136.46 2 +9.11.136.45 0 +9.11.136.44 2 +EOF + +simple_test 0,0,0,0 <<EOF +9.11.136.44 2 0,2 +9.11.136.45 2 0,2 +9.11.136.46 2 0,2 +10.11.16.44 1 1,3 +10.11.16.45 3 1,3 +10.11.16.46 1 1,3 +10.11.17.44 1 1,3 +10.11.17.45 3 1,3 +10.11.17.46 3 1,3 +10.11.18.44 1 1,3 +10.11.18.45 3 1,3 +10.11.18.46 1 1,3 +10.11.19.44 1 1,3 +10.11.19.45 3 1,3 +10.11.19.46 3 1,3 +EOF diff --git a/ctdb/tests/takeover/lcp2.012.sh b/ctdb/tests/takeover/lcp2.012.sh new file mode 100755 index 0000000000..70dad93541 --- /dev/null +++ b/ctdb/tests/takeover/lcp2.012.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "Node with NODE_FLAGS_NOIPTAKEOVER doesn't gain IPs" + +export CTDB_TEST_LOGLEVEL=0 + +required_result <<EOF +192.168.21.254 1 +192.168.21.253 2 +192.168.21.252 1 +192.168.20.254 2 +192.168.20.253 2 +192.168.20.252 1 +192.168.20.251 2 +192.168.20.250 1 +192.168.20.249 1 +EOF + +simple_test 0x01000000,0,0 <<EOF +192.168.20.249 1 +192.168.20.250 1 +192.168.20.251 1 +192.168.20.252 1 +192.168.20.253 1 +192.168.20.254 1 +192.168.21.252 1 +192.168.21.253 1 +192.168.21.254 1 +EOF diff --git a/ctdb/tests/takeover/lcp2.013.sh b/ctdb/tests/takeover/lcp2.013.sh new file mode 100755 index 0000000000..4d01f12507 --- /dev/null +++ b/ctdb/tests/takeover/lcp2.013.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "Node with NODE_FLAGS_NOIPTAKEOVER doesn't lose IPs" + +export CTDB_TEST_LOGLEVEL=0 + +required_result <<EOF +192.168.21.254 2 +192.168.21.253 1 +192.168.21.252 0 +192.168.20.254 2 +192.168.20.253 1 +192.168.20.252 0 +192.168.20.251 2 +192.168.20.250 1 +192.168.20.249 0 +EOF + +simple_test 0x01000000,0,0 <<EOF +192.168.20.249 0 +192.168.20.250 1 +192.168.20.251 2 +192.168.20.252 0 +192.168.20.253 1 +192.168.20.254 2 +192.168.21.252 0 +192.168.21.253 1 +192.168.21.254 2 +EOF diff --git a/ctdb/tests/takeover/testcases/nondet.001.sh b/ctdb/tests/takeover/nondet.001.sh index 52f4598fb0..71506070c0 100755 --- a/ctdb/tests/takeover/testcases/nondet.001.sh +++ b/ctdb/tests/takeover/nondet.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 1 healthy" diff --git a/ctdb/tests/takeover/testcases/nondet.002.sh b/ctdb/tests/takeover/nondet.002.sh index 9a4ef44b4d..4ff801b1c4 100755 --- a/ctdb/tests/takeover/testcases/nondet.002.sh +++ b/ctdb/tests/takeover/nondet.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 2 healthy" diff --git a/ctdb/tests/takeover/testcases/nondet.003.sh b/ctdb/tests/takeover/nondet.003.sh index b75fc6d6f0..2a9dfb4679 100755 --- a/ctdb/tests/takeover/testcases/nondet.003.sh +++ b/ctdb/tests/takeover/nondet.003.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TAKEOVER_TESTS_DIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "3 nodes, 1 -> all healthy" diff --git a/ctdb/tests/takeover/run_tests.sh b/ctdb/tests/takeover/run_tests.sh deleted file mode 100755 index f019e8f9b5..0000000000 --- a/ctdb/tests/takeover/run_tests.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -# Run some IP allocation unit tests. - -cd $(dirname "$0") -export TAKEOVER_TESTS_DIR=$(pwd) - -test_dir=$(dirname "$TAKEOVER_TESTS_DIR") - -opts="-d" - -for i ; do - case "$i" in - -*) - opts="$opts $i" - shift - ;; - *) - break - esac -done - -tests="" -if [ -z "$*" ] ; then - tests=$(ls testcases/*.[0-9][0-9][0-9].sh 2>/dev/null) -fi - -"$test_dir/scripts/run_tests" $opts "$@" $tests || exit 1 - -echo "All OK" -exit 0 diff --git a/ctdb/tests/takeover/scripts/local.sh b/ctdb/tests/takeover/scripts/local.sh new file mode 100644 index 0000000000..ba46ef2651 --- /dev/null +++ b/ctdb/tests/takeover/scripts/local.sh @@ -0,0 +1,36 @@ +# Hey Emacs, this is a -*- shell-script -*- !!! :-) + +test_prog="$(dirname ${TEST_SUBDIR})/bin/ctdb_takeover_tests ctdb_takeover_run_core" + +define_test () +{ + _f=$(basename "$0" ".sh") + + case "$_f" in + nondet.*) + algorithm="nondet" + export CTDB_LCP2="no" + ;; + lcp2.*) + algorithm="lcp2" + export CTDB_LCP2="yes" + ;; + *) + die "Unknown algorithm for testcase \"$_f\"" + esac + + printf "%-12s - %s\n" "$_f" "$1" +} + +simple_test () +{ + # Do some filtering of the output to replace date/time. + if [ "$algorithm" = "lcp2" -a -n "$CTDB_TEST_LOGLEVEL" ] ; then + OUT_FILTER='s@^.*:@DATE\ TIME\ \[PID\]:@' + fi + + _states="$1" + _out=$($test_prog $_states 2>&1) + + result_check "Algorithm: $algorithm" +} diff --git a/ctdb/tests/takeover/README b/ctdb/tests/takeover/simulation/README index 4a8267bf6e..4a8267bf6e 100644 --- a/ctdb/tests/takeover/README +++ b/ctdb/tests/takeover/simulation/README diff --git a/ctdb/tests/takeover/ctdb_takeover.py b/ctdb/tests/takeover/simulation/ctdb_takeover.py index bc24fd4162..4b7ceef468 100755 --- a/ctdb/tests/takeover/ctdb_takeover.py +++ b/ctdb/tests/takeover/simulation/ctdb_takeover.py @@ -786,7 +786,7 @@ class Cluster(object): else: os.environ["CTDB_TEST_LOGLEVEL"] = "0" - p = subprocess.Popen("../bin/ctdb_takeover_tests ctdb_takeover_run_core %s 2>&1" % nodestates, + p = subprocess.Popen("../../bin/ctdb_takeover_tests ctdb_takeover_run_core %s 2>&1" % nodestates, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) p.stdin.write("\n".join(in_lines)) diff --git a/ctdb/tests/takeover/simulation/hey_jude.py b/ctdb/tests/takeover/simulation/hey_jude.py new file mode 100755 index 0000000000..a6b14c5c9b --- /dev/null +++ b/ctdb/tests/takeover/simulation/hey_jude.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +from ctdb_takeover import Cluster, Node, process_args + +process_args() + +addresses10 = ['10.4.20.%d' % n for n in range(154, 168)] +addresses172a = ['172.20.106.%d' % n for n in range(110, 124)] +addresses172b = ['172.20.107.%d' % n for n in range(110, 117)] + +c = Cluster() + +#for i in range(7): +# c.add_node(Node([addresses10, addresses172])) + + +for i in range(4): + c.add_node(Node([addresses172a, addresses172b])) +for i in range(3): + c.add_node(Node(addresses10)) + +c.recover() + +c.random_iterations() diff --git a/ctdb/tests/takeover/ip_groups1.py b/ctdb/tests/takeover/simulation/ip_groups1.py index 0808f466cf..0808f466cf 100755 --- a/ctdb/tests/takeover/ip_groups1.py +++ b/ctdb/tests/takeover/simulation/ip_groups1.py diff --git a/ctdb/tests/takeover/ip_groups2.py b/ctdb/tests/takeover/simulation/ip_groups2.py index c6c1026646..c6c1026646 100755 --- a/ctdb/tests/takeover/ip_groups2.py +++ b/ctdb/tests/takeover/simulation/ip_groups2.py diff --git a/ctdb/tests/takeover/ip_groups3.py b/ctdb/tests/takeover/simulation/ip_groups3.py index 149946d72b..149946d72b 100755 --- a/ctdb/tests/takeover/ip_groups3.py +++ b/ctdb/tests/takeover/simulation/ip_groups3.py diff --git a/ctdb/tests/takeover/ip_groups4.py b/ctdb/tests/takeover/simulation/ip_groups4.py index fdcef7f0a6..fdcef7f0a6 100755 --- a/ctdb/tests/takeover/ip_groups4.py +++ b/ctdb/tests/takeover/simulation/ip_groups4.py diff --git a/ctdb/tests/takeover/ip_groups5.py b/ctdb/tests/takeover/simulation/ip_groups5.py index 8c46150638..8c46150638 100755 --- a/ctdb/tests/takeover/ip_groups5.py +++ b/ctdb/tests/takeover/simulation/ip_groups5.py diff --git a/ctdb/tests/takeover/mgmt_simple.py b/ctdb/tests/takeover/simulation/mgmt_simple.py index f891199655..f891199655 100755 --- a/ctdb/tests/takeover/mgmt_simple.py +++ b/ctdb/tests/takeover/simulation/mgmt_simple.py diff --git a/ctdb/tests/takeover/node_group.py b/ctdb/tests/takeover/simulation/node_group.py index bf7de58aa9..bf7de58aa9 100755 --- a/ctdb/tests/takeover/node_group.py +++ b/ctdb/tests/takeover/simulation/node_group.py diff --git a/ctdb/tests/takeover/node_group_extra.py b/ctdb/tests/takeover/simulation/node_group_extra.py index 7e9e518bdd..7e9e518bdd 100755 --- a/ctdb/tests/takeover/node_group_extra.py +++ b/ctdb/tests/takeover/simulation/node_group_extra.py diff --git a/ctdb/tests/takeover/node_group_simple.py b/ctdb/tests/takeover/simulation/node_group_simple.py index 3c58ef7314..3c58ef7314 100755 --- a/ctdb/tests/takeover/node_group_simple.py +++ b/ctdb/tests/takeover/simulation/node_group_simple.py diff --git a/ctdb/tests/takeover/nondet_path_01.py b/ctdb/tests/takeover/simulation/nondet_path_01.py index a62847a216..a62847a216 100755 --- a/ctdb/tests/takeover/nondet_path_01.py +++ b/ctdb/tests/takeover/simulation/nondet_path_01.py diff --git a/ctdb/tests/tool/common.sh b/ctdb/tests/tool/common.sh deleted file mode 100644 index 506c7d0c4c..0000000000 --- a/ctdb/tests/tool/common.sh +++ /dev/null @@ -1,79 +0,0 @@ -# Hey Emacs, this is a -*- shell-script -*- !!! :-) - -# Print a message and exit. -die () { echo "$@" >&2 ; exit 1 ; } - -test_bin="$(dirname ${TESTS_SUBDIR})/bin" - -define_test () -{ - _f="$0" - _f="${_f#./}" # strip leading ./ - _f="${_f#testcases/}" # strip leading testcases/ - _f="${_f%.sh}" # strip off .sh suffix if any - - case "$_f" in - func.*) - _func="${_f#func.}" - _func="${_func%.*}" # Strip test number - test_prog="${test_bin}/ctdb_tool_libctdb ${_func}" - ;; - stubby.*) - _cmd="${_f#stubby.}" - _cmd="${_cmd%.*}" # Strip test number - test_prog="${test_bin}/ctdb_tool_stubby ${_cmd}" - ;; - *) - die "Unknown pattern for testcase \"$_f\"" - esac - - printf "%-28s - %s\n" "$_f" "$1" -} - -required_result () -{ - required_rc="${1:-0}" - required_output=$(cat) -} - -simple_test () -{ - _out=$($test_prog "$@" 2>&1) - _rc=$? - - # Most of the tests when the tool fails will have a date/time/pid - # prefix. Strip that because it isn't possible to match it. - if [ $required_rc -ne 0 ] ; then - OUT_FILTER='s@^[0-9/]+ [0-9:\.]+ \[[ 0-9]+\]:@DATE TIME \[PID\]:@' - fi - - if [ -n "$OUT_FILTER" ] ; then - _fout=$(echo "$_out" | sed -r "$OUT_FILTER") - else - _fout="$_out" - fi - - if [ "$_fout" = "$required_output" -a $_rc = $required_rc ] ; then - if [ "$TESTS_VERBOSE" = "yes" ] ; then - cat <<EOF -################################################## -Output (Exit status: ${_rc}): -################################################## -$_fout -EOF - fi - echo "PASSED" - else - cat -A <<EOF -################################################## -Required output (Exit status: ${required_rc}): -################################################## -$required_output -################################################## -Actual output (Exit status: ${_rc}): -################################################## -$_fout -EOF - return 1 - fi -} diff --git a/ctdb/tests/tool/testcases/func.parse_nodestring.001.sh b/ctdb/tests/tool/func.parse_nodestring.001.sh index 04447cbb6a..d7caf89da9 100755 --- a/ctdb/tests/tool/testcases/func.parse_nodestring.001.sh +++ b/ctdb/tests/tool/func.parse_nodestring.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TESTS_SUBDIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all, dd_ok, 3 healthy" diff --git a/ctdb/tests/tool/testcases/func.parse_nodestring.002.sh b/ctdb/tests/tool/func.parse_nodestring.002.sh index f5b9777af2..c89e444eaf 100755 --- a/ctdb/tests/tool/testcases/func.parse_nodestring.002.sh +++ b/ctdb/tests/tool/func.parse_nodestring.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TESTS_SUBDIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all, dd_ok, 2 ok/1 disconnected" diff --git a/ctdb/tests/tool/testcases/func.parse_nodestring.003.sh b/ctdb/tests/tool/func.parse_nodestring.003.sh index 709bfa20e4..3e03ac4041 100755 --- a/ctdb/tests/tool/testcases/func.parse_nodestring.003.sh +++ b/ctdb/tests/tool/func.parse_nodestring.003.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TESTS_SUBDIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all, current disconnected" diff --git a/ctdb/tests/tool/run_tests.sh b/ctdb/tests/tool/run_tests.sh deleted file mode 100755 index cf683228a9..0000000000 --- a/ctdb/tests/tool/run_tests.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -# Run some IP allocation unit tests. - -cd $(dirname "$0") -export TESTS_SUBDIR=$(pwd) - -test_dir=$(dirname "$TESTS_SUBDIR") - -opts="-d" - -for i ; do - case "$i" in - -v) - export TESTS_VERBOSE="yes" - shift - ;; - -*) - opts="$opts $i" - shift - ;; - *) - break - esac -done - -tests="" -if [ -z "$*" ] ; then - tests=$(ls testcases/*.[0-9][0-9][0-9].sh 2>/dev/null) -fi - -"$test_dir/scripts/run_tests" $opts "$@" $tests || exit 1 - -echo "All OK" -exit 0 diff --git a/ctdb/tests/tool/scripts/local.sh b/ctdb/tests/tool/scripts/local.sh new file mode 100644 index 0000000000..1105628a4b --- /dev/null +++ b/ctdb/tests/tool/scripts/local.sh @@ -0,0 +1,38 @@ +# Hey Emacs, this is a -*- shell-script -*- !!! :-) + +test_bin="$(dirname ${TEST_SUBDIR})/bin" + +define_test () +{ + _f=$(basename "$0" ".sh") + + case "$_f" in + func.*) + _func="${_f#func.}" + _func="${_func%.*}" # Strip test number + test_prog="${test_bin}/ctdb_tool_libctdb ${_func}" + ;; + stubby.*) + _cmd="${_f#stubby.}" + _cmd="${_cmd%.*}" # Strip test number + test_prog="${test_bin}/ctdb_tool_stubby ${_cmd}" + ;; + *) + die "Unknown pattern for testcase \"$_f\"" + esac + + printf "%-28s - %s\n" "$_f" "$1" +} + +simple_test () +{ + # Most of the tests when the tool fails will have a date/time/pid + # prefix. Strip that because it isn't possible to match it. + if [ $required_rc -ne 0 ] ; then + OUT_FILTER='s@^[0-9/]+\ [0-9:\.]+\ \[[\ 0-9]+\]:@DATE\ TIME\ \[PID\]:@' + fi + + _out=$($test_prog "$@" 2>&1) + + result_check +} diff --git a/ctdb/tests/tool/testcases/stubby.nodestatus.001.sh b/ctdb/tests/tool/stubby.nodestatus.001.sh index 1d364277af..6392b8d1ec 100755 --- a/ctdb/tests/tool/testcases/stubby.nodestatus.001.sh +++ b/ctdb/tests/tool/stubby.nodestatus.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TESTS_SUBDIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all, 3 nodes, all OK" diff --git a/ctdb/tests/tool/testcases/stubby.nodestatus.002.sh b/ctdb/tests/tool/stubby.nodestatus.002.sh index 9e311b2d7d..f5b1909a07 100755 --- a/ctdb/tests/tool/testcases/stubby.nodestatus.002.sh +++ b/ctdb/tests/tool/stubby.nodestatus.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TESTS_SUBDIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "-n all, 3 nodes, all OK" diff --git a/ctdb/tests/tool/testcases/stubby.nodestatus.003.sh b/ctdb/tests/tool/stubby.nodestatus.003.sh index 28837d0af8..a3a7a42e43 100755 --- a/ctdb/tests/tool/testcases/stubby.nodestatus.003.sh +++ b/ctdb/tests/tool/stubby.nodestatus.003.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TESTS_SUBDIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all, 3 nodes, 1 disconnected" diff --git a/ctdb/tests/tool/testcases/stubby.nodestatus.004.sh b/ctdb/tests/tool/stubby.nodestatus.004.sh index 0679f62aa6..bc9890590c 100755 --- a/ctdb/tests/tool/testcases/stubby.nodestatus.004.sh +++ b/ctdb/tests/tool/stubby.nodestatus.004.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TESTS_SUBDIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "-n all, 3 nodes, 1 disconnected" diff --git a/ctdb/tests/tool/stubby.nodestatus.005.sh b/ctdb/tests/tool/stubby.nodestatus.005.sh new file mode 100755 index 0000000000..cb532e7c82 --- /dev/null +++ b/ctdb/tests/tool/stubby.nodestatus.005.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "-n all all, 3 nodes, 1 disconnected" + +required_result 1 <<EOF +Number of nodes:3 +pnn:0 192.168.20.41 OK (THIS NODE) +pnn:1 192.168.20.42 DISCONNECTED|INACTIVE +pnn:2 192.168.20.43 OK +Number of nodes:3 +pnn:0 192.168.20.41 OK +pnn:1 192.168.20.42 DISCONNECTED|INACTIVE +pnn:2 192.168.20.43 OK (THIS NODE) +EOF + +simple_test -n all all <<EOF +NODEMAP +0 192.168.20.41 0x0 +1 192.168.20.42 0x1 +2 192.168.20.43 0x0 CURRENT RECMASTER + +IFACES +:Name:LinkStatus:References: +:eth2:1:2: +:eth1:1:4: + +VNNMAP +654321 +0 +1 +2 +EOF diff --git a/ctdb/tests/tool/testcases/stubby.status.001.sh b/ctdb/tests/tool/stubby.status.001.sh index 74cdc39c22..48b5bac24a 100755 --- a/ctdb/tests/tool/testcases/stubby.status.001.sh +++ b/ctdb/tests/tool/stubby.status.001.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TESTS_SUBDIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all, 3 nodes, all ok" diff --git a/ctdb/tests/tool/testcases/stubby.status.002.sh b/ctdb/tests/tool/stubby.status.002.sh index 77d3cc2237..fceceb30e0 100755 --- a/ctdb/tests/tool/testcases/stubby.status.002.sh +++ b/ctdb/tests/tool/stubby.status.002.sh @@ -1,6 +1,6 @@ #!/bin/sh -. "${TESTS_SUBDIR}/common.sh" +. "${TEST_SCRIPTS_DIR}/unit.sh" define_test "all, 3 nodes, 1 unhealthy" |