avocado
avocado copied to clipboard
IO: RHEL 9.1 NetworkManager configuration support on NIC tests
1.Adding a condition check for RHEL 9 version for new NM connection configuration and keeping old configuration as it is to support old versions 2. Adding condition check for path where file is been stored 3. generating .nmconnection file using nmcli commands commands used : nmcli connection add con-name {self.name} ifname {self.name} type ethernet ipv4.address {ipaddr}/24 nmcli c mod id {self.name} ipv4.method manual ipv4.address {ipaddr}/24 nmcli connection up {Network name}
- For SUSE Wicked configuration support, added a condition check for creating a cfg file with just above given parameters.
Signed-off-by: Tasmiya Nalatwad [email protected]
@abdhaleegit @vaishnavibhat As disscussed added the checks for NMconnection support for RHEL9 and Wicked network configuration support for Suse Please find the results below
- Test executed on RHEL 9.1 as host lpar
[root@machine ] # avocado run --test-runner runner network_test.py -m network_test.py.data/network_test.yaml JOB ID : 58ae84975d2cb8414d9cc9ebd1ebc64b9ead5406 JOB LOG : /root/avocado-fvt-wrapper/results/job-2022-08-29T07.02-58ae849/job.log (01/11) network_test.py:NetworkTest.test_gro;run-hbond-mtu-1500-03cb: PASS (69.88 s) (02/11) network_test.py:NetworkTest.test_gso;run-hbond-mtu-1500-03cb: PASS (72.59 s) (03/11) network_test.py:NetworkTest.test_lro;run-hbond-mtu-1500-03cb: PASS (72.10 s) (04/11) network_test.py:NetworkTest.test_tso;run-hbond-mtu-1500-03cb: PASS (72.07 s) (05/11) network_test.py:NetworkTest.test_ping;run-hbond-mtu-1500-03cb: PASS (15.34 s) (06/11) network_test.py:NetworkTest.test_floodping;run-hbond-mtu-1500-03cb: PASS (38.11 s) (07/11) network_test.py:NetworkTest.test_ssh;run-hbond-mtu-1500-03cb: PASS (5.97 s) (08/11) network_test.py:NetworkTest.test_scp;run-hbond-mtu-1500-03cb: PASS (28.76 s) (09/11) network_test.py:NetworkTest.test_jumbo_frame;run-hbond-mtu-1500-03cb: PASS (9.14 s) (10/11) network_test.py:NetworkTest.test_statistics;run-hbond-mtu-1500-03cb: PASS (37.99 s) (11/11) network_test.py:NetworkTest.test_promisc;run-hbond-mtu-1500-03cb: PASS (16.54 s) RESULTS : PASS 11 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB HTML : /root/avocado-fvt-wrapper/results/job-2022-08-29T07.02-58ae849/results.html JOB TIME : 454.60 s
Before test the connections present were [root@machine ] # ls bond4e181021-enP49153p1s0.nmconnection bond4e181021.nmconnection enP340p128s0f1.nmconnection bond4e181021-env3.nmconnection enP340p128s0f0.nmconnection net0.nmconnection
Started the avocado run on Network test. And backup file getting added [root@machine ] # ls bond4e181021-enP49153p1s0.nmconnection bond4e181021.nmconnection enP340p128s0f1.nmconnection net0.nmconnection bond4e181021-env3.nmconnection enP340p128s0f0.nmconnection enP340p128s0f1.nmconnection.backup
[root@machine ]# cat enP340p128s0f1.nmconnection.backup [connection] id=enP340p128s0f1 uuid=138aa863-6b35-4715-8f23-d8afa653833a type=ethernet autoconnect=false interface-name=enP340p128s0f1 timestamp=1661773646
[ethernet]
[ipv4] address1= method=manual
[ipv6] addr-gen-mode=eui64 method=auto
[proxy] [root@machine ] # cat enP340p128s0f1.nmconnection [connection] id=enP340p128s0f1 uuid=138aa863-6b35-4715-8f23-d8afa653833a type=ethernet autoconnect=false interface-name=enP340p128s0f1 timestamp=1661773646
[ethernet]
[ipv4] address1= method=manual
[ipv6] addr-gen-mode=eui64 method=auto
[proxy]
After test is completed the backup file got deleted from path /etc/NetworkManager/system-connections [root@machine ] # ls bond4e181021-enP49153p1s0.nmconnection bond4e181021.nmconnection enP340p128s0f1.nmconnection bond4e181021-env3.nmconnection enP340p128s0f0.nmconnection net0.nmconnection
This pull request introduces 6 alerts when merging 422ce593c975b0cfec834786fd3555d2b3b5e955 into 23f8980c21fd6257e6a6d99752b28c01ed19dbb4 - view on LGTM.com
new alerts:
- 3 for Unused local variable
- 3 for Variable defined multiple times
This pull request introduces 6 alerts when merging e7f09be613f5e98fee904386efb064093450f1cc into 23f8980c21fd6257e6a6d99752b28c01ed19dbb4 - view on LGTM.com
new alerts:
- 3 for Unused local variable
- 3 for Variable defined multiple times
- Test case executed from RHEL 8.4 to check whether old configuration system is working fine or not
[root@machine ] # avocado run --test-runner runner ethtool_test.py -m ethtool_test.py.data/ethtool_test.yaml Error running method "pre_tests" of plugin "fetchasset": 'Subscript' object has no attribute 'id' JOB ID : ce9a53960843362f6858c79fa943553d0ab0312c JOB LOG : /root/avocado-fvt-wrapper/results/job-2022-08-29T09.11-ce9a539/job.log (1/1) ethtool_test.py:Ethtool.test_ethtool;run-args-Show-channels-hbond-026e: PASS (25.25 s) RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB HTML : /root/avocado-fvt-wrapper/results/job-2022-08-29T09.11-ce9a539/results.html JOB TIME : 26.20 s
Befor starting the test the config files present under /etc/sysconfig/network-scripts [root@machine ] # ls ifcfg-enP48p1s0f0 ifcfg-enP48p1s0f1 ifcfg-enP48p1s0f2 ifcfg-enP48p1s0f3 ifcfg-net0
When test started , backup file got created [root@machine ] # ls ifcfg-enP48p1s0f0 ifcfg-enP48p1s0f0.backup ifcfg-enP48p1s0f1 ifcfg-enP48p1s0f2 ifcfg-enP48p1s0f3 ifcfg-net0 [root@ltcrain41-lp4 network-scripts]# cat ifcfg-enP48p1s0f0.backup TYPE=Ethernet BOOTPROTO=static NAME=enP48p1s0f0 DEVICE=enP48p1s0f0 ONBOOT=yes IPADDR= NETMASK=255.255.255.0 IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes
[root@machine ] # cat ifcfg-enP48p1s0f0 TYPE=Ethernet BOOTPROTO=static NAME=enP48p1s0f0 DEVICE=enP48p1s0f0 ONBOOT=yes IPADDR= NETMASK=255.255.255.0 IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes
After test was completed backup file got deleted [root@machine ] # ls ifcfg-enP48p1s0f0 ifcfg-enP48p1s0f1 ifcfg-enP48p1s0f2 ifcfg-enP48p1s0f3 ifcfg-net0
- Test executed on HNV interface to test bond interface configs are created or not. Please find the results below, as i was not having a proper peer machine so test failed, but the bond interface nmconnection file creation functionality was executed properly
[root@machine ] # avocado run --test-runner runner network_test.py -m network_test.py.data/network_test.yaml JOB ID : f58033c4c5606b2e10092a672cc3f7cb0fd6ac43 JOB LOG : /root/avocado-fvt-wrapper/results/job-2022-08-29T09.15-f58033c/job.log (01/11) network_test.py:NetworkTest.test_gro;run-hbond-mtu-1500-e51a: CANCEL: failed connecting to peer (6.02 s) (02/11) network_test.py:NetworkTest.test_gso;run-hbond-mtu-1500-e51a: CANCEL: failed connecting to peer (5.97 s) (03/11) network_test.py:NetworkTest.test_lro;run-hbond-mtu-1500-e51a: CANCEL: failed connecting to peer (6.13 s) (04/11) network_test.py:NetworkTest.test_tso;run-hbond-mtu-1500-e51a: CANCEL: failed connecting to peer (6.32 s) (05/11) network_test.py:NetworkTest.test_ping;run-hbond-mtu-1500-e51a: CANCEL: failed connecting to peer (5.94 s) (06/11) network_test.py:NetworkTest.test_floodping;run-hbond-mtu-1500-e51a: ^C Interrupt requested. Waiting 2 seconds for test to finish (ignoring new Ctrl+C until then) ^C^CKilling test subprocess 284280 ^CRESULTS : PASS 0 | ERROR 0 | FAIL 0 | SKIP 6 | WARN 0 | INTERRUPT 0 | CANCEL 5 JOB HTML : /root/avocado-fvt-wrapper/results/job-2022-08-29T09.15-f58033c/results.html JOB TIME : 154.21 s
NMconnection backup got created when teststarted [root@machine ] # ls bond4e181021-enP49153p1s0.nmconnection bond4e181021.nmconnection enP340p128s0f1.nmconnection bond4e181021-env3.nmconnection enP340p128s0f0.nmconnection net0.nmconnection [root@machine ] # ls bond4e181021-enP49153p1s0.nmconnection bond4e181021.nmconnection enP340p128s0f0.nmconnection net0.nmconnection bond4e181021-env3.nmconnection bond4e181021.nmconnection.backup enP340p128s0f1.nmconnection [root@machine ] # cat bond4e181021.nmconnection.backup [connection] id=bond4e181021 uuid=4da35476-0c0f-425c-ab6c-371d3491eee1 type=bond autoconnect-slaves=1 interface-name=bond4e181021 timestamp=1661782569
[bond] fail_over_mac=2 miimon=100 mode=active-backup
[ipv4] address1= method=manual
[ipv6] addr-gen-mode=default method=disabled
[proxy]
[root@machine ] # cat bond4e181021.nmconnection [connection] id=bond4e181021 uuid=4da35476-0c0f-425c-ab6c-371d3491eee1 type=bond autoconnect-slaves=1 interface-name=bond4e181021 timestamp=1661782575
[bond] fail_over_mac=2 miimon=100 mode=active-backup
[ipv4] address1= method=manual
[ipv6] addr-gen-mode=default method=disabled
[proxy] [root@machine ] # ls bond4e181021-enP49153p1s0.nmconnection bond4e181021.nmconnection enP340p128s0f0.nmconnection net0.nmconnection bond4e181021-env3.nmconnection bond4e181021.nmconnection.backup enP340p128s0f1.nmconnection
SUSE wicked configuration support
Please find the results below for providing support for wicket network configuration system. As peer was not available , test got failed, but proper ifcfg file is getting is created and backup file is getting created
[root@machine ] :/home/ioci/avocado-fvt-wrapper/tests/avocado-misc-tests/io/net # [root@machine ] :/home/ioci/avocado-fvt-wrapper/tests/avocado-misc-tests/io/net # avocado run --test-runner runner ethtool_test.py -m ethtool_test.py.data/ethtool_t Error running method "pre_tests" of plugin "fetchasset": 'Subscript' object has no attribute 'id' JOB ID : 3dc148c9fb4422dc47b3fbeb4ab77dfc2830f2d6 JOB LOG : /home/ioci/avocado-fvt-wrapper/results/job-2022-08-29T07.12-3dc148c/job.log (01/18) ethtool_test.py:Ethtool.test_ethtool;run-args-PrivateFlag-hbond-3b38: ERROR: Failed to ping: (02/18) ethtool_test.py:Ethtool.test_ethtool;run-args-Driver-hbond-ea41: ERROR: Failed to ping: (03/18) ethtool_test.py:Ethtool.test_ethtool;run-args-Autonegotiation-hbond-279d: ERROR: Failed to ping: (04/18) ethtool_test.py:Ethtool.test_ethtool;run-args-PauseParameter-hbond-56aa: ERROR: Failed to ping: (05/18) ethtool_test.py:Ethtool.test_ethtool;run-args-Coalescing-hbond-c5b9: ^C Interrupt requested. Waiting 2 seconds for test to finish (ignoring new Ctrl+C until then) ^C^CKilling test subprocess 13362 ^CRESULTS : PASS 0 | ERROR 4 | FAIL 0 | SKIP 14 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB HTML : /home/ioci/avocado-fvt-wrapper/results/job-2022-08-29T07.12-3dc148c/results.html JOB TIME : 75.92 s
Before test started, config files present [root@machine ] :/etc/sysconfig/network # ls config dhcp ifcfg-eth0 ifcfg-lo ifcfg.template if-down.d ifroute-eth0 if-up.d providers scripts
Test execution started and backup file got created at path /etc/sysconfig/network [root@machine ] :/etc/sysconfig/network # ls config dhcp ifcfg-eth0 ifcfg-eth0.backup ifcfg-lo ifcfg.template if-down.d ifroute-eth0 if-up.d providers scripts ltcden11-lp13:/etc/sysconfig/network # cat ifcfg-eth0.backup BOOTPROTO='static' STARTMODE='auto' IPADDR= [root@machine ] :/etc/sysconfig/network # cat ifcfg-eth0 IPADDR= BOOTPROTO=static STARTMODE=auto
This pull request introduces 6 alerts when merging 7b4f8a2bad5794ce2d3742ff657f05789e46c869 into 23f8980c21fd6257e6a6d99752b28c01ed19dbb4 - view on LGTM.com
new alerts:
- 3 for Unused local variable
- 3 for Variable defined multiple times
This pull request introduces 6 alerts when merging d038d9d6a9817ab3bc3cdc6aa632094e2ea8f789 into 23f8980c21fd6257e6a6d99752b28c01ed19dbb4 - view on LGTM.com
new alerts:
- 3 for Unused local variable
- 3 for Variable defined multiple times
This pull request introduces 6 alerts when merging 89776b417f9aae67f0a7acd01594a943575a70a2 into 23f8980c21fd6257e6a6d99752b28c01ed19dbb4 - view on LGTM.com
new alerts:
- 3 for Unused local variable
- 3 for Variable defined multiple times
@vaishnavibhat @abdhaleegit As suggested by Vaishnavi, using a prefix variable for netmask value, instead of hard coding the value in the commands. Requesting to please have a look on the changes and let me know your inputs.
Thanks
@TasmiyaNalatwad have we any update here
@abdhaleegit @vaishnavibhat @PraveenPenguin Tested nmconnections with suggested modifications in above reviews. Please find the results below
[root@localhost ]# avocado run --test-runner runner ethtool_test.py -m ethtool_test.py.data/ethtool_test.yaml Error running method "pre_tests" of plugin "fetchasset": 'Subscript' object has no attribute 'id' JOB ID : 2b08ab50380fcefd12827f30107df876b2cfff10 JOB LOG : /root/avocado-fvt-wrapper/results/job-2022-09-28T01.14-2b08ab5/job.log (1/1) ethtool_test.py:Ethtool.test_ethtool;run-args-Show-channels-e9ff: PASS (11.41 s) RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB HTML : /root/avocado-fvt-wrapper/results/job-2022-09-28T01.14-2b08ab5/results.html JOB TIME : 24.20 s
Before staring the test connections list [root@localhost ]# ls bond-enP0.nmconnection bond.nmconnection enP1.nmconnection bond-env3.nmconnection enP0.nmconnection net0.nmconnection
Test started and backup file got created [root@localhost ]# ls bond-enP0.nmconnection bond.nmconnection enP0.nmconnection.backup net0.nmconnection bond-env3.nmconnection enP0.nmconnection enP1.nmconnection
[root@localhost system-connections ]# cat enP0.nmconnection.backup [connection] id= uuid= type=ethernet interface-name= timestamp=1664269973
[ethernet]
[ipv4] address1= method=manual
[ipv6] addr-gen-mode=default method=auto
[proxy] [root@localhost system-connections]# cat enP0.nmconnection [connection] id= uuid= type=ethernet interface-name= timestamp=1664269973
[ethernet]
[ipv4] address1= method=manual
[ipv6] addr-gen-mode=default method=auto
[proxy] [root@localhost system-connections]# ls bond-enP0.nmconnection bond.nmconnection enP1.nmconnection bond-env3.nmconnection enP0.nmconnection net0.nmconnection
@TasmiyaNalatwad adopt the netmask change her
reformat to append / with cidr value
@abdhaleegit Just the netmast value if obtained from the function, and '/' is appended in the command here itself .
@abdhaleegit @PraveenPenguin @vaishnavibhat Please find the latest results with all the fixes provided as per review comments and travis fixed.
[root@localhost]# avocado run --test-runner runner ethtool_test.py -m ethtool_test.py.data/ethtool_test.yaml Error running method "pre_tests" of plugin "fetchasset": 'Subscript' object has no attribute 'id' JOB ID : c7fc69f3ff73f989937b3fe732fdf169ece85ce6 JOB LOG : /root/avocado-fvt-wrapper/results/job-2022-10-03T08.45-c7fc69f/job.log (1/1) ethtool_test.py:Ethtool.test_ethtool;run-args-Show-channels-hbond-cfbb: PASS (26.59 s) RESULTS : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 JOB HTML : /root/avocado-fvt-wrapper/results/job-2022-10-03T08.45-c7fc69f/results.html JOB TIME : 27.32 s
Before starting the test
[root@localhost ]# ls bond-enP0.nmconnection bond.nmconnection enP1.nmconnection bond-env3.nmconnection enP0.nmconnection net0.nmconnection
Backup file created as the test started [root@localhost ]# ls bond-enP0.nmconnection bond.nmconnection enP0.nmconnection.backup net0.nmconnection bond-env3.nmconnection enP0.nmconnection enP1.nmconnection [root@localhost ]# cat enP0.nmconnection.backup [connection] id=enP0 uuid= type=ethernet interface-name= timestamp=1664540005
[ethernet]
[ipv4] address1= method=manual
[ipv6] addr-gen-mode=default method=auto
[proxy] [root@localhost]# cat enP0.nmconnection [connection] id= uuid= type=ethernet interface-name= timestamp=1664804723
[ethernet]
[ipv4] address1= method=manual
[ipv6] addr-gen-mode=default method=auto
[proxy] [root@localhost ]# ls bond-enP0.nmconnection bond.nmconnection enP0.nmconnection.backup net0.nmconnection bond-env3.nmconnection enP0.nmconnection enP1.nmconnection
Deleting backup file after test [root@localhost ]# ls bond-enP0.nmconnection bond.nmconnection enP1.nmconnection bond-env3.nmconnection enP0.nmconnection net0.nmconnection
@abdhaleegit @PraveenPenguin I have addressed all the review comments and attached latest results to this PR. Requesting to please have a look on this PR
@PraveenPenguin LGTM