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 [ $TRACING -eq 1 ] && ovs_netns_spawn_daemon "$1" "$ns" \
132 tcpdump -i any -s 65535
139 ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py add-flow "$2" "$3" "$4"
140 if [ $? -ne 0 ]; then
149 ovs_sbx "$1" python3 $ovs_base/ovs-dpctl.py del-flows "$2"
157 perf record -a -q -e skb:kfree_skb -o ${ovs_dir}/perf.data $* \
166 local perf_output=`perf script -i ${ovs_dir}/perf.data -F trace:event,trace`
169 return `echo "$perf_output" | grep "$pattern" | wc -l`
175 echo "If no TEST argument is given, all tests will be run."
178 echo " -t: capture traffic via tcpdump"
179 echo " -v: verbose"
180 echo " -p: pause on failure"
187 # - drop packets and verify the right drop reason is reported
203 ip netns exec client ip link set c1 up
207 ip netns exec server ip link set s1 up
213 info "no support for drop reasons - skipping"
232 ovs_drop_record_and_run "test_drop_reason" ip netns exec client ping -c 2 172.31.110.20
234 if [[ "$?" -ne "2" ]]; then
243 # Drop UDP 7000 traffic with an explicit action with no error code.
249 "test_drop_reason" ip netns exec client nc -i 1 -zuv 172.31.110.20 6000
251 if [[ "$?" -ne "1" ]]; then
257 "test_drop_reason" ip netns exec client nc -i 1 -zuv 172.31.110.20 7000
259 if [[ "$?" -ne "1" ]]; then
268 # - client has 1500 byte MTU
269 # - server has 1500 byte MTU
270 # - send ARP ping between two ns
287 ip netns exec client ip link set c1 up
288 …HW_CLIENT=`ip netns exec client ip link show dev c1 | grep -E 'link/ether [0-9a-f:]+' | awk '{prin…
293 ip netns exec server ip link set s1 up
294 …HW_SERVER=`ip netns exec server ip link show dev s1 | grep -E 'link/ether [0-9a-f:]+' | awk '{prin…
302 ovs_sbx "test_arp_ping" ip netns exec client arping -I c1 172.31.110.20 -c 1 || return 1
308 # - client has 1500 byte MTU
309 # - server has 1500 byte MTU
310 # - use ICMP to ping in each direction
311 # - only allow CT state stuff to pass through new in c -> s
326 ip netns exec client ip link set c1 up
328 ip netns exec server ip link set s1 up
330 # Add forwarding for ARP and ip packets - completely wildcarded
336 'ct_state(-trk),eth(),eth_type(0x0800),ipv4()' \
352 ovs_sbx "test_ct_connect_v4" ip netns exec client ping 172.31.110.20 -c 3 || return 1
357 nc -lvnp 4443
358 ovs_sbx "test_ct_connect_v4" ip netns exec client nc -i 1 -zv 172.31.110.20 4443 || return 1
363 nc -lvnp 4443
364 ovs_sbx "test_ct_connect_v4" ip netns exec client nc -i 1 -zv 172.31.110.10 4443
375 # - client has 1500 byte MTU
376 # - server has 1500 byte MTU
377 # - use ICMP to ping in each direction
392 ip netns exec client ip link set c1 up
394 ip netns exec server ip link set s1 up
396 # Add forwarding for ARP and ip packets - completely wildcarded
407 ovs_sbx "test_connect_v4" ip netns exec client ping 172.31.110.20 -c 3 || return 1
414 # - client has 1500 byte MTU
415 # - server has 1500 byte MTU
416 # - use ICMP to ping in each direction
417 # - only allow CT state stuff to pass through new in c -> s
431 ip netns exec client ip link set c1 up
433 ip netns exec server ip link set s1 up
442 "ct_state(-trk),in_port(1),eth(),eth_type(0x0800),ipv4(dst=192.168.0.20)" \
445 "ct_state(-trk),in_port(2),eth(),eth_type(0x0800),ipv4()" \
449 "recirc_id(0x1),ct_state(+trk-inv),in_port(1),eth(),eth_type(0x0800),ipv4()" "2"
451 "recirc_id(0x2),ct_state(+trk-inv),in_port(2),eth(),eth_type(0x0800),ipv4()" "1"
454 ovs_sbx "test_nat_connect_v4" ip netns exec client ping 192.168.0.20 -c 3 || return 1
459 nc -lvnp 4443
460 ovs_sbx "test_nat_connect_v4" ip netns exec client nc -i 1 -zv 192.168.0.20 4443 || return 1
465 nc -lvnp 4443
466 ovs_sbx "test_nat_connect_v4" ip netns exec client nc -i 1 -zv 172.31.110.10 4443
477 # - Create a dp
478 # - check no warning with "old version" simulation
485 PRE_TEST=$(dmesg | grep -E "RIP: [0-9a-fA-Fx]+:ovs_dp_cmd_new\+")
486 ovs_add_dp "test_netlink_checks" nv0 -V 0 || return 1
487 POST_TEST=$(dmesg | grep -E "RIP: [0-9a-fA-Fx]+:ovs_dp_cmd_new\+")
489 info "failed - gen warning"
497 [ $(python3 $ovs_base/ovs-dpctl.py show nv0 | grep port | \
498 wc -l) == 3 ] || \
501 [ $(python3 $ovs_base/ovs-dpctl.py show nv0 | grep port | \
502 wc -l) == 2 ] || \
507 PRE_TEST=$(dmesg | grep -c "${ERR_MSG}")
512 POST_TEST=$(dmesg | grep -c "${ERR_MSG}")
515 info "failed - clone depth too large"
519 PRE_TEST=$(dmesg | grep -c "${ERR_MSG}")
523 POST_TEST=$(dmesg | grep -c "${ERR_MSG}")
525 info "failed - error not generated"
535 ovs_add_dp "test_upcall_interfaces" ui0 -V 2:1 || return 1
538 172.31.110.1/24 -u || return 1
542 ip netns exec upc arping -I l0 172.31.110.20 -c 1 \
545 …grep -E "MISS upcall\[0/yes\]: .*arp\(sip=172.31.110.1,tip=172.31.110.20,op=1,sha=" $ovs_dir/left0…
555 stdbuf -o0 printf "TEST: %-60s [NOMOD]\n" "${tdesc}"
559 if python3 ovs-dpctl.py -h 2>&1 | \
560 grep -E "Need to (install|upgrade) the python" >/dev/null 2>&1; then
561 stdbuf -o0 printf "TEST: %-60s [PYLIB]\n" "${tdesc}"
564 printf "TEST: %-60s [START]\n" "${tname}"
571 if [ $ret -eq 0 ]; then
572 printf "TEST: %-60s [ OK ]\n" "${tdesc}"
574 rm -rf "$ovs_dir"
575 elif [ $ret -eq 1 ]; then
576 printf "TEST: %-60s [FAIL]\n" "${tdesc}"
583 [ "${PAUSE_ON_FAIL}" = "yes" ] || rm -rf "$ovs_dir"
585 elif [ $ret -eq $ksft_skip ]; then
586 printf "TEST: %-60s [SKIP]\n" "${tdesc}"
587 elif [ $ret -eq 2 ]; then
588 rm -rf test_${tname}
631 shift $(($OPTIND-1))
638 command -v > /dev/null "test_${arg}" || { echo "=== Test ${arg} not found"; usage; }
649 [ "${arg}" != "${arg#--*}" ] && continue
653 if [ $run_this -eq 1 ]; then