redhat-qe-security / SCAutolib

Library for automation of smart card testing
GNU General Public License v3.0
3 stars 10 forks source link

Test should not pass if run_cmd hit time out while sending PIN/password. #14

Open mahavrila opened 2 years ago

mahavrila commented 2 years ago

I passwd argument is specified, run_cmd waits for "PIN for" or "Password" string. If it times out while waiting for pin/passwd the test should fail.

mahavrila commented 2 years ago

EDIT: this seems to cause fail in dev branch, while when kerberos-integration branch is used, it just pass.

x00Pavel commented 2 years ago

run_cmd has to be replaced with a more general run function

mahavrila commented 2 years ago

run_cmd has to be replaced with a more general run function

general run command as implemented in V2 is wrapper for subprocess, while run_cmd is wrapper around pexpect specifically designed for testing logins. Tests relies on this functionality so I don't think it can be easily replaced by general run command.

x00Pavel commented 2 years ago

run_cmd now has bad implementation, it wouldn't even do what the user (me) would expect from it. So, this function needs very strict revisioning if we would still want to use it because even with the old version of the library, we implemented in tests the fixture that does most of what run_cmd do, but from my perspective in a more clear way. So, ok, maybe simple replacing with the run command is not a very good idea, but run_cmd curtenly need an upgrade and can't stay as it it

mahavrila commented 2 years ago

I completely agree, run_cmd should be improved and maybe also renamed or moved to fixture. My only concern was to minimize rewriting of existing tests.