linux-system-roles / network

An ansible role to configure networking
https://linux-system-roles.github.io/network/
BSD 3-Clause "New" or "Revised" License
238 stars 106 forks source link

test: Rewrite tests_bond_options.yml in new testing format #671

Closed liangwen12year closed 9 months ago

liangwen12year commented 10 months ago

Enhancement:

Reason:

Result:

Issue Tracker Tickets (Jira or BZ if any):

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (6c74dee) 20.50% compared to head (9c23735) 20.50%.

Additional details and impacted files ```diff @@ 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 ``` | [Flag](https://app.codecov.io/gh/linux-system-roles/network/pull/671/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles) | Coverage Δ | | |---|---|---| | [sanity](https://app.codecov.io/gh/linux-system-roles/network/pull/671/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles) | `20.50% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

liangwen12year commented 10 months ago

[citest]

liangwen12year commented 10 months ago

[citest]

liangwen12year commented 10 months ago

[citest]

richm commented 10 months ago

well, that didn't help

TASK [Install dnsmasq] *********************************************************
task path: /WORKDIR/git-bond_options_rewritem7luhouy/tests/playbooks/tasks/create_test_interfaces_with_dhcp.yml:3
Wednesday 31 January 2024  23:34:50 +0000 (0:00:00.034)       0:01:33.565 ***** 
FAILED - RETRYING: [sut]: Install dnsmasq (6 retries left).
FAILED - RETRYING: [sut]: Install dnsmasq (5 retries left).
FAILED - RETRYING: [sut]: Install dnsmasq (4 retries left).
FAILED - RETRYING: [sut]: Install dnsmasq (3 retries left).
FAILED - RETRYING: [sut]: Install dnsmasq (2 retries left).
FAILED - RETRYING: [sut]: Install dnsmasq (1 retries left).
fatal: [sut]: FAILED! => {
    "attempts": 6,
    "changed": false,
    "rc": 1,
    "results": []
}

MSG:

Failed to download metadata for repo 'epel': Cannot prepare internal mirrorlist: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=epel-8&arch=x86_64&infra=stock&content=centos [Could not resolve host: mirrors.fedoraproject.org]

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

TASK [Delete the device 'nm-bond'] *********************************************
task path: /WORKDIR/git-bond_options_rewritem7luhouy/tests/playbooks/tests_bond.yml:114
Wednesday 31 January 2024  23:33:36 +0000 (0:00:00.258)       0:00:26.636 ***** 
ok: [sut] => {
    "changed": false,
    "cmd": [
        "ip",
        "link",
        "del",
        "nm-bond"
    ],
    "delta": "0:00:00.006632",
    "end": "2024-01-31 23:33:36.426429",
    "failed_when_result": false,
    "rc": 1,
    "start": "2024-01-31 23:33:36.419797"
}

STDERR:

Cannot find device "nm-bond"

Not sure if this is a problem - perhaps the other cleanup removes this interface (which is why this task has ignore_errors: true)

It would be useful to add to the cleanup section something which verifies DNS lookups are still working (maybe add an explicit getent hosts mirrors.fedoraproject.org and getent hosts mirrors.centos.org - something like this)

- 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
liangwen12year commented 10 months ago

[citest]

liangwen12year commented 10 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

[citest]

liangwen12year commented 9 months ago

@richm, thanks for the hint and contribution to this PR.

richm commented 9 months ago

There were 3 tests that hung:

network 671 CentOS-8/ansible-2.9 tests_bond_deprecated_nm.yml UNDEFINED 2024-02-14T14:03:44
network 671 Fedora-39/ansible-2.16 tests_ethernet_nm.yml UNDEFINED 2024-02-14T13:59:44
network 671 Fedora-38/ansible-2.16 tests_bond_removal_nm.yml UNDEFINED 2024-02-14T09:49:21

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.