summaryrefslogtreecommitdiff
path: root/tests/white-box
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-06-25 23:54:16 -0700
committerelijah <elijah@riseup.net>2014-06-25 23:54:16 -0700
commit8d5c14b26b6f95285d9ed2b17c61d18d5de005e6 (patch)
tree3c80521475a87295995e1fad067dc9ff94a892c6 /tests/white-box
parentd6eabb09f978f1501b8b797d28e949a2e00ac82e (diff)
fix tests for new 0.6 format
Diffstat (limited to 'tests/white-box')
-rw-r--r--tests/white-box/couchdb.rb4
-rw-r--r--tests/white-box/network.rb33
2 files changed, 17 insertions, 20 deletions
diff --git a/tests/white-box/couchdb.rb b/tests/white-box/couchdb.rb
index 58a24731..74bd47bf 100644
--- a/tests/white-box/couchdb.rb
+++ b/tests/white-box/couchdb.rb
@@ -31,7 +31,7 @@ class CouchDB < LeapTest
# compare the configured nodes to the nodes that are actually listed in bigcouch
#
def test_02_Is_cluster_membership_ok?
- skip "not a multimaster node" unless multimater?
+ return unless multimaster?
url = couchdb_backend_url("/nodes/_all_docs")
neighbors = assert_property('couch.bigcouch.neighbors')
neighbors << assert_property('domain.full')
@@ -51,7 +51,7 @@ class CouchDB < LeapTest
# this seems backward to me, so it might be the other way around.
#
def test_03_Are_configured_nodes_online?
- skip "not a multimaster node" unless multimater?
+ return unless multimaster?
url = couchdb_url("/_membership", :user => 'admin')
assert_get(url) do |body|
response = JSON.parse(body)
diff --git a/tests/white-box/network.rb b/tests/white-box/network.rb
index e0b0339d..118861a7 100644
--- a/tests/white-box/network.rb
+++ b/tests/white-box/network.rb
@@ -28,29 +28,26 @@ class Network < LeapTest
def test_02_Is_stunnel_running?
if $node['stunnel']
good_stunnel_pids = []
- $node['stunnel'].each do |stunnel_type, stunnel_configs|
- if stunnel_type =~ /_clients?$/
- stunnel_configs.each do |stunnel_name, stunnel_conf|
- config_file_name = "/etc/stunnel/#{stunnel_name}.conf"
- processes = pgrep(config_file_name)
- assert_equal 6, processes.length, "There should be six stunnel processes running for `#{config_file_name}`"
- good_stunnel_pids += processes.map{|ps| ps[:pid]}
- assert port = stunnel_conf['accept_port'], 'Field `accept_port` must be present in `stunnel` property.'
- assert_tcp_socket('localhost', port)
- end
- elsif stunnel_type =~ /_server$/
- config_file_name = "/etc/stunnel/#{stunnel_type}.conf"
+ $node['stunnel']['clients'].each do |stunnel_type, stunnel_configs|
+ stunnel_configs.each do |stunnel_name, stunnel_conf|
+ config_file_name = "/etc/stunnel/#{stunnel_name}.conf"
processes = pgrep(config_file_name)
assert_equal 6, processes.length, "There should be six stunnel processes running for `#{config_file_name}`"
good_stunnel_pids += processes.map{|ps| ps[:pid]}
- assert accept = stunnel_configs['accept'], "Field `accept` must be present in property `stunnel.#{stunnel_type}`"
- assert_tcp_socket('localhost', accept)
- assert connect = stunnel_configs['connect'], "Field `connect` must be present in property `stunnel.#{stunnel_type}`"
- assert_tcp_socket(*connect.split(':'))
- else
- skip "Unknown stunnel type `#{stunnel_type}`"
+ assert port = stunnel_conf['accept_port'], 'Field `accept_port` must be present in `stunnel` property.'
+ assert_tcp_socket('localhost', port)
end
end
+ $node['stunnel']['servers'].each do |stunnel_name, stunnel_conf|
+ config_file_name = "/etc/stunnel/#{stunnel_name}.conf"
+ processes = pgrep(config_file_name)
+ assert_equal 6, processes.length, "There should be six stunnel processes running for `#{config_file_name}`"
+ good_stunnel_pids += processes.map{|ps| ps[:pid]}
+ assert accept_port = stunnel_conf['accept_port'], "Field `accept` must be present in property `stunnel.servers.#{stunnel_name}`"
+ assert_tcp_socket('localhost', accept_port)
+ assert connect_port = stunnel_conf['connect_port'], "Field `connect` must be present in property `stunnel.servers.#{stunnel_name}`"
+ assert_tcp_socket('localhost', connect_port)
+ end
all_stunnel_pids = pgrep('/usr/bin/stunnel').collect{|process| process[:pid]}.uniq
assert_equal good_stunnel_pids.sort, all_stunnel_pids.sort, "There should not be any extra stunnel processes that are not configured in /etc/stunnel"
pass