-
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
test: Rewrite tests_bond_options.yml in new testing format #671
test: Rewrite tests_bond_options.yml in new testing format #671
Conversation
fba403d
to
bd93e78
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #671 +/- ##
=======================================
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. |
bd93e78
to
3f31b1d
Compare
[citest] |
1 similar comment
[citest] |
2fcb873
to
2123ffc
Compare
[citest] |
well, that didn't help
The test prior to this is tests_bond_nm.yml - https://dl.fedoraproject.org/pub/alt/linuxsystemroles/logs/lsr-citool_network-671-2123ffc_CentOS-Stream-8_20240201-000417/artifacts/tests_bond_nm-PASSED.log
Not sure if this is a problem - perhaps the other cleanup removes this interface (which is why this task has It would be useful to add to the cleanup section something which verifies DNS lookups are still working (maybe add an explicit - name: Verify DNS and ping still work
shell: |
set -euxo pipefail
for host in mirrors.fedoraproject.org mirrors.centos.org; do
if ! getent hosts "$host"; then
# show whatever diagnostic information you need to determine why DNS isn't working
# not sure what that would be
# see if dnsmasq is still running and intercepting DNS requests?
# and maybe ip a and ip route? what other information do you need here for debugging?
exit 1
fi
if ! ping "$host"; then
# show whatever diagnostic information you need to determine why ping isn't working
# not sure what that would be
# and maybe ip a and ip route? what other information do you need here for debugging?
exit 1
fi
done
when: ansible_facts["distribution"] == "CentOS"
changed_when: false |
[citest] |
9289f31
to
1651fd3
Compare
[citest] |
changed_when: false | ||
- name: Import the task 'remove_test_interfaces_with_dhcp.yml' | ||
import_tasks: tasks/remove_test_interfaces_with_dhcp.yml | ||
lsr_description: I can reconfigure the bond options |
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 wrote the description in user story format before I knew about acceptance criteria. Probably, it makes more sense to write this as an acceptance criteria.
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 wrote the lsr_description
as acceptance criteria.
tests/tasks/assert_bond_options.yml
Outdated
- {key: 'mode', value: '802.3ad'} | ||
- {key: 'ad_actor_sys_prio', value: '65535'} | ||
- {key: 'ad_actor_system', value: '00:00:5e:00:53:5d'} | ||
- {key: 'ad_select', value: 'stable'} | ||
- {key: 'ad_user_port_key', value: '1023'} | ||
# wokeignore:rule=slave | ||
- {key: 'all_slaves_active', value: '1'} | ||
- {key: 'downdelay', value: '0'} | ||
- {key: 'lacp_rate', value: 'slow'} | ||
- {key: 'lp_interval', value: '128'} | ||
- {key: 'miimon', value: '110'} | ||
- {key: 'num_grat_arp', value: '64'} | ||
- {key: 'resend_igmp', value: '225'} | ||
- {key: 'updelay', value: '0'} | ||
- {key: 'use_carrier', value: '1'} | ||
- {key: 'xmit_hash_policy', value: 'encap2+3'} |
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.
Is it possible to assign this as a variable in tests/playbooks/tests_bond_options.yml
?
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 is possible.
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.
Then please do so. It seems to me, that it will help making the playbooks easier to understand. What do you think? It should also reduce the amount of needed task files.
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.
Yes, we do not need to keep some redundant task files.
1651fd3
to
e7de3d6
Compare
[citest] |
e7de3d6
to
0e64478
Compare
[citest] |
0e64478
to
7ac12e6
Compare
[citest] |
lsr_description: Given the system administrators using the network | ||
role, when they reconfigure the bond options as specified in | ||
`create_bond_profile.yml`, then I can verify that the | ||
bond options are configured correctly in sysfs filesystem. |
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.
Actually, the acceptance criteria should describe the steps in lsr_setup
, lsr_test
and lsr_assert
:
A start would be:
Given two DHCP-enabled network interfaces,
When creating a bond profile with them,
Then the controller device and bond port profiles are present and the specified bond options are set for the controller device.
7ac12e6
to
2d41ef1
Compare
[citest] |
2d41ef1
to
4a4b620
Compare
[citest] |
mode: 802.3ad | ||
ad_actor_sys_prio: 65535 | ||
ad_actor_system: 00:00:5e:00:53:5d | ||
ad_select: stable | ||
ad_user_port_key: 1023 | ||
all_ports_active: true | ||
downdelay: 0 | ||
lacp_rate: slow | ||
lp_interval: 128 | ||
miimon: 110 | ||
min_links: 0 | ||
num_grat_arp: 64 | ||
primary_reselect: better | ||
resend_igmp: 225 | ||
updelay: 0 | ||
use_carrier: true | ||
xmit_hash_policy: encap2+3 |
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.
Not sure if it was clear, these options also belong in a variable in the playbook.
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.
Aha, thanks for making it clearer, I will use a variable to hold the bond options. Bonus from this, I think that we can have fewer task files.
tests/playbooks/tests_bond.yml
Outdated
- name: Verify DNS and ping still work | ||
shell: | | ||
set -euxo pipefail | ||
for host in mirrors.fedoraproject.org mirrors.centos.org; do | ||
if ! getent hosts "$host"; then | ||
exit 1 | ||
fi | ||
if ! ping -c5 "$host"; then | ||
exit 1 | ||
fi | ||
done | ||
when: ansible_facts["distribution"] == "CentOS" | ||
changed_when: 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.
If you intend to keep this code in, then it should be its own task file.
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 am not planning to keep this code in, but only for temporary debugging purposes.
4a4b620
to
9e6419a
Compare
[citest] |
9e6419a
to
065eaef
Compare
[citest] |
[citest] |
e1bc458
to
d5eed58
Compare
[citest] |
d5eed58
to
1ac46a9
Compare
[citest] |
The new testing format is more concise and easier to debug when test failure happens. Signed-off-by: Wen Liang <[email protected]>
Sometimes the rpm download returns a 403, which is likely caused by too many parallel jobs attempt the download from the same controller in too short a period of time, so the epel server throttles additional downloads - use a retry here to mitigate. Signed-off-by: Wen Liang <[email protected]>
In order to guarantee each test is cleaned up properly in the end, it is important to add a post-test check to each test checking that: - Routes and DNS are restored. - Network connectivity to certain hosts are preserved. Signed-off-by: Wen Liang <[email protected]>
Without purging the DNS testing config at the end `tests_network_state.yml`, the managed hosts can not properly resolve certain hosts (e.g. mirrors.fedoraproject.org, mirrors.centos.org ) in the package installation task of other tests. Signed-off-by: Wen Liang <[email protected]>
1ac46a9
to
9c23735
Compare
[citest] |
@richm, thanks for the hint and contribution to this PR. |
There were 3 tests that hung:
the time now is 2024-02-14T20:18:44, so you can see that those tests are quite hung. I'm going to merge this PR, and we will see if those 3 tests are flakes or are persistent. |
Enhancement:
Reason:
Result:
Issue Tracker Tickets (Jira or BZ if any):