summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/run_tests8
-rw-r--r--tests/white-box/couchdb.rb2
-rw-r--r--tests/white-box/mx.rb2
-rw-r--r--tests/white-box/openvpn.rb4
-rw-r--r--tests/white-box/soledad.rb17
-rw-r--r--tests/white-box/webapp.rb2
6 files changed, 30 insertions, 5 deletions
diff --git a/bin/run_tests b/bin/run_tests
index b3e60fcc..4addc0c8 100755
--- a/bin/run_tests
+++ b/bin/run_tests
@@ -36,6 +36,14 @@ def bail(code, msg=nil)
end
##
+## UTILITY
+##
+
+def service?(service)
+ $node["services"].include?(service.to_s)
+end
+
+##
## EXCEPTIONS
##
diff --git a/tests/white-box/couchdb.rb b/tests/white-box/couchdb.rb
index d438b193..2788f4f7 100644
--- a/tests/white-box/couchdb.rb
+++ b/tests/white-box/couchdb.rb
@@ -1,4 +1,4 @@
-raise SkipTest unless $node["services"].include?("couchdb")
+raise SkipTest unless service?(:couchdb)
require 'json'
diff --git a/tests/white-box/mx.rb b/tests/white-box/mx.rb
index da780de4..794a9a41 100644
--- a/tests/white-box/mx.rb
+++ b/tests/white-box/mx.rb
@@ -1,4 +1,4 @@
-raise SkipTest unless $node["services"].include?("mx")
+raise SkipTest unless service?(:mx)
require 'json'
diff --git a/tests/white-box/openvpn.rb b/tests/white-box/openvpn.rb
index 5eb2bdb5..23a40426 100644
--- a/tests/white-box/openvpn.rb
+++ b/tests/white-box/openvpn.rb
@@ -1,6 +1,6 @@
-raise SkipTest unless $node["services"].include?("openvpn")
+raise SkipTest unless service?(:openvpn)
-class Openvpn < LeapTest
+class OpenVPN < LeapTest
depends_on "Network"
def setup
diff --git a/tests/white-box/soledad.rb b/tests/white-box/soledad.rb
new file mode 100644
index 00000000..5a13e4a6
--- /dev/null
+++ b/tests/white-box/soledad.rb
@@ -0,0 +1,17 @@
+raise SkipTest unless service?(:soledad)
+
+require 'json'
+
+class Soledad < LeapTest
+ depends_on "Network"
+ depends_on "CouchDB" if service?(:couchdb)
+
+ def setup
+ end
+
+ def test_00_Is_Soledad_running?
+ assert_running 'soledad'
+ pass
+ end
+
+end
diff --git a/tests/white-box/webapp.rb b/tests/white-box/webapp.rb
index 0fea1c7f..2aa87403 100644
--- a/tests/white-box/webapp.rb
+++ b/tests/white-box/webapp.rb
@@ -1,4 +1,4 @@
-raise SkipTest unless $node["services"].include?("webapp")
+raise SkipTest unless service?(:webapp)
require 'json'