Lines Matching +full:no +full:- +full:ether +full:- +full:link
2 # SPDX-License-Identifier: GPL-2.0
8 # Kselftest framework requirement - SKIP code is 4.
11 PAUSE_ON_FAIL=no
16 arp_ping eth-arp: Basic arp ping between two NS
17 ct_connect_v4 ip4-ct-xon: Basic ipv4 tcp connection using ct
18 connect_v4 ip4-xon: Basic ipv4 ping between two NS
19 nat_connect_v4 ip4-nat-xon: Basic ipv4 tcp connection via NAT
39 if [ -e $d ]; then
41 rm -rf "$d"
48 [ -e ${ovs_dir}/cleanup ] && . "$ovs_dir/cleanup"
62 test -e ${ovs_dir}/cleanup || : > ${ovs_dir}/cleanup
77 ovs_sbx "$sbxname" python3 $ovs_base/ovs-dpctl.py add-dp $*
78 on_exit "ovs_sbx $sbxname python3 $ovs_base/ovs-dpctl.py del-dp $1;"
83 if [ "$4" != "-u" ]; then
84 ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py add-if "$2" "$3" \
87 python3 $ovs_base/ovs-dpctl.py add-if \
88 -u "$2" "$3" >$ovs_dir/$3.out 2>$ovs_dir/$3.err &
90 on_exit "ovs_sbx $1 kill -TERM $pid 2>/dev/null"
96 ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py del-if "$2" "$3" || return 1
107 ovs_sbx "$sbx" on_exit "kill -TERM $pid 2>/dev/null"
114 ovs_sbx "$1" ip link add "$4" type veth peer name "$5" || return 1
115 on_exit "ovs_sbx $1 ip link del $4 >/dev/null 2>&1"
116 ovs_sbx "$1" ip link set "$4" up || return 1
117 ovs_sbx "$1" ip link set "$5" netns "$3" || return 1
118 ovs_sbx "$1" ip netns exec "$3" ip link set "$5" up || return 1
125 if [ "$7" != "-u" ]; then
128 ovs_add_if "$1" "$2" "$4" -u || return 1
131 if [ $TRACING -eq 1 ]; then
132 ovs_netns_spawn_daemon "$1" "$3" tcpdump -l -i any -s 6553
133 ovs_wait grep -q "listening on any" ${ovs_dir}/stderr
141 ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py add-flow "$2" "$3" "$4"
142 if [ $? -ne 0 ]; then
151 ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py del-flows "$2"
159 perf record -a -q -e skb:kfree_skb -o ${ovs_dir}/perf.data $* \
168 local perf_output=`perf script -i ${ovs_dir}/perf.data -F trace:event,trace`
171 return `echo "$perf_output" | grep "$pattern" | wc -l`
177 echo "If no TEST argument is given, all tests will be run."
180 echo " -t: capture traffic via tcpdump"
181 echo " -v: verbose"
182 echo " -p: pause on failure"
189 # - drop packets and verify the right drop reason is reported
205 ip netns exec client ip link set c1 up
209 ip netns exec server ip link set s1 up
215 info "no support for drop reasons - skipping"
234 ovs_drop_record_and_run "test_drop_reason" ip netns exec client ping -c 2 172.31.110.20
236 if [[ "$?" -ne "2" ]]; then
245 # Drop UDP 7000 traffic with an explicit action with no error code.
251 "test_drop_reason" ip netns exec client nc -i 1 -zuv 172.31.110.20 6000
253 if [[ "$?" -ne "1" ]]; then
259 "test_drop_reason" ip netns exec client nc -i 1 -zuv 172.31.110.20 7000
261 if [[ "$?" -ne "1" ]]; then
270 # - client has 1500 byte MTU
271 # - server has 1500 byte MTU
272 # - send ARP ping between two ns
289 ip netns exec client ip link set c1 up
290 HW_CLIENT=`ip netns exec client ip link show dev c1 | grep -E 'link/ether [0-9a-f:]+' | awk '{print $2;}'`
295 ip netns exec server ip link set s1 up
296 HW_SERVER=`ip netns exec server ip link show dev s1 | grep -E 'link/ether [0-9a-f:]+' | awk '{print $2;}'`
304 ovs_sbx "test_arp_ping" ip netns exec client arping -I c1 172.31.110.20 -c 1 || return 1
310 # - client has 1500 byte MTU
311 # - server has 1500 byte MTU
312 # - use ICMP to ping in each direction
313 # - only allow CT state stuff to pass through new in c -> s
328 ip netns exec client ip link set c1 up
330 ip netns exec server ip link set s1 up
332 # Add forwarding for ARP and ip packets - completely wildcarded
338 'ct_state(-trk),eth(),eth_type(0x0800),ipv4()' \
354 ovs_sbx "test_ct_connect_v4" ip netns exec client ping 172.31.110.20 -c 3 || return 1
359 nc -lvnp 4443
360 ovs_sbx "test_ct_connect_v4" ip netns exec client nc -i 1 -zv 172.31.110.20 4443 || return 1
365 nc -lvnp 4443
366 ovs_sbx "test_ct_connect_v4" ip netns exec client nc -i 1 -zv 172.31.110.10 4443
377 # - client has 1500 byte MTU
378 # - server has 1500 byte MTU
379 # - use ICMP to ping in each direction
394 ip netns exec client ip link set c1 up
396 ip netns exec server ip link set s1 up
398 # Add forwarding for ARP and ip packets - completely wildcarded
409 ovs_sbx "test_connect_v4" ip netns exec client ping 172.31.110.20 -c 3 || return 1
416 # - client has 1500 byte MTU
417 # - server has 1500 byte MTU
418 # - use ICMP to ping in each direction
419 # - only allow CT state stuff to pass through new in c -> s
433 ip netns exec client ip link set c1 up
435 ip netns exec server ip link set s1 up
444 "ct_state(-trk),in_port(1),eth(),eth_type(0x0800),ipv4(dst=192.168.0.20)" \
447 "ct_state(-trk),in_port(2),eth(),eth_type(0x0800),ipv4()" \
451 "recirc_id(0x1),ct_state(+trk-inv),in_port(1),eth(),eth_type(0x0800),ipv4()" "2"
453 "recirc_id(0x2),ct_state(+trk-inv),in_port(2),eth(),eth_type(0x0800),ipv4()" "1"
456 ovs_sbx "test_nat_connect_v4" ip netns exec client ping 192.168.0.20 -c 3 || return 1
461 nc -lvnp 4443
462 ovs_sbx "test_nat_connect_v4" ip netns exec client nc -i 1 -zv 192.168.0.20 4443 || return 1
467 nc -lvnp 4443
468 ovs_sbx "test_nat_connect_v4" ip netns exec client nc -i 1 -zv 172.31.110.10 4443
479 # - Create a dp
480 # - check no warning with "old version" simulation
487 PRE_TEST=$(dmesg | grep -E "RIP: [0-9a-fA-Fx]+:ovs_dp_cmd_new\+")
488 ovs_add_dp "test_netlink_checks" nv0 -V 0 || return 1
489 POST_TEST=$(dmesg | grep -E "RIP: [0-9a-fA-Fx]+:ovs_dp_cmd_new\+")
491 info "failed - gen warning"
499 [ $(python3 $ovs_base/ovs-dpctl.py show nv0 | grep port | \
500 wc -l) == 3 ] || \
503 [ $(python3 $ovs_base/ovs-dpctl.py show nv0 | grep port | \
504 wc -l) == 2 ] || \
509 PRE_TEST=$(dmesg | grep -c "${ERR_MSG}")
514 POST_TEST=$(dmesg | grep -c "${ERR_MSG}")
517 info "failed - clone depth too large"
521 PRE_TEST=$(dmesg | grep -c "${ERR_MSG}")
525 POST_TEST=$(dmesg | grep -c "${ERR_MSG}")
527 info "failed - error not generated"
537 ovs_add_dp "test_upcall_interfaces" ui0 -V 2:1 || return 1
540 172.31.110.1/24 -u || return 1
544 ip netns exec upc arping -I l0 172.31.110.20 -c 1 \
547 grep -E "MISS upcall\[0/yes\]: .*arp\(sip=172.31.110.1,tip=172.31.110.20,op=1,sha=" $ovs_dir/left0.out >/dev/null 2>&1 || return 1
557 stdbuf -o0 printf "TEST: %-60s [NOMOD]\n" "${tdesc}"
561 if python3 ovs-dpctl.py -h 2>&1 | \
562 grep -E "Need to (install|upgrade) the python" >/dev/null 2>&1; then
563 stdbuf -o0 printf "TEST: %-60s [PYLIB]\n" "${tdesc}"
566 printf "TEST: %-60s [START]\n" "${tname}"
573 if [ $ret -eq 0 ]; then
574 printf "TEST: %-60s [ OK ]\n" "${tdesc}"
576 rm -rf "$ovs_dir"
577 elif [ $ret -eq 1 ]; then
578 printf "TEST: %-60s [FAIL]\n" "${tdesc}"
585 [ "${PAUSE_ON_FAIL}" = "yes" ] || rm -rf "$ovs_dir"
587 elif [ $ret -eq $ksft_skip ]; then
588 printf "TEST: %-60s [SKIP]\n" "${tdesc}"
589 elif [ $ret -eq 2 ]; then
590 rm -rf test_${tname}
633 shift $(($OPTIND-1))
640 command -v > /dev/null "test_${arg}" || { echo "=== Test ${arg} not found"; usage; }
651 [ "${arg}" != "${arg#--*}" ] && continue
655 if [ $run_this -eq 1 ]; then