Lines Matching +full:rx +full:- +full:eq
2 # SPDX-License-Identifier: GPL-2.0
12 readonly KSFT_TEST="${MPTCP_LIB_KSFT_TEST:-$(basename "${0}" .sh)}"
14 # These variables are used in some selftests, read-only
15 declare -rx MPTCP_LIB_EVENT_CREATED=1 # MPTCP_EVENT_CREATED
16 declare -rx MPTCP_LIB_EVENT_ESTABLISHED=2 # MPTCP_EVENT_ESTABLISHED
17 declare -rx MPTCP_LIB_EVENT_CLOSED=3 # MPTCP_EVENT_CLOSED
18 declare -rx MPTCP_LIB_EVENT_ANNOUNCED=6 # MPTCP_EVENT_ANNOUNCED
19 declare -rx MPTCP_LIB_EVENT_REMOVED=7 # MPTCP_EVENT_REMOVED
20 declare -rx MPTCP_LIB_EVENT_SUB_ESTABLISHED=10 # MPTCP_EVENT_SUB_ESTABLISHED
21 declare -rx MPTCP_LIB_EVENT_SUB_CLOSED=11 # MPTCP_EVENT_SUB_CLOSED
22 declare -rx MPTCP_LIB_EVENT_SUB_PRIORITY=13 # MPTCP_EVENT_SUB_PRIORITY
23 declare -rx MPTCP_LIB_EVENT_LISTENER_CREATED=15 # MPTCP_EVENT_LISTENER_CREATED
24 declare -rx MPTCP_LIB_EVENT_LISTENER_CLOSED=16 # MPTCP_EVENT_LISTENER_CLOSED
26 declare -rx MPTCP_LIB_AF_INET=2
27 declare -rx MPTCP_LIB_AF_INET6=10
34 MPTCP_LIB_TEST_FORMAT="%02u %-50s"
37 # only if supported (or forced) and not disabled, see no-color.org
38 if { [ -t 1 ] || [ "${SELFTESTS_MPTCP_LIB_COLOR_FORCE:-}" = "1" ]; } &&
39 [ "${NO_COLOR:-}" != "1" ]; then
56 [ "${SELFTESTS_MPTCP_LIB_OVERRIDE_FLAKY:-}" = 1 ]
65 echo -e "${MPTCP_LIB_START_PRINT:-}${*}${MPTCP_LIB_COLOR_RESET}"
110 # $1-2: listener/connector ns ; $3 port ; $4-5 listener/connector stat file
118 echo -en "${MPTCP_LIB_COLOR_RED}"
121 ip netns exec "${lns}" ss -Menitam -o "sport = :${port}"
125 ip netns exec "${cns}" ss -Menitam -o "dport = :${port}"
128 echo -en "${MPTCP_LIB_COLOR_RESET}"
135 [ "${SELFTESTS_MPTCP_LIB_EXPECT_ALL_FEATURES:-}" = "1" ]
152 if [ -f "${f}" ]; then
179 grep -q " ${sym}" /proc/kallsyms
214 if [ "${SELFTESTS_MPTCP_LIB_NO_KVERSION_CHECK:-}" = "1" ]; then
218 v=$(uname -r | cut -d'.' -f1,2)
222 if [ "${maj}" -gt "${exp_maj}" ] ||
223 { [ "${maj}" -eq "${exp_maj}" ] && [ "${min}" -ge "${exp_min}" ]; }; then
239 if [[ "${subtest}" == *" - ${KSFT_TEST}: ${*%% #*}" ]]; then
262 time+="$((MPTCP_LIB_SUBTESTS_LAST_TS_MS - ts_prev_ms))ms"
264 MPTCP_LIB_SUBTESTS+=("${result} ${id} - ${KSFT_TEST}: ${*} ${time}")
313 if [ ${#MPTCP_LIB_SUBTESTS[@]} -eq 0 ] ||
314 [ "${SELFTESTS_MPTCP_LIB_NO_TAP:-}" = "1" ]; then
334 grep "${2}" | sed -n 's/.*\('"${1}"':\)\([0-9a-f:.]*\).*$/\2/p;q'
339 grep "${4:-}" "${2}" | mptcp_lib_get_info_value "${1}" "^type:${3:-1},"
344 [ "${1}" -eq 0 ] && return 0
346 kill -SIGUSR1 "${1}" > /dev/null 2>&1
353 [ -z "${1##*:*}" ]
362 count=$(ip netns exec "${ns}" nstat -asz "${counter}" |
364 if [ -z "${count}" ]; then
378 echo -e "\nMPTCP_TEST_FILE_END_MARKER" >> "${name}"
383 ls -l "${1}" 1>&2
385 tail -c 27 "${1}"
421 if [ ${cmd_ret} -ne 0 ]; then
439 if ! ip -Version &> /dev/null; then
445 if ! tc -help &> /dev/null; then
451 if ! ss -h | grep -q MPTCP; then
457 if ! "${tool}" -V &> /dev/null; then
478 ip netns exec "${!netns}" sysctl -q net.mptcp.enabled=1
479 ip netns exec "${!netns}" sysctl -q net.ipv4.conf.all.rp_filter=0
480 ip netns exec "${!netns}" sysctl -q net.ipv4.conf.default.rp_filter=0
489 rm -f /tmp/"${netns}".{nstat,out}
496 declare -n pid="${3}"
500 mptcp_lib_kill_wait "${pid:-0}"
582 IFS=, read -r id ip flags dev port <<< "${entry}"
584 echo -n "${ip}"
585 [ -n "${port}" ] && echo -n " port ${port}"
586 echo -n " id ${id}"
587 [ -n "${flags}" ] && echo -n " ${flags}"
588 [ -n "${dev}" ] && echo -n " dev ${dev}"
591 echo -n "id ${id}"
592 echo -n " flags ${flags//" "/","}"
593 [ -n "${dev}" ] && echo -n " dev ${dev}"
594 echo -n " ${ip}"
595 [ -n "${port}" ] && echo -n " ${port}"
606 ip -n "${ns}" mptcp endpoint show id "${id}"
618 ip -n "${ns}" mptcp limits set add_addr_accepted "${addrs}" subflows "${subflows}"
643 ip -n "${ns}" mptcp endpoint add "${addr}" ${flags//","/" "} \
657 [ "${id}" -ne 0 ] && addr=''
658 ip -n "${ns}" mptcp endpoint delete id "${id}" ${addr:+"${addr}"}
668 ip -n "${ns}" mptcp endpoint flush
678 ip -n "${ns}" mptcp endpoint show
691 ip -n "${ns}" mptcp endpoint change id "${id}" ${flags//","/" "}