SELinuxProject / selinux-testsuite

This is the upstream SELinux testsuite which is designed as a basic set of regression tests for the SELinux kernel functionality.
GNU General Public License v2.0
54 stars 43 forks source link

tests/inet_socket: fix output of planned tests count #3

Closed jstancek closed 8 years ago

jstancek commented 8 years ago

Stephen reported that commit 1ae80460699819ce0e7360c315a3803ee271e11f has introduced a small problem to test output. While the test is progressing as you watch output of "make test", you'll see that it displays its progress as N/? (e.g. 17/?) while executing the inet_socket tests, as if it does not know the final count.

The reason appears to be that perl implementation does not expect any output before you define a "plan", but commit above introduced system() call, which now generates some output. Consequence of that is that report function (TAP::Formatter::Console::Session) is called before TAP::Parser initialized "plan", and it creates wrong format string which it then keeps for the duration of test.

Reported-by: Stephen Smalley sds@tycho.nsa.gov Signed-off-by: Jan Stancek jstancek@redhat.com