redhat-qe-security / SCAutolib

Library for automation of smart card testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add "allowed exit codes" to check_output function

mahavrila opened this issue · comments

In certain scenarios, it could be beneficial to check that exit code of command has exact (non-zero) value.
Example: We test that SC authentication fails if user types wrong pin. We evaluate presence of string "Authentication failure" and if this string is present, our test pass. However, we need to turn off (which is default) check of exit code because failing authentication will of course provide (expected) non-zero exit code. It would be nice to monitor exit code of failing authentication to make sure it has always the same value - it's failing the same way.

P.S.: This does not hurry.

Now there is run function what checks return code of the command by default