From 353475da8d535f2904e68977c3dafa6bb3bb483a Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 30 Dec 2013 18:04:30 -0800 Subject: tests -- added tests to check that the right processes are running --- tests/white-box/couchdb.rb | 9 ++++++++- tests/white-box/openvpn.rb | 16 ++++++++++++++++ tests/white-box/webapp.rb | 6 ++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 tests/white-box/openvpn.rb (limited to 'tests') 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 -- cgit v1.2.3