diff options
author | elijah <elijah@riseup.net> | 2013-12-30 18:04:30 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-12-30 18:04:30 -0800 |
commit | 353475da8d535f2904e68977c3dafa6bb3bb483a (patch) | |
tree | beb01b13f2f2b2e2040e0ece1bf1db13523b6e4f | |
parent | 71f2d1b0b7db6bb35dd6bd9220795aed3174d90b (diff) |
tests -- added tests to check that the right processes are running
-rwxr-xr-x | bin/run_tests | 4 | ||||
-rw-r--r-- | tests/white-box/couchdb.rb | 9 | ||||
-rw-r--r-- | tests/white-box/openvpn.rb | 16 | ||||
-rw-r--r-- | tests/white-box/webapp.rb | 6 |
4 files changed, 34 insertions, 1 deletions
diff --git a/bin/run_tests b/bin/run_tests index f4778988..a44fcdcf 100755 --- a/bin/run_tests +++ b/bin/run_tests @@ -249,6 +249,10 @@ class LeapTest < MiniTest::Unit::TestCase end end +def assert_running(process) + assert pgrep(process).any?, "No running process for #{process}" +end + # # Custom test runner in order to modify the output. # diff --git a/tests/white-box/couchdb.rb b/tests/white-box/couchdb.rb index c83e5714..93551367 100644 --- a/tests/white-box/couchdb.rb +++ b/tests/white-box/couchdb.rb @@ -8,10 +8,17 @@ class TestCouchdb < LeapTest def setup end + def test_00_daemons_running + assert_running 'tapicero' + assert_running 'bin/beam' + assert_running 'bin/epmd' + pass + end + # # check to make sure we can get welcome response from local couchdb # - def test_01_couch_is_running + def test_01_couch_is_working assert_get(couchdb_url) do |body| assert_match /"couchdb":"Welcome"/, body, "Could not get welcome message from #{couchdb_url}. Probably couchdb is not running." end diff --git a/tests/white-box/openvpn.rb b/tests/white-box/openvpn.rb new file mode 100644 index 00000000..2b1276f4 --- /dev/null +++ b/tests/white-box/openvpn.rb @@ -0,0 +1,16 @@ +raise SkipTest unless $node["services"].include?("openvpn") + +class TestOpenvpn < LeapTest + depends_on "TestNetwork" + + def setup + end + + def test_01_daemons_running + assert_running '/usr/sbin/openvpn .* /etc/openvpn/tcp_config.conf' + assert_running '/usr/sbin/openvpn .* /etc/openvpn/udp_config.conf' + assert_running '/usr/sbin/unbound' + pass + end + +end diff --git a/tests/white-box/webapp.rb b/tests/white-box/webapp.rb index aaad4426..09e92797 100644 --- a/tests/white-box/webapp.rb +++ b/tests/white-box/webapp.rb @@ -54,4 +54,10 @@ class TestWebapp < LeapTest pass end + def test_03_daemons_running + assert_running '/usr/sbin/apache2' + assert_running '/usr/bin/nickserver' + pass + end + end |