Lines Matching +full:local +full:- +full:pid

2 # SPDX-License-Identifier: GPL-2.0
4 net_dir=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")")
28 # Per-test return value. Clear at the beginning of each test.
36 local a=$1; shift
37 local b=$1; shift
38 local -A weights
39 local weight=0
41 local i
57 local a=$1; shift
58 local b=$1; shift
66 local a=$1; shift
67 local b=$1; shift
75 local sleep_cmd=$1; shift
76 local timeout_ms=$1; shift
78 local start_time="$(date -u +%s%3N)"
81 local out
83 echo -n "$out"
87 local current_time="$(date -u +%s%3N)"
88 if ((current_time - start_time > timeout_ms)); then
89 echo -n "$out"
99 local timeout_ms=$1; shift
107 local timeout_sec=$1; shift
114 local expr=$1; shift
115 local current=$("$@")
123 local timeout=$1; shift
124 local delta=$1; shift
126 local base=$("$@")
132 local timeout=$1; shift
133 local delta=$1; shift
135 local base=$("$@")
143 local prog_name=$1; shift
156 local item=$1
157 local ns
158 local ns_list=("${NS_LIST[@]}")
170 local ns=""
171 local ret=0
174 [ -z "${ns}" ] && continue
175 ip netns pids "${ns}" 2> /dev/null | xargs -r kill || true
177 if ! busywait $BUSYWAIT_TIMEOUT ip netns list \| grep -vq "^$ns$" &> /dev/null; then
194 # setup_ns local remote
197 local ns_name=""
198 local ns_list=()
200 # avoid conflicts with local var: internal error
208 if [ -z "${!ns_name}" ]; then
209 eval "${ns_name}=${ns_name,,}-$(mktemp -u XXXXXX)"
219 ip -n "${!ns_name}" link set lo up
227 local id="$1"
228 local ns="$2"
234 local dev=$(ip netns exec $ns ls /sys/bus/netdevsim/devices/netdevsim$id/net)
235 ip -netns $ns link set dev $dev name nsim$id
236 ip -netns $ns link set dev nsim$id up
243 local id="$1"
245 if [ -d "/sys/bus/netdevsim/devices/netdevsim$id/net" ]; then
252 local dev=$1; shift
253 local pref=$1; shift
254 local dir=${1:-ingress}; shift
255 local selector=${1:-.packets}; shift
257 tc -j -s filter show dev $dev $dir pref $pref \
263 local id=$1; shift
264 local handle=$1; shift
265 local selector=${1:-.packets}; shift
266 local netns=${1:-""}; shift
268 tc $netns -j -s filter show $id \
275 local ksft_status=$1; shift
276 local msg=$1; shift
286 local test_name=$1; shift
287 local opt_str=$1; shift
288 local result=$1; shift
289 local retmsg=$1; shift
291 printf "TEST: %-60s [%s]\n" "$test_name $opt_str" "$result"
308 local test_name=$1; shift
309 local opt_str=$1; shift
316 local test_name=$1; shift
317 local opt_str=$1; shift
325 local test_name=$1; shift
326 local opt_str=$1; shift
334 local test_name=$1; shift
335 local opt_str=$1; shift
342 local test_name=$1
343 local opt_str=$2
345 if [[ $# -eq 2 ]]; then
375 local msg=$1
382 local current_test
384 for current_test in ${TESTS:-$ALL_TESTS}; do
395 local err=$1
396 local msg=$2
409 local err=$1
410 local msg=$2
417 local should_fail=$1; shift
418 local err=$1; shift
419 local what=$1; shift
451 local dev=$1; shift
452 local kind
454 kind=$(ip -j -d link show dev $dev |
455 jq -r '.[].linkinfo.info_kind')
465 local if_name=$1
467 ip -j link show dev $if_name | jq -r '.[]["address"]'
472 local pid=$1; shift
475 { kill $pid && wait $pid; } 2>/dev/null
480 local cmd=$1; shift
482 if [[ ! -x "$(command -v "$cmd")" ]]; then
490 local cmd=$1; shift
499 local name=$1; shift
507 local member=$1; shift
508 local master=$1; shift
516 local name=$1; shift
517 local addr=$1; shift
519 local old_addr=$(mac_get "$name")
526 local name=$1; shift
528 local state=$(ip -j link show "$name" |
529 jq -r '(.[].flags[] | select(. == "UP")) // "DOWN"')
535 local name=$1; shift
545 local name=$1; shift
555 local name=$1; shift