-
Notifications
You must be signed in to change notification settings - Fork 107
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
fix: Allow network to restart when wireless or team connection is specified #675
fix: Allow network to restart when wireless or team connection is specified #675
Conversation
[citest] |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #675 +/- ##
=======================================
Coverage 20.50% 20.50%
=======================================
Files 10 10
Lines 1478 1478
Branches 433 433
=======================================
Hits 303 303
Misses 1174 1174
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
212f054
to
3578dad
Compare
[citest] |
3578dad
to
25f3183
Compare
[citest] |
This seems to be wrong. The role needs to handle this scenario properly (or the NM packages need to be changed). |
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 role should handle the scenario instead of doctoring the tests.
25f3183
to
5adf18b
Compare
[citest] |
5adf18b
to
876ed42
Compare
[citest] |
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.
This does not seem to be correct.
876ed42
to
f016efa
Compare
[citest] |
d8d2e33
to
2160db2
Compare
[citest] |
I added it. |
[citest] |
f05c935
to
c430ee3
Compare
- name: Check if rpm ostree system - cannot test | ||
meta: end_host | ||
when: __network_is_ostree | d(false) |
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.
What's the reason this cannot be tested on an rpm ostree system?
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.
https://github.com/linux-system-roles/network/blob/main/README-ostree.md#rpm-ostree, " the /usr filesystem is read-only, and the role cannot install packages".
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 problem is that we don't have a good way currently to pass in the custom yum repos/copr repos that are used by these tests. If you could build an image with all of the repos and packages, then I think the tests should work.
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.
main
/README-ostree.md#rpm-ostree, " the /usr filesystem is read-only, and the role cannot install packages".
This is not a sufficient explanation. Because this still leaves the question what's the reason that this cannot be tested? The role needs to have a defined behavior when running against ostree systems.
The problem is that we don't have a good way currently to pass in the custom yum repos/copr repos that are used by these tests. If you could build an image with all of the repos and packages, then I think the tests should work.
Maybe I am missing something. If an ostree system is missing the wifi or team subpackage (or even some NM or Nmstate package), then the role needs to handle this with a proper error message (if we intend to support ostree targets). If the role handles this correctly.
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 problem is that the test wants to remove the package NetworkManager-wifi
then reinstall it later - packages cannot be removed from an ostree system - the only thing package management can do at runtime is to verify that the given package exists (or is absent).
If the test needs to verify the package NetworkManager-wifi
is absent, then call the role to install it, then verify that the package NetworkManager-wifi
is present, then at least this part of the test is not applicable for ostree systems. If we really want this test to be run on ostree systems, then we need to modify the test such that the testing of the package absence and presence is skipped on ostree systems. I don't know if that will substantially change what this test is doing.
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 was thinking of changing
name: Check if rpm ostree system - cannot test
to something likename: Cannot test ostree systems because ...
ok. note that there are a few places in tests/
other than this that would require such a change. If @liangwen12year would like to take care of that in this PR, that's fine. But, perhaps since that change would be unrelated to this PR, I can create a separate PR after this one is merged to add such a descriptive name:
to the other places in the code where test is skipped due to ostree.
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.
If there are multiple places, maybe it is also worth to write this in one file and include it in all places. Doing this in a follow-up PR is fine.
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.
tracked by #681
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 meant doing this at other places and/or using a task file for all those places is something to do in a different PR. The task in this PR needs a good name, still.
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 renamed the task into following.
- name: Cannot test ostree systems because the package can not be removed
or installed - 'NetworkManager-wifi'
256c06e
to
2ba3dcc
Compare
2ba3dcc
to
e8fe9f2
Compare
[citest] |
Signed-off-by: Wen Liang <[email protected]>
e8fe9f2
to
d33a681
Compare
[citest] |
If updates for network packages are available and wireless or team connections are specified, NetworkManager must be restarted, the role requires user's consent to restart NetworkManager. Otherwise, there might be property conflicts between NetworkManager daemon and plugin, or NetworkManager plugin is not taking effect. `update_cache` is enabled in the module tasks to check if updates for network packages are available due to wireless or team interfaces, in that case, NetworkManager needs user's explicit consent to be restarted after the network package updates. And using `state: latest` for checking the network package updates because we have to guarantee that NetworkManager and its plugin have the same and most recent version for configuring the network connections settings in the backend. It is worthwhile to mention that we have both tasks using dnf and yum module for checking available updates for network packages. Because checking package cache update is not supported in Ansible package module, Fedora and RHEL8+ use DNF package manager by default, RHEL7 uses yum package manager by default. This commit will address the situation that users forget to explicitly specify `network_allow_restart: true` when specifying wireless or team connections. Signed-off-by: Wen Liang <[email protected]>
…nnections Signed-off-by: Wen Liang <[email protected]>
d33a681
to
0fca710
Compare
- always | ||
|
||
- name: Cannot test ostree systems because the package can not be removed | ||
or installed - 'NetworkManager-wifi' |
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.
If we are using the jinja2 syntax for the '{{ package }}', the {{ package }}' should be appeared at the end of the task name.
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.
FWIW, cannot
is more common than can not
.
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.
Right, thanks for pointing it out, I will address it in another PR.
@tyll , if you agree, then I will proceed to merge this PR. |
[citest] |
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.
Thank you, LGTM
Enhancement: Ask user's consent to restart NM due to wireless or team interfaces when the updates for network packages are available.
Reason: When wireless or team connections are specified and the updates for network packages are available, NetworkManager must be restarted, the role requires user's consent to restart NetworkManager. Otherwise, there
might be property conflicts between NetworkManager daemon and plugin, or
NetworkManager plugin is not taking effect.
Result: When wireless or team connections are specified and the updates for network packages are available, NetworkManager must be restarted, the role will ask user's explicit consent to restart NetworkManager.
Issue Tracker Tickets (Jira or BZ if any):
Resolves: https://issues.redhat.com/browse/NMT-1039