From a3f923e66b05ffc12037b239995f463f81ea229d Mon Sep 17 00:00:00 2001 From: elijah Date: Tue, 13 May 2014 02:14:37 -0700 Subject: added simple shorewall whitebox test (close #5649) --- bin/run_tests | 10 ++++++++++ tests/white-box/network.rb | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/bin/run_tests b/bin/run_tests index 9102c325..526aa83a 100755 --- a/bin/run_tests +++ b/bin/run_tests @@ -287,6 +287,16 @@ def assert_running(process) assert pgrep(process).any?, "No running process for #{process}" end +# +# runs the specified command, failing on a non-zero exit status. +# +def assert_run(command) + output = `#{command}` + if $?.exitstatus != 0 + fail "Error running `#{command}`:\n#{output}" + end +end + # # Custom test runner in order to modify the output. # diff --git a/tests/white-box/network.rb b/tests/white-box/network.rb index 955857dc..e0b0339d 100644 --- a/tests/white-box/network.rb +++ b/tests/white-box/network.rb @@ -57,4 +57,9 @@ class Network < LeapTest end end + def test_03_Is_shorewall_running? + assert_run('/sbin/shorewall status') + pass + end + end -- cgit v1.2.3