Skip to content
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

Closed
wants to merge 0 commits into from

Conversation

JRivrain
Copy link
Contributor

@JRivrain JRivrain commented Feb 14, 2019

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.

@JRivrain JRivrain changed the title Enable all repos when none enabled [WIP]Enable all repos when none enabled Feb 15, 2019
@@ -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';
Copy link
Member

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).

Copy link
Contributor Author

@JRivrain JRivrain Feb 15, 2019

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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?

@JRivrain
Copy link
Contributor Author

JRivrain commented Feb 15, 2019

Updated, now using partially #6796. Also edited the tescases in description

@JRivrain JRivrain changed the title [WIP]Enable all repos when none enabled Enable all repos when none enabled Feb 15, 2019
@JRivrain JRivrain changed the title Enable all repos when none enabled Enable local repos when none enabled Feb 15, 2019
@rwx788
Copy link
Member

rwx788 commented Feb 18, 2019

Please, squash your commits and we can merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants