From 902e725a9da6ebd56182f26d36b0d7414da7c064 Mon Sep 17 00:00:00 2001 From: Mingyu Shi Date: Tue, 28 May 2024 22:03:47 +0800 Subject: [PATCH] Enable gating for c10s Fix test cases: ip-neigh-sanity-test: no failed item after delete/flush ip-rule-sanity-test: fix invalid tos ip-l2tp-sanity-test: enable l2tp_* modules ip-link-sanity-test: remove deprecated team, enable vcan module Disable ip-fou-sanity-test as the module fou has been deprecated Required packages: Remove bridge-utils as deprecated Add kernel-modules-extra Signed-off-by: Mingyu Shi --- gating.yaml | 6 ++++++ tests/bridge-utility/runtest.sh | 5 ++--- tests/ip-fou-sanity-test/Makefile | 4 ++-- tests/ip-l2tp-sanity-test/Makefile | 2 +- tests/ip-l2tp-sanity-test/runtest.sh | 5 +++++ tests/ip-link-sanity-test/ip-link-tests.py | 8 -------- tests/ip-link-sanity-test/runtest.sh | 2 ++ tests/ip-neigh-sanity-test/runtest.sh | 12 ++++-------- tests/ip-rule-sanity-test/runtest.sh | 14 +++----------- tests/tests.yml | 3 +-- 10 files changed, 26 insertions(+), 35 deletions(-) create mode 100644 gating.yaml diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..e3c0e43 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-10 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier1-gating.functional} diff --git a/tests/bridge-utility/runtest.sh b/tests/bridge-utility/runtest.sh index 0d510c3..c7955d7 100755 --- a/tests/bridge-utility/runtest.sh +++ b/tests/bridge-utility/runtest.sh @@ -53,7 +53,7 @@ rlJournalStart else # dummy module loaded before the test, backup number of loaded dummy devices (nmdumies parameter), it is doesn't show under /sys/module/dummy/parameters dummies_count=`ip a | grep dummy | tail -n 1 | sed -r 's/.*dummy([0-9]+).*/\1/'` - if [ -z $dummies_count] ; then + if [ -z $dummies_count ] ; then # dummy module is loaded but no dummy device exists no_dummy=1 else @@ -255,12 +255,11 @@ dummy1 interface" if [ $no_dummy -eq 1 ] ; then # load dummy module and delete dummy0 with ip link modprobe dummy - rlIsRHEL '>=7' && rlRun "ip link del dummy0" + rlIsRHEL '=7' && rlRun "ip link del dummy0" else modprobe dummy numdummies=$dummies_count fi fi - rlRun "service network restart" 0,1 "Restarting network, just for sure" rlRun "popd" rlRun "rm -r $TmpDir" 0 "Removing tmp directory" rlPhaseEnd diff --git a/tests/ip-fou-sanity-test/Makefile b/tests/ip-fou-sanity-test/Makefile index b5985b2..23063bb 100644 --- a/tests/ip-fou-sanity-test/Makefile +++ b/tests/ip-fou-sanity-test/Makefile @@ -8,12 +8,12 @@ # Copyright (c) 2018 Red Hat, Inc. #~~~ -export TEST=/CoreOS/iproute/Sanity/ip-address-sanity-test +export TEST=/CoreOS/iproute/Sanity/ip-fou-sanity-test export TESTVERSION=1.0 BUILT_FILES= -FILES=$(METADATA) runtest.sh Makefile PURPOSE +FILES=$(METADATA) runtest.sh Makefile PURPOSE ip-fou-tests.py .PHONY: all install download clean diff --git a/tests/ip-l2tp-sanity-test/Makefile b/tests/ip-l2tp-sanity-test/Makefile index 7040c7c..899458d 100644 --- a/tests/ip-l2tp-sanity-test/Makefile +++ b/tests/ip-l2tp-sanity-test/Makefile @@ -13,7 +13,7 @@ export TESTVERSION=1.0 BUILT_FILES= -FILES=$(METADATA) runtest.sh Makefile PURPOSE +FILES=$(METADATA) runtest.sh Makefile PURPOSE ip-l2tp-tests.py .PHONY: all install download clean diff --git a/tests/ip-l2tp-sanity-test/runtest.sh b/tests/ip-l2tp-sanity-test/runtest.sh index 75b0589..655b770 100755 --- a/tests/ip-l2tp-sanity-test/runtest.sh +++ b/tests/ip-l2tp-sanity-test/runtest.sh @@ -16,6 +16,11 @@ PACKAGE="iproute" rlJournalStart rlPhaseStartSetup rlAssertRpm $PACKAGE + rlRun "modprobe l2tp_core" + rlRun "modprobe l2tp_eth" + rlRun "modprobe l2tp_ip" + rlRun "modprobe l2tp_ip6" + rlRun "modprobe l2tp_netlink" rlRun "cp ip-l2tp-tests.py /usr/bin" rlPhaseEnd diff --git a/tests/ip-link-sanity-test/ip-link-tests.py b/tests/ip-link-sanity-test/ip-link-tests.py index a13d952..1dd3c25 100755 --- a/tests/ip-link-sanity-test/ip-link-tests.py +++ b/tests/ip-link-sanity-test/ip-link-tests.py @@ -189,14 +189,6 @@ class IPLinkKindTests(unittest.TestCase, IPLinkUtilities): subprocess.check_output(['ip', 'link', 'del', 'bond-test']) - def test_add_team(self): - - subprocess.check_output(['ip', 'link', 'add', 'team-test', 'type', 'team']) - - self.link_exists('team-test') - - subprocess.check_output(['ip', 'link', 'del', 'team-test']) - def test_add_ipip_tunnel(self): subprocess.check_output(['ip', 'tunnel', 'add', 'test-ipiptun', 'mode', 'ipip', 'remote', '10.3.3.3', 'local', '10.4.4.4', 'ttl' ,'64']) diff --git a/tests/ip-link-sanity-test/runtest.sh b/tests/ip-link-sanity-test/runtest.sh index 65daf1f..9479084 100755 --- a/tests/ip-link-sanity-test/runtest.sh +++ b/tests/ip-link-sanity-test/runtest.sh @@ -16,6 +16,8 @@ PACKAGE="iproute" rlJournalStart rlPhaseStartSetup rlAssertRpm $PACKAGE + rlRun "dnf install -y kernel-modules-extra" + rlRun "modprobe vcan" rlRun "cp ip-link-tests.py /usr/bin" rlPhaseEnd diff --git a/tests/ip-neigh-sanity-test/runtest.sh b/tests/ip-neigh-sanity-test/runtest.sh index 0930b01..0efcc28 100644 --- a/tests/ip-neigh-sanity-test/runtest.sh +++ b/tests/ip-neigh-sanity-test/runtest.sh @@ -89,7 +89,7 @@ rlJournalStart rlRun "test $(ip neigh show dev ${TEST_IFACE} | wc -l) -eq 2" 0 "There are two items in neighbours." rlRun "ip neigh del ${TEST_IP4_PREFIX}.1 dev ${TEST_IFACE}" - rlRun "ip neigh show ${TEST_IP4_PREFIX}.1 | grep 'FAILED'" + rlRun "ip neigh show ${TEST_IP4_PREFIX}.1 | grep ." "1" rlRun "ip neigh change ${TEST_IP4_PREFIX}.2 lladdr ${TEST_MAC_PREFIX}:ca dev ${TEST_IFACE} nud reachable" rlRun "ip neigh show ${TEST_IP4_PREFIX}.2 | grep 'REACHABLE'" @@ -100,15 +100,13 @@ rlJournalStart rlRun "test $(ip neigh show dev ${TEST_IFACE} nud permanent | wc -l) -eq 1" 0 "There is one permanent item in neighbours." rlRun "test $(ip neigh show dev ${TEST_IFACE} nud reachable | wc -l) -eq 1" 0 "There is one reachable item in neighbours." rlRun "test $(ip neigh show dev ${TEST_IFACE} nud noarp | wc -l) -eq 1" 0 "There is one noarp item in neighbours." - rlRun "test $(ip neigh show dev ${TEST_IFACE} nud failed | wc -l) -eq 1" 0 "There is one failed item in neighbours." rlIsRHEL ">=7" && rlRun "test $(ip neigh show dev ${TEST_IFACE} proxy | wc -l) -eq 1" 0 "There is one proxy item in neighbours." - rlRun "test $(ip neigh show dev ${TEST_IFACE} | grep -e PERMANENT -e REACHABLE -e FAILED | wc -l) -eq 3" 0 "There are three permanent or reachable or failed items in neighbours." + rlRun "test $(ip neigh show dev ${TEST_IFACE} | grep -c -e PERMANENT -e REACHABLE) -eq 2" 0 "There are two permanent or reachable items in neighbours." rlRun "ip neigh show dev ${TEST_IFACE} unused" rlRun "ip neigh change ${TEST_IP4_PREFIX}.4 dev ${TEST_IFACE} nud delay" rlRun "ip neigh flush ${TEST_IP4_PREFIX}.4 dev ${TEST_IFACE}" - rlRun "ip neigh show nud all | grep '${TEST_IP4_PREFIX}.4'" rlRun "ip -s neigh flush ${TEST_IP4_PREFIX}.4 dev ${TEST_IFACE}" rlRun "ip -s -s neigh flush ${TEST_IP4_PREFIX}.4 dev ${TEST_IFACE}" @@ -161,7 +159,7 @@ rlJournalStart rlRun "test $(ip -6 neigh show dev ${TEST_IFACE} | wc -l) -eq 2" 0 "There are two items in neighbours." rlRun "ip -6 neigh del ${TEST_IP6_PREFIX}1 dev ${TEST_IFACE}" - rlRun "ip -6 neigh show ${TEST_IP6_PREFIX}1 | grep 'FAILED'" + rlRun "ip -6 neigh show ${TEST_IP6_PREFIX}1 | grep ." "1" rlRun "ip -6 neigh change ${TEST_IP6_PREFIX}2 lladdr ${TEST_MAC_PREFIX}:ca dev ${TEST_IFACE} nud reachable" rlRun "ip -6 neigh show ${TEST_IP6_PREFIX}2 | grep 'REACHABLE'" @@ -172,15 +170,13 @@ rlJournalStart rlRun "test $(ip -6 neigh show dev ${TEST_IFACE} nud permanent | wc -l) -eq 1" 0 "There is one permanent item in neighbours." rlRun "test $(ip -6 neigh show dev ${TEST_IFACE} nud reachable | wc -l) -eq 1" 0 "There is one reachable item in neighbours." rlRun "test $(ip -6 neigh show dev ${TEST_IFACE} nud noarp | wc -l) -eq 1" 0 "There is one noarp item in neighbours." - rlRun "test $(ip -6 neigh show dev ${TEST_IFACE} nud failed | wc -l) -eq 1" 0 "There is one failed item in neighbours." rlIsRHEL ">=7" && rlRun "test $(ip -6 neigh show dev ${TEST_IFACE} proxy | wc -l) -eq 1" 0 "There is one proxy item in neighbours." - rlRun "test $(ip -6 neigh show dev ${TEST_IFACE} | grep -e PERMANENT -e REACHABLE -e FAILED | wc -l) -eq 3" 0 "There are three permanent or reachable or failed items in neighbours." + rlRun "test $(ip -6 neigh show dev ${TEST_IFACE} | grep -c -e PERMANENT -e REACHABLE) -eq 2" 0 "There are two permanent or reachable items in neighbours." rlRun "ip -6 neigh show dev ${TEST_IFACE} unused" rlRun "ip -6 neigh change ${TEST_IP6_PREFIX}4 dev ${TEST_IFACE} nud delay" rlRun "ip -6 neigh flush ${TEST_IP6_PREFIX}4 dev ${TEST_IFACE}" - rlRun "ip -6 neigh show nud all | grep '${TEST_IP6_PREFIX}4'" rlRun "ip -6 -s neigh flush ${TEST_IP6_PREFIX}4 dev ${TEST_IFACE}" rlRun "ip -6 -s -s neigh flush ${TEST_IP6_PREFIX}4 dev ${TEST_IFACE}" diff --git a/tests/ip-rule-sanity-test/runtest.sh b/tests/ip-rule-sanity-test/runtest.sh index d094b20..d3f28b6 100644 --- a/tests/ip-rule-sanity-test/runtest.sh +++ b/tests/ip-rule-sanity-test/runtest.sh @@ -53,7 +53,7 @@ rlJournalStart rlRun "ip rule add fwmark 125 pref 102 prohibit" rlRun "ip rule add fwmark 126 pref 103 unicast" rlRun "ip rule add from 172.29.2.0/24 tos 10 blackhole" - rlRun "ip rule add from 172.29.0.0/24 tos 6 prio 99 goto 103" + rlRun "ip rule add from 172.29.0.0/24 tos 14 prio 99 goto 103" rlRun "ip rule list" @@ -67,7 +67,7 @@ rlJournalStart rlRun "ip rule list | grep 'from all fwmark 0x7d prohibit'" rlRun "ip rule list | grep 'from all fwmark 0x7e'" ! rlIsFedora && rlRun "ip rule list | grep 'from 172.29.2.0/24 tos lowdelay blackhole'" - rlRun "ip rule list | grep 'from 172.29.0.0/24 tos 0x06 goto 103'" + rlRun "ip rule list | grep 'from 172.29.0.0/24 tos 0x14 goto 103'" rlRun "ip rule list" @@ -81,7 +81,7 @@ rlJournalStart rlRun "ip rule del fwmark 125 pref 102 prohibit" rlRun "ip rule del fwmark 126 pref 103 unicast" rlRun "ip rule del from 172.29.2.0/24 tos 10 blackhole" - rlRun "ip rule del from 172.29.0.0/24 tos 6 prio 99 goto 103" + rlRun "ip rule del from 172.29.0.0/24 tos 14 prio 99 goto 103" rlRun "ip rule list" rlPhaseEnd @@ -95,13 +95,5 @@ rlJournalStart rlPhaseEnd fi - rlPhaseStartTest - rlRun "man ${IP_RULE_MANPAGE} | col -b | grep 'reject'" 1 - rlRun "ip rule help 2>&1 | grep 'reject'" 1 - rlPhaseEnd - - rlPhaseStartCleanup - rlPhaseEnd - rlJournalPrintText rlJournalEnd diff --git a/tests/tests.yml b/tests/tests.yml index ae233e0..9682bb1 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -13,7 +13,6 @@ - ip-link-sanity-test - ip-address-sanity-test - ip-address-label-sanity-test - - ip-fou-sanity-test - ip-token-sanity-test - ip-tuntap-sanity-test - ip-tunnel-sanity-test @@ -23,5 +22,5 @@ - ip-neighbor-sanity-test required_packages: - iproute - - bridge-utils - python3 + - kernel-modules-extra