Skip to content

tests: dump output of invoked commands - #302

Open
cgzones wants to merge 1 commit into
SELinuxProject:mainfrom
cgzones:dump_output
Open

cgzones wants to merge 1 commit into
SELinuxProject:mainfrom
cgzones:dump_output

Conversation

@cgzones

@cgzones cgzones commented Apr 9, 2025

Copy link
Copy Markdown
Contributor

Dump the output of invoked commands in the functional tests, so that they are shown when the testcase fails, to ease debugging. (The output is not shown in case the testcase succeeds.)

Inspired due to a valgrind failure on armhf on Debian buildd.

Comment thread tests/functional/end-to-end.bats Outdated
count=$(echo ${output} | grep -o "W-002" | wc -l)
echo "Status: $status, Count: $count (expected 1)"
echo $output
echo ${output}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this and the remaining echo calls in this function just be dropped? It looks like it's just printing the same output four times in a row.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, dropped superfluous statements

Comment thread tests/functional/end-to-end.bats Outdated
count=$(echo ${output} | grep -o "W-002" | wc -l)
echo "Status: $status, Count: $count (expected 0)"
echo $output
echo ${output}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, this one now seems redundant to the one above.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(In this case, the subsequent ones in the function all follow a run, so for this test, it's just this line that I think needs dropping).

Dump the output of invoked commands in the functional tests, so that
they are shown when the testcase fails, to ease debugging. (The output
is not shown in case the testcase succeeds.)

Inspired due to a valgrind failure on armhf on Debian buildd.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants