New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert_script_run needlessly(?) re-implements script_run #1158
Comments
this is historic - as script_run did nothing of this at the beginning. |
sorry, this was meant to be on os-autoinst, dunno how it wound up here. so you'd accept a PR to remove the duplication? |
sounds reasonable |
rgr, will do it if I get a minute. the documentation of |
thanks for reading our documentation every evening :) |
also while I'm asking 'why'...why is |
well, last time I touched this everyone was protesting that testapi should not contain linux specific stuff like serial handling and that windows distributions would have a different way to run scripts. I don't really care for that use cases - and SUSE no longer has its own script_run in our distribution (from what grep says), so I would opt for easy design. |
well, |
yes, but distribution you can overload in your test distri - testapi not. So either we have everything with serial to distribution or we just drop the idea of being portable. |
yes, I guess the architecture should be improved and we should make sure layers are not mixed. I am for keeping the thing portable and improve on that. Also, I tried the idea to extract the "GNU/Linux" specific parts but failed so far on circular dependencies. I guess moving more into the "distribution" for that matter would help there. |
Yeah, I do see. I'll keep the split. So in theory, if |
yes, true. also see os-autoinst/os-autoinst#690 for some related doc updates |
I don't think there is a problem with making assert_script_run a wrapper and avoid more unportable bits in testapi |
So os-autoinst/os-autoinst#694 does that. I had a more ambitious version that also harmonized |
this looks resolved |
Maybe there's something I'm missing here, but why do
assert_script_run
anddistribution::script_run
have more or less identical code for running the command, directing the exit code plus a kinda 'salt' to the serial output, and then deciding if the script passed or failed?distribution::script_run
:assert_script_run
:in fact,
assert_script_run
has to go out of its way to callscript_run
with a 0 timeout to avoid hitting the code that does more or less the same thing it's about to do itself!Why doesn't
assert_script_run
just callscript_run
with whatever timeout it was given, take the exit code thatscript_run
returns, and then decide whether to return or die based on that? Am I missing something?The text was updated successfully, but these errors were encountered: