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
Enable local repos when none enabled #6797
Conversation
90f49b9
to
e13472e
Compare
tests/autoyast/repos.pm
Outdated
@@ -25,6 +25,8 @@ sub run { | |||
# sles12_minimal.xml profile does not install "ip" | |||
assert_script_run 'ip a || ifstatus all'; | |||
pkcon_quit; | |||
# If no repository is enabled, enable all repositories | |||
script_run('zypper lr |cut -d \| -f 4 |grep " Yes " 2>&1>/dev/null') && zypper_call 'mr -ea'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only problem I see with this command is that it will break once we have Enabled
as different column in the output. Good part about #6796 that it also limits it to the case when it's actually required (which is only all packaged DVD case).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't match "Enabled" since we grep " Yes ", or I misunderstand what you mean. I am testing a mix of both : check if we are in a case where this is required as in #6796, then check if the cd/dvd repo is disabled, and only then, enable local repos with zypper mr -el (not -ea anymore) just in case things would change in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean here you rely that "enabled" if 4-th column, if happens that it becomes 3-rd or 5-th, this will break, so I would use settings from the job as in #6796 to trigger this behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why the order of columns would change. I tested this in various situations.
The thing is, #6796 is fine but if there is a change again, eg if in 15.2 the repos are enabled, then it will try to enable the repos even if they are already enabled.
But anyway, it does not really matter :
susetest:/home/bernhard # zypper mr -el
Nothing to change for repository 'SLES15-SP1-15.1-0'.
susetest:/home/bernhard # echo $?
0
"zypper mr -el" returns 0 in any case, so we could as well not test anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already get that changed for snapper, so it's hard to predict. The only thing I would like to see is that we duplicate #6796, so could you please extract yours/other implementation and use it in both places?
e13472e
to
3d9e12e
Compare
Updated, now using partially #6796. Also edited the tescases in description |
Please, squash your commits and we can merge |
3e23a0c
to
7077df7
Compare
In some cases, all repositories are disabled, and the whole SUT fails. Added some tests to probe that case, and enable local repositories when needed.
SLE 15 SP1, repos are disabled so we enable them:
http://amazing.suse.cz/tests/3603
Other case where the repos. are already enabled, so we do nothing:
http://amazing.suse.cz/tests/3602