Some systems come with empty iptables rules. In this context, the
assert_iptables_allow "tcp" test would fail.
This patch adds a rule during test setup, and removes it at test
teardown so the aformentionned test can match something.
Fixed assert_in_file
In the 'negate' part of the function, assert_in_file was previously
written as bash && fail || pass chain.
However, since fail() exits with 1, the 'or' (||) part was always
executed too.
So when assert_in_file was called with a string that WAS in the file
(and thus, was supposed to returl FAIL), il always returns two tests
results (FAIL, then PASS).
The logic has been changed so only fail xor pass is now called.
However, since rolespec own test suite rely on displaying 'FAIL' or
'PASS' in the console, there is currently no way to write a regression
test for rolespec own test suite, since it would mean writing, on
purpose, a test that fails and check that the test indeed FAILs (and
doesn't FAIL and then PASS), which is not possible.
Some systems come with empty iptables rules. In this context, the
assert_iptables_allow "tcp"
test would fail. This patch adds a rule during test setup, and removes it at test teardown so the aformentionned test can match something.In the 'negate' part of the function,
assert_in_file
was previously written as bash&& fail || pass
chain. However, since fail() exits with 1, the 'or' (||
) part was always executed too. So whenassert_in_file
was called with a string that WAS in the file (and thus, was supposed to returl FAIL), il always returns two tests results (FAIL, then PASS). The logic has been changed so only fail xor pass is now called.However, since rolespec own test suite rely on displaying 'FAIL' or 'PASS' in the console, there is currently no way to write a regression test for rolespec own test suite, since it would mean writing, on purpose, a test that fails and check that the test indeed FAILs (and doesn't FAIL and then PASS), which is not possible.