3 # Run select tests by setting ONLY, or as arguments to the script.
4 # Skip specific tests by setting EXCEPT.
11 # bug number for skipped test:
12 ALWAYS_EXCEPT="$SANITY_LNET_EXCEPT "
13 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
15 # skip the grant tests for ARM until they are fixed
16 if [[ $(uname -m) = aarch64 ]]; then
17 # bug number: LU-14067
21 [ "$SLOW" = "no" ] && EXCEPT_SLOW=""
23 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
25 . $LUSTRE/tests/test-framework.sh
29 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
34 [[ -z $LNETCTL ]] && skip "Need lnetctl"
38 if is_mounted $MOUNT || is_mounted $MOUNT2; then
39 cleanupall || error "Failed cleanup prior to test execution"
44 echo "Cleaning up LNet"
45 lsmod | grep -q lnet &&
46 $LNETCTL lnet unconfigure 2>/dev/null
51 if module_loaded lnet ; then
52 cleanup_lnet || error "Failed to unload modules before test execution"
58 # Cleanup any tmp files created by the sub tests
59 rm -f $TMP/sanity-lnet-*.yaml $LNET_PARAMS_FILE
62 if $restore_mounts; then
63 setupall || error "Failed to setup Lustre after test execution"
64 elif $restore_modules; then
66 error "Couldn't load modules after test execution"
75 echo "ip netns exec $TESTNS $*"
76 ip netns exec $TESTNS "$@"
84 netns_arg="netns $netns"
86 ip link add 'test1pl' type veth peer name $FAKE_IF $netns_arg
87 ip link set 'test1pl' up
88 if [[ -n $netns ]]; then
89 do_ns ip addr add "${FAKE_IP}/31" dev $FAKE_IF
90 do_ns ip link set $FAKE_IF up
92 ip addr add "${FAKE_IP}/31" dev $FAKE_IF
93 ip link set $FAKE_IF up
98 ip link show test1pl >& /dev/null && ip link del test1pl || return 0
109 (ip netns list | grep -q $TESTNS) && ip netns del $TESTNS
114 echo "Loading LNet and configuring DLC"
116 do_lnetctl lnet configure
119 GLOBAL_YAML_FILE=$TMP/sanity-lnet-global.yaml
120 define_global_yaml() {
121 $LNETCTL export --backup >${GLOBAL_YAML_FILE} ||
122 error "Failed to export global yaml $?"
126 if lsmod | grep -q lnet; then
127 do_lnetctl lnet unconfigure ||
128 error "lnetctl lnet unconfigure failed $?"
129 do_lnetctl lnet configure ||
130 error "lnetctl lnet configure failed $?"
132 configure_dlc || error "configure_dlc failed $?"
137 append_global_yaml() {
138 [[ ! -e ${GLOBAL_YAML_FILE} ]] &&
139 error "Missing global yaml at ${GLOBAL_YAML_FILE}"
141 cat ${GLOBAL_YAML_FILE} >> $TMP/sanity-lnet-$testnum-expected.yaml
144 create_base_yaml_file() {
148 compare_yaml_files() {
149 local expected="$TMP/sanity-lnet-$testnum-expected.yaml"
150 local actual="$TMP/sanity-lnet-$testnum-actual.yaml"
152 ! [[ -e $expected ]] && echo "$expected not found" && return 1
153 ! [[ -e $actual ]] && echo "$actual not found" && return 1
154 diff -upN ${actual} ${expected} || rc=$?
164 local net="${nid//*@/}"
165 local addr="${nid//@*/}"
167 local num_re='[0-9]\+'
168 local ip_re="[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
170 if [[ $net =~ gni[0-9]* ]] || [[ $net =~ kfi[0-9]* ]]; then
171 [[ $addr =~ ${num_re} ]] && return 0
173 [[ $addr =~ ${ip_re} ]] && return 0
178 local yfile=$TMP/sanity-lnet-$testnum-actual.yaml
179 local primary_nids=$(awk '/- primary nid:/{print $NF}' $yfile | xargs echo)
180 local secondary_nids=$(awk '/- nid:/{print $NF}' $yfile | xargs echo)
181 local gateway_nids=$(awk '/gateway:/{print $NF}' $yfile | xargs echo)
184 for nid in $primary_nids $secondary_nids; do
185 validate_nid "$nid" || error "Bad NID \"${nid}\""
190 validate_peer_nids() {
192 local nids_per_peer="$2"
194 local expect_p="$num_peers"
195 # The primary nid also shows up in the list of secondary nids
196 local expect_s="$(($num_peers + $(($nids_per_peer*$num_peers))))"
198 local actual_p=$(grep -c -- '- primary nid:' $TMP/sanity-lnet-$testnum-actual.yaml)
199 local actual_s=$(grep -c -- '- nid:' $TMP/sanity-lnet-$testnum-actual.yaml)
200 if [[ $expect_p -ne $actual_p ]]; then
202 error "Expected $expect_p but found $actual_p primary nids"
203 elif [[ $expect_s -ne $actual_s ]]; then
205 error "Expected $expect_s but found $actual_s secondary nids"
210 validate_gateway_nids() {
211 local expect_gw=$(grep -c -- 'gateway:' $TMP/sanity-lnet-$testnum-expected.yaml)
212 local actual_gw=$(grep -c -- 'gateway:' $TMP/sanity-lnet-$testnum-actual.yaml)
213 if [[ $expect_gw -ne $actual_gw ]]; then
215 error "Expected $expect_gw gateways but found $actual_gw gateways"
221 setup_netns || error "setup_netns failed with $?"
223 # Determine the local interface(s) used for LNet
224 load_lnet "config_on_load=1" || error "Failed to load modules"
229 INTERFACES=( $(lnet_if_list) )
231 cleanup_lnet || error "Failed to cleanup LNet"
233 stack_trap 'cleanup_testsuite' EXIT
236 load_module ../lnet/lnet/lnet || error "Failed to load module rc = $?"
237 do_lnetctl lnet configure || error "lnet configure failed rc = $?"
239 reinit_dlc || return $?
240 do_lnetctl import < ${GLOBAL_YAML_FILE} || error "Import failed $?"
241 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
242 create_base_yaml_file
243 compare_yaml_files || error "Configuration changed after import"
245 run_test 0 "Export empty config, import the config, compare"
248 local prim_nid="${1:+--prim_nid $1}"
249 local nid="${2:+--nid $2}"
251 local actual="$TMP/sanity-lnet-$testnum-actual.yaml"
253 do_lnetctl peer add ${prim_nid} ${nid} || error "peer add failed $?"
254 $LNETCTL export --backup > $actual || error "export failed $?"
260 reinit_dlc || return $?
261 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
263 - primary nid: 1.1.1.1@tcp
269 compare_peer_add "1.1.1.1@tcp"
271 run_test 1 "Add peer with single nid (tcp)"
274 reinit_dlc || return $?
275 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
277 - primary nid: 2.2.2.2@o2ib
283 compare_peer_add "2.2.2.2@o2ib"
285 run_test 2 "Add peer with single nid (o2ib)"
288 reinit_dlc || return $?
289 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
291 - primary nid: 3.3.3.3@tcp
298 compare_peer_add "3.3.3.3@tcp" "3.3.3.3@o2ib"
300 run_test 3 "Add peer with tcp primary o2ib secondary"
303 reinit_dlc || return $?
304 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
306 - primary nid: 4.4.4.4@tcp
315 echo "Add peer with nidrange (tcp)"
316 compare_peer_add "4.4.4.4@tcp" "4.4.4.[1-3]@tcp"
318 echo "Add peer with nidrange that overlaps primary nid (tcp)"
319 compare_peer_add "4.4.4.4@tcp" "4.4.4.[1-4]@tcp"
321 run_test 4 "Add peer with nidrange (tcp)"
324 reinit_dlc || return $?
325 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
327 - primary nid: 5.5.5.5@o2ib
337 echo "Add peer with nidrange (o2ib)"
338 compare_peer_add "5.5.5.5@o2ib" "5.5.5.[1-4]@o2ib"
340 echo "Add peer with nidranage that overlaps primary nid (o2ib)"
341 compare_peer_add "5.5.5.5@o2ib" "5.5.5.[1-4]@o2ib"
343 run_test 5 "Add peer with nidrange (o2ib)"
346 reinit_dlc || return $?
347 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
349 - primary nid: 6.6.6.6@tcp
372 local nid_expr="6.6.[6-7].[0-4/2]@tcp"
373 nid_expr+=",6.6.[1-4/2].[0-6/3]@o2ib"
374 nid_expr+=",[6-12/4]@gni"
375 nid_expr+=",[6-12/4]@kfi"
377 compare_peer_add "6.6.6.6@tcp" "${nid_expr}"
379 run_test 6 "Add peer with multiple nidranges"
382 local prim_nid="${1:+--prim_nid $1}"
383 local nid="${2:+--nid $2}"
385 local actual="$TMP/sanity-lnet-$testnum-actual.yaml"
387 do_lnetctl peer del ${prim_nid} ${nid} || error "peer del failed $?"
388 $LNETCTL export --backup > $actual || error "export failed $?"
394 reinit_dlc || return $?
395 create_base_yaml_file
397 echo "Delete peer with single nid (tcp)"
398 do_lnetctl peer add --prim_nid 7.7.7.7@tcp || error "Peer add failed $?"
399 compare_peer_del "7.7.7.7@tcp"
401 echo "Delete peer with single nid (o2ib)"
402 do_lnetctl peer add --prim_nid 7.7.7.7@o2ib || error "Peer add failed $?"
403 compare_peer_del "7.7.7.7@o2ib"
405 echo "Delete peer that has multiple nids (tcp)"
406 do_lnetctl peer add --prim_nid 7.7.7.7@tcp --nid 7.7.7.[8-12]@tcp ||
407 error "Peer add failed $?"
408 compare_peer_del "7.7.7.7@tcp"
410 echo "Delete peer that has multiple nids (o2ib)"
411 do_lnetctl peer add --prim_nid 7.7.7.7@o2ib --nid 7.7.7.[8-12]@o2ib ||
412 error "Peer add failed $?"
413 compare_peer_del "7.7.7.7@o2ib"
415 echo "Delete peer that has both tcp and o2ib nids"
416 do_lnetctl peer add --prim_nid 7.7.7.7@tcp \
417 --nid 7.7.7.[9-12]@tcp,7.7.7.[13-15]@o2ib ||
418 error "Peer add failed $?"
419 compare_peer_del "7.7.7.7@tcp"
421 echo "Delete peer with single nid (gni)"
422 do_lnetctl peer add --prim_nid 7@gni || error "Peer add failed $?"
423 compare_peer_del "7@gni"
425 echo "Delete peer that has multiple nids (gni)"
426 do_lnetctl peer add --prim_nid 7@gni --nid [8-12]@gni ||
427 error "Peer add failed $?"
428 compare_peer_del "7@gni"
430 echo "Delete peer with single nid (kfi)"
431 do_lnetctl peer add --prim_nid 7@kfi || error "Peer add failed $?"
432 compare_peer_del "7@kfi"
434 echo "Delete peer that has multiple nids (kfi)"
435 do_lnetctl peer add --prim_nid 7@kfi --nid [8-12]@kfi ||
436 error "Peer add failed $?"
437 compare_peer_del "7@kfi"
439 echo "Delete peer that has tcp, o2ib, gni and kfi nids"
440 do_lnetctl peer add --prim_nid 7@gni \
441 --nid [8-12]@gni,7.7.7.[1-4]@tcp,7.7.7.[5-9]@o2ib,[1-5]@kfi ||
442 error "Peer add failed $?"
443 compare_peer_del "7@gni"
445 run_test 7 "Various peer delete tests"
448 reinit_dlc || return $?
450 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
452 - primary nid: 8.8.8.8@tcp
464 do_lnetctl peer add --prim_nid 8.8.8.8@tcp --nid 8.8.8.[10-15]@tcp ||
465 error "Peer add failed $?"
466 compare_peer_del "8.8.8.8@tcp" "8.8.8.13@tcp"
468 run_test 8 "Delete single secondary nid from peer (tcp)"
471 reinit_dlc || return $?
473 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
475 - primary nid: 9.9.9.9@tcp
482 do_lnetctl peer add --prim_nid 9.9.9.9@tcp \
483 --nid 9.9.9.[11-16]@tcp || error "Peer add failed $?"
484 compare_peer_del "9.9.9.9@tcp" "9.9.9.[11-16]@tcp"
486 run_test 9 "Delete all secondary nids from peer (tcp)"
489 reinit_dlc || return $?
491 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
493 - primary nid: 10.10.10.10@tcp
496 - nid: 10.10.10.10@tcp
497 - nid: 10.10.10.12@tcp
498 - nid: 10.10.10.13@tcp
499 - nid: 10.10.10.15@tcp
500 - nid: 10.10.10.16@tcp
503 do_lnetctl peer add --prim_nid 10.10.10.10@tcp \
504 --nid 10.10.10.[12-16]@tcp || error "Peer add failed $?"
505 compare_peer_del "10.10.10.10@tcp" "10.10.10.14@tcp"
507 run_test 10 "Delete single secondary nid from peer (o2ib)"
510 reinit_dlc || return $?
512 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
514 - primary nid: 11.11.11.11@tcp
517 - nid: 11.11.11.11@tcp
520 do_lnetctl peer add --prim_nid 11.11.11.11@tcp \
521 --nid 11.11.11.[13-17]@tcp || error "Peer add failed $?"
522 compare_peer_del "11.11.11.11@tcp" "11.11.11.[13-17]@tcp"
524 run_test 11 "Delete all secondary nids from peer (o2ib)"
527 reinit_dlc || return $?
529 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
531 - primary nid: 12.12.12.12@o2ib
534 - nid: 12.12.12.12@o2ib
535 - nid: 13.13.13.13@o2ib
536 - nid: 14.13.13.13@o2ib
537 - nid: 14.15.13.13@o2ib
539 - nid: 15.17.1.10@tcp
540 - nid: 15.17.1.20@tcp
543 do_lnetctl peer add --prim_nid 12.12.12.12@o2ib \
544 --nid [13-14/1].[13-15/2].13.13@o2ib,[15-16/3].[17-19/4].[1].[5-20/5]@tcp ||
545 error "Peer add failed $?"
546 compare_peer_del "12.12.12.12@o2ib" "13.15.13.13@o2ib,15.17.1.15@tcp"
548 run_test 12 "Delete a secondary nid from peer (tcp and o2ib)"
551 reinit_dlc || return $?
553 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
555 - primary nid: 13.13.13.13@o2ib
558 - nid: 13.13.13.13@o2ib
561 do_lnetctl peer add --prim_nid 13.13.13.13@o2ib \
562 --nid [14-15].[1-2/1].[1].[100-254/10]@tcp,14.14.[254].14@o2ib ||
563 error "Peer add failed $?"
564 compare_peer_del "13.13.13.13@o2ib" \
565 "[14-15].[1-2/1].[1].[100-254/10]@tcp,14.14.[254].14@o2ib"
567 run_test 13 "Delete all secondary nids from peer (tcp and o2ib)"
573 if [[ $net =~ gni* ]] || [[ $net =~ kfi* ]]; then
576 echo "${num}.${num}.${num}.${num}@${net}"
580 create_mr_peer_yaml() {
582 local secondary_nids="$2"
585 echo "Generating peer yaml for $num_peers peers with $secondary_nids secondary nids"
586 echo "peer:" >> $TMP/sanity-lnet-$testnum-expected.yaml
588 local total_nids=$((num_peers + $((num_peers * secondary_nids))))
591 while [[ $created -lt $num_peers ]]; do
592 local primary=$(create_nid ${nidnum} ${net})
593 cat <<EOF >> $TMP/sanity-lnet-$testnum-expected.yaml
594 - primary nid: $primary
600 local start=$((nidnum + 1))
601 local end=$((nidnum + $secondary_nids))
602 for j in $(seq ${start} ${end}); do
603 local nid=$(create_nid $j ${net})
604 echo " - nid: $nid" >> $TMP/sanity-lnet-$testnum-expected.yaml
612 reinit_dlc || return $?
614 echo "Create single peer, single nid, using import"
615 create_mr_peer_yaml 1 0 tcp
616 do_lnetctl import < $TMP/sanity-lnet-$testnum-expected.yaml ||
617 error "Import failed $?"
619 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
622 echo "Delete single peer using import --del"
623 do_lnetctl import --del < $TMP/sanity-lnet-$testnum-expected.yaml ||
624 error "Import failed $?"
625 rm -f $TMP/sanity-lnet-$testnum-expected.yaml
626 create_base_yaml_file
627 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
630 run_test 14 "import peer create/delete with single nid"
633 reinit_dlc || return $?
635 echo "Create multiple peers, single nid per peer, using import"
636 create_mr_peer_yaml 5 0 o2ib
637 # The ordering of nids for this use-case is non-deterministic, so we
638 # we can't just diff the expected/actual output.
639 do_lnetctl import < $TMP/sanity-lnet-$testnum-expected.yaml ||
640 error "Import failed $?"
641 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
642 validate_peer_nids 5 0
644 echo "Delete multiple peers, single nid per peer, using import --del"
645 do_lnetctl import --del < $TMP/sanity-lnet-$testnum-expected.yaml ||
646 error "Import failed $?"
647 rm -f $TMP/sanity-lnet-$testnum-expected.yaml
648 create_base_yaml_file
649 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
652 run_test 15 "import multi peer create/delete with single nid per peer"
655 reinit_dlc || return $?
657 echo "Create single peer, multiple nids, using import"
658 create_mr_peer_yaml 1 5 tcp
659 do_lnetctl import < $TMP/sanity-lnet-$testnum-expected.yaml ||
660 error "Import failed $?"
661 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
662 validate_peer_nids 1 5
664 echo "Delete single peer, multiple nids, using import --del"
665 do_lnetctl import --del < $TMP/sanity-lnet-$testnum-expected.yaml ||
666 error "Import failed $?"
667 rm -f $TMP/sanity-lnet-$testnum-expected.yaml
668 create_base_yaml_file
669 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
672 run_test 16 "import peer create/delete with multiple nids"
675 reinit_dlc || return $?
677 echo "Create multiple peers, multiple nids per peer, using import"
678 create_mr_peer_yaml 5 7 o2ib
679 do_lnetctl import < $TMP/sanity-lnet-$testnum-expected.yaml ||
680 error "Import failed $?"
681 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
682 validate_peer_nids 5 7
684 echo "Delete multiple peers, multiple nids per peer, using import --del"
685 do_lnetctl import --del < $TMP/sanity-lnet-$testnum-expected.yaml ||
686 error "Import failed $?"
687 rm -f $TMP/sanity-lnet-$testnum-expected.yaml
688 create_base_yaml_file
689 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
692 run_test 17 "import multi peer create/delete with multiple nids"
695 reinit_dlc || return $?
697 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
699 - primary nid: 1.1.1.1@tcp
708 echo "Import peer with 5 nids"
709 cat $TMP/sanity-lnet-$testnum-expected.yaml
710 do_lnetctl import < $TMP/sanity-lnet-$testnum-expected.yaml ||
711 error "Import failed $?"
712 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
714 - primary nid: 1.1.1.1@tcp
721 echo "Delete three of the nids"
722 cat $TMP/sanity-lnet-$testnum-expected.yaml
723 do_lnetctl import --del < $TMP/sanity-lnet-$testnum-expected.yaml
724 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
726 - primary nid: 1.1.1.1@tcp
732 echo "Check peer has expected nids remaining"
733 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
737 run_test 18a "Delete a subset of nids from a single peer using import --del"
740 reinit_dlc || return $?
742 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
744 - primary nid: 1.1.1.1@tcp
752 - primary nid: 6.6.6.6@o2ib
761 echo "Import two peers with 5 nids each"
762 cat $TMP/sanity-lnet-$testnum-expected.yaml
763 do_lnetctl import < $TMP/sanity-lnet-$testnum-expected.yaml ||
764 error "Import failed $?"
765 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
767 - primary nid: 1.1.1.1@tcp
773 - primary nid: 6.6.6.6@o2ib
780 echo "Delete three of the nids from each peer"
781 cat $TMP/sanity-lnet-$testnum-expected.yaml
782 do_lnetctl import --del < $TMP/sanity-lnet-$testnum-expected.yaml
783 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
785 - primary nid: 6.6.6.6@o2ib
790 - primary nid: 1.1.1.1@tcp
797 echo "Check peers have expected nids remaining"
798 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
800 validate_peer_nids 2 1
802 run_test 18b "Delete multiple nids from multiple peers using import --del"
805 reinit_dlc || return $?
806 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
808 - primary nid: 19@gni
814 compare_peer_add "19@gni"
816 run_test 19 "Add peer with single nid (gni)"
819 reinit_dlc || return $?
820 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
822 - primary nid: 20@gni
826 - nid: 20.20.20.20@tcp
827 - nid: 20.20.20.20@o2ib
830 compare_peer_add "20@gni" "20.20.20.20@tcp,20.20.20.20@o2ib"
832 run_test 20 "Add peer with gni primary and tcp, o2ib secondary"
835 reinit_dlc || return $?
836 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
838 - primary nid: 21@gni
848 echo "Add peer with nidrange (gni)"
849 compare_peer_add "21@gni" "[22-25]@gni" || error
850 echo "Add peer with nidrange that overlaps primary nid (gni)"
851 compare_peer_add "21@gni" "[21-25]@gni"
853 run_test 21 "Add peer with nidrange (gni)"
856 reinit_dlc || return $?
857 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
859 - primary nid: 22@gni
870 do_lnetctl peer add --prim_nid 22@gni --nid [24-29]@gni ||
871 error "Peer add failed $?"
872 compare_peer_del "22@gni" "26@gni"
874 run_test 22 "Delete single secondary nid from peer (gni)"
877 reinit_dlc || return $?
878 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
880 - primary nid: 23@gni
887 do_lnetctl peer add --prim_nid 23@gni --nid [25-29]@gni ||
888 error "Peer add failed $?"
889 compare_peer_del "23@gni" "[25-29]@gni"
891 run_test 23 "Delete all secondary nids from peer (gni)"
894 reinit_dlc || return $?
895 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
897 - primary nid: 24@gni
902 - nid: 13.13.13.13@o2ib
903 - nid: 14.13.13.13@o2ib
904 - nid: 14.15.13.13@o2ib
906 - nid: 15.17.1.10@tcp
907 - nid: 15.17.1.20@tcp
910 do_lnetctl peer add --prim_nid 24@gni \
911 --nid [13-14/1].[13-15/2].13.13@o2ib,[15-16/3].[17-19/4].[1].[5-20/5]@tcp,[5-12/6]@gni ||
912 error "Peer add failed $?"
913 compare_peer_del "24@gni" "5@gni,13.15.13.13@o2ib,15.17.1.15@tcp"
915 run_test 24 "Delete a secondary nid from peer (tcp, o2ib and gni)"
918 reinit_dlc || return $?
919 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
921 - primary nid: 25@gni
927 do_lnetctl peer add --prim_nid 25@gni \
928 --nid [26-27].[4-10/3].26.26@tcp,26.26.26.26@o2ib,[30-35]@gni ||
929 error "Peer add failed $?"
930 compare_peer_del "25@gni" \
931 "[26-27].[4-10/3].26.26@tcp,26.26.26.26@o2ib,[30-35]@gni"
933 run_test 25 "Delete all secondary nids from peer (tcp, gni and o2ib)"
936 reinit_dlc || return $?
938 echo "Invalid prim_nid - peer add"
939 do_lnetctl peer add --prim_nid foobar &&
940 error "Command should have failed"
942 echo "Invalid prim_nid - peer del"
943 do_lnetctl peer del --prim_nid foobar &&
944 error "Command should have failed"
946 echo "Delete non-existing peer"
947 do_lnetctl peer del --prim_nid 1.1.1.1@o2ib &&
948 error "Command should have failed"
950 echo "Don't provide mandatory argument for peer del"
951 do_lnetctl peer del --nid 1.1.1.1@tcp &&
952 error "Command should have failed"
954 echo "Don't provide mandatory argument for peer add"
955 do_lnetctl peer add --nid 1.1.1.1@tcp &&
956 error "Command should have failed"
958 echo "Don't provide mandatory arguments peer add"
959 do_lnetctl peer add &&
960 error "Command should have failed"
962 echo "Invalid secondary nids"
963 do_lnetctl peer add --prim_nid 1.1.1.1@tcp --nid foobar &&
964 error "Command should have failed"
966 echo "Exceed max nids per peer"
967 do_lnetctl peer add --prim_nid 1.1.1.1@tcp --nid 1.1.1.[2-255]@tcp &&
968 error "Command should have failed"
970 echo "Invalid net type"
971 do_lnetctl peer add --prim_nid 1@foo &&
972 error "Command should have failed"
974 echo "Invalid nid format"
975 local invalid_nids="1@tcp 1@o2ib 1.1.1.1@gni"
978 for nid in ${invalid_nids}; do
979 echo "Check invalid primary nid - '$nid'"
980 do_lnetctl peer add --prim_nid $nid &&
981 error "Command should have failed"
984 local invalid_strs="[2-1]@gni [a-f/x]@gni 256.256.256.256@tcp"
985 invalid_strs+=" 1.1.1.1.[2-5/f]@tcp 1.]2[.3.4@o2ib"
986 invalid_strs+="1.[2-4,[5-6],7-8].1.1@tcp foobar"
989 for nidstr in ${invalid_strs}; do
990 echo "Check invalid nidstring - '$nidstr'"
991 do_lnetctl peer add --prim_nid 1.1.1.1@tcp --nid $nidstr &&
992 error "Command should have failed"
995 echo "Add non-local gateway"
996 do_lnetctl route add --net tcp --gateway 1@gni &&
997 error "Command should have failed"
1001 run_test 99a "Check various invalid inputs to lnetctl peer"
1004 reinit_dlc || return $?
1006 create_base_yaml_file
1008 cat <<EOF > $TMP/sanity-lnet-$testnum-invalid.yaml
1010 - primary nid: 99.99.99.99@tcp
1013 - nid: 99.99.99.99@tcp
1015 do_lnetctl import < $TMP/sanity-lnet-$testnum-invalid.yaml &&
1016 error "import should have failed"
1017 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-actual.yaml
1020 run_test 99b "Invalid value for Multi-Rail in yaml import"
1024 local ip=$(ip addr show dev $if | awk '/ inet /{print $2}')
1032 if ! lsmod | grep -q ksocklnd ; then
1033 load_module ../lnet/klnds/socklnd/ksocklnd ||
1034 error "Can't load ksocklnd.ko"
1037 do_lnetctl net add --net ${net} --if ${if} ||
1038 error "Failed to add net ${net} on if ${if}"
1041 compare_route_add() {
1045 local actual="$TMP/sanity-lnet-$testnum-actual.yaml"
1047 do_lnetctl route add --net ${rnet} --gateway ${gw} ||
1048 error "route add failed $?"
1049 # CPT configuration is pruned from the exported yaml, since the default
1050 # can vary across test systems (unlike default values for things like
1051 # peer_credits, peer_timeout, etc.)
1052 $LNETCTL export --backup | grep -v CPT > $actual ||
1053 error "export failed $?"
1054 validate_gateway_nids
1059 reinit_dlc || return $?
1060 add_net "tcp" "${INTERFACES[0]}"
1061 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
1070 peer_buffer_credits: 0
1076 gateway: 7.7.7.7@tcp
1079 health_sensitivity: 1
1081 - primary nid: 7.7.7.7@tcp
1087 compare_route_add "tcp7" "7.7.7.7@tcp" || return $?
1090 run_test 100 "Add route with single gw (tcp)"
1093 reinit_dlc || return $?
1094 add_net "tcp" "${INTERFACES[0]}"
1095 cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
1104 peer_buffer_credits: 0
1110 gateway: 8.8.8.10@tcp
1113 health_sensitivity: 1
1115 gateway: 8.8.8.9@tcp
1118 health_sensitivity: 1
1120 gateway: 8.8.8.8@tcp
1123 health_sensitivity: 1
1125 - primary nid: 8.8.8.9@tcp
1129 - primary nid: 8.8.8.10@tcp
1133 - primary nid: 8.8.8.8@tcp
1139 compare_route_add "tcp8" "8.8.8.[8-10]@tcp"
1141 run_test 101 "Add route with multiple gw (tcp)"
1143 compare_route_del() {
1147 local actual="$TMP/sanity-lnet-$testnum-actual.yaml"
1149 do_lnetctl route del --net ${rnet} --gateway ${gw} ||
1150 error "route del failed $?"
1151 $LNETCTL export --backup > $actual ||
1152 error "export failed $?"
1153 validate_gateway_nids
1157 reinit_dlc || return $?
1158 add_net "tcp" "${INTERFACES[0]}"
1159 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-expected.yaml
1160 do_lnetctl route add --net tcp102 --gateway 102.102.102.102@tcp ||
1161 error "route add failed $?"
1162 compare_route_del "tcp102" "102.102.102.102@tcp"
1164 run_test 102 "Delete route with single gw (tcp)"
1167 reinit_dlc || return $?
1168 add_net "tcp" "${INTERFACES[0]}"
1169 $LNETCTL export --backup > $TMP/sanity-lnet-$testnum-expected.yaml
1170 do_lnetctl route add --net tcp103 \
1171 --gateway 103.103.103.[103-120/4]@tcp ||
1172 error "route add failed $?"
1173 compare_route_del "tcp103" "103.103.103.[103-120/4]@tcp"
1175 run_test 103 "Delete route with multiple gw (tcp)"
1178 local tyaml="$TMP/sanity-lnet-$testnum-expected.yaml"
1180 reinit_dlc || return $?
1182 # Default value is '3'
1183 local val=$($LNETCTL global show | awk '/response_tracking/{print $NF}')
1185 error "Expect 3 found $val"
1187 echo "Set < 0; Should fail"
1188 do_lnetctl set response_tracking -1 &&
1189 error "should have failed $?"
1191 reinit_dlc || return $?
1194 response_tracking: -10
1196 do_lnetctl import < $tyaml &&
1197 error "should have failed $?"
1199 echo "Check valid values; Should succeed"
1201 for ((i = 0; i < 4; i++)); do
1202 reinit_dlc || return $?
1203 do_lnetctl set response_tracking $i ||
1204 error "should have succeeded $?"
1205 $LNETCTL global show | grep -q "response_tracking: $i" ||
1206 error "Failed to set response_tracking to $i"
1207 reinit_dlc || return $?
1210 response_tracking: $i
1212 do_lnetctl import < $tyaml ||
1213 error "should have succeeded $?"
1214 $LNETCTL global show | grep -q "response_tracking: $i" ||
1215 error "Failed to set response_tracking to $i"
1218 reinit_dlc || return $?
1219 echo "Set > 3; Should fail"
1220 do_lnetctl set response_tracking 4 &&
1221 error "should have failed $?"
1223 reinit_dlc || return $?
1226 response_tracking: 10
1228 do_lnetctl import < $tyaml &&
1229 error "should have failed $?"
1232 run_test 104 "Set/check response_tracking param"
1235 reinit_dlc || return $?
1236 add_net "tcp" "${INTERFACES[0]}"
1237 do_lnetctl route add --net tcp105 --gateway 105.105.105.105@tcp ||
1238 error "route add failed $?"
1239 do_lnetctl peer add --prim 105.105.105.105@tcp &&
1240 error "peer add should fail"
1244 run_test 105 "Adding duplicate GW peer should fail"
1247 reinit_dlc || return $?
1248 add_net "tcp" "${INTERFACES[0]}"
1249 do_lnetctl route add --net tcp106 --gateway 106.106.106.106@tcp ||
1250 error "route add failed $?"
1251 do_lnetctl peer del --prim 106.106.106.106@tcp &&
1252 error "peer del should fail"
1256 run_test 106 "Deleting GW peer should fail"
1259 cleanup_lnet || exit 1
1260 load_lnet "networks=\"\""
1261 do_ns $LNETCTL lnet configure --all || exit 1
1262 $LNETCTL net show --net tcp | grep -q "nid: ${FAKE_IP}@tcp$"
1264 run_test 200 "load lnet w/o module option, configure in a non-default namespace"
1267 cleanup_lnet || exit 1
1268 load_lnet "networks=tcp($FAKE_IF)"
1269 do_ns $LNETCTL lnet configure --all || exit 1
1270 $LNETCTL net show --net tcp | grep -q "nid: ${FAKE_IP}@tcp$"
1272 run_test 201 "load lnet using networks module options in a non-default namespace"
1275 cleanup_lnet || exit 1
1276 load_lnet "networks=\"\" ip2nets=\"tcp0($FAKE_IF) ${FAKE_IP}\""
1277 do_ns $LNETCTL lnet configure --all || exit 1
1278 $LNETCTL net show | grep -q "nid: ${FAKE_IP}@tcp$"
1280 run_test 202 "load lnet using ip2nets in a non-default namespace"
1283 ### Add the interfaces in the target namespace
1286 cleanup_lnet || exit 1
1288 do_lnetctl lnet configure || exit 1
1289 do_ns $LNETCTL net add --net tcp0 --if $FAKE_IF
1291 run_test 203 "add a network using an interface in the non-default namespace"
1293 LNET_PARAMS_FILE="$TMP/$TESTSUITE.parameters"
1294 function save_lnet_params() {
1295 $LNETCTL global show | egrep -v '^global:$' |
1296 sed 's/://' > $LNET_PARAMS_FILE
1299 function restore_lnet_params() {
1301 while read param value; do
1302 [[ $param == max_intf ]] && continue
1303 [[ $param == lnd_timeout ]] && continue
1304 $LNETCTL set ${param} ${value} ||
1305 error "Failed to restore ${param} to ${value}"
1306 done < $LNET_PARAMS_FILE
1309 function lnet_health_pre() {
1312 # Lower transaction timeout to speed up test execution
1313 $LNETCTL set transaction_timeout 10 ||
1314 error "Failed to set transaction_timeout $?"
1316 RETRY_PARAM=$($LNETCTL global show | awk '/retry_count/{print $NF}')
1317 RSND_PRE=$($LNETCTL stats show | awk '/resend_count/{print $NF}')
1318 LO_HVAL_PRE=$($LNETCTL net show -v 2 | awk '/health value/{print $NF}' |
1319 xargs echo | sed 's/ /+/g' | bc -l)
1321 RMT_HVAL_PRE=$($LNETCTL peer show --nid ${RNIDS[0]} -v 2 2>/dev/null |
1322 awk '/health value/{print $NF}' | xargs echo |
1323 sed 's/ /+/g' | bc -l)
1325 # Might not have any peers so initialize to zero.
1326 RMT_HVAL_PRE=${RMT_HVAL_PRE:-0}
1331 function lnet_health_post() {
1332 RSND_POST=$($LNETCTL stats show | awk '/resend_count/{print $NF}')
1333 LO_HVAL_POST=$($LNETCTL net show -v 2 |
1334 awk '/health value/{print $NF}' |
1335 xargs echo | sed 's/ /+/g' | bc -l)
1337 RMT_HVAL_POST=$($LNETCTL peer show --nid ${RNIDS[0]} -v 2 2>/dev/null |
1338 awk '/health value/{print $NF}' | xargs echo |
1339 sed 's/ /+/g' | bc -l)
1341 # Might not have any peers so initialize to zero.
1342 RMT_HVAL_POST=${RMT_HVAL_POST:-0}
1345 echo "Pre resends: $RSND_PRE" &&
1346 echo "Post resends: $RSND_POST" &&
1347 echo "Resends delta: $((RSND_POST - RSND_PRE))" &&
1348 echo "Pre local health: $LO_HVAL_PRE" &&
1349 echo "Post local health: $LO_HVAL_POST" &&
1350 echo "Pre remote health: $RMT_HVAL_PRE" &&
1351 echo "Post remote health: $RMT_HVAL_POST"
1355 do_lnetctl peer set --health 1000 --all
1356 do_lnetctl net set --health 1000 --all
1361 function check_no_resends() {
1362 echo "Check that no resends took place"
1363 [[ $RSND_POST -ne $RSND_PRE ]] &&
1364 error "Found resends: $RSND_POST != $RSND_PRE"
1369 function check_resends() {
1370 local delta=$((RSND_POST - RSND_PRE))
1372 echo "Check that $RETRY_PARAM resends took place"
1373 [[ $delta -ne $RETRY_PARAM ]] &&
1374 error "Expected $RETRY_PARAM resends found $delta"
1379 function check_no_local_health() {
1380 echo "Check that local NI health is unchanged"
1381 [[ $LO_HVAL_POST -ne $LO_HVAL_PRE ]] &&
1382 error "Local health changed: $LO_HVAL_POST != $LO_HVAL_PRE"
1387 function check_local_health() {
1388 echo "Check that local NI health has been changed"
1389 [[ $LO_HVAL_POST -eq $LO_HVAL_PRE ]] &&
1390 error "Local health unchanged: $LO_HVAL_POST == $LO_HVAL_PRE"
1395 function check_no_remote_health() {
1396 echo "Check that remote NI health is unchanged"
1397 [[ $RMT_HVAL_POST -ne $RMT_HVAL_PRE ]] &&
1398 error "Remote health changed: $RMT_HVAL_POST != $RMT_HVAL_PRE"
1403 function check_remote_health() {
1404 echo "Check that remote NI health has been changed"
1405 [[ $RMT_HVAL_POST -eq $RMT_HVAL_PRE ]] &&
1406 error "Remote health unchanged: $RMT_HVAL_POST == $RMT_HVAL_PRE"
1416 setup_health_test() {
1420 local rnodes=$(remote_nodes_list)
1421 [[ -z $rnodes ]] && skip "Need at least 1 remote node"
1423 cleanup_lnet || error "Failed to cleanup before test execution"
1425 # Loading modules should configure LNet with the appropriate
1426 # test-framework configuration
1427 load_lnet "config_on_load=1" || error "Failed to load modules"
1429 LNIDS=( $($LCTL list_nids | xargs echo) )
1431 RNODE=$(awk '{print $1}' <<<$rnodes)
1432 RNIDS=( $(do_node $RNODE $LCTL list_nids | xargs echo) )
1434 if [[ -z ${RNIDS[@]} ]]; then
1435 do_rpc_nodes $RNODE load_lnet "config_on_load=1"
1437 RNIDS=( $(do_node $RNODE $LCTL list_nids | xargs echo) )
1440 [[ ${#LNIDS[@]} -lt 1 ]] &&
1441 error "No NIDs configured for local host $HOSTNAME"
1442 [[ ${#RNIDS[@]} -lt 1 ]] &&
1443 error "No NIDs configured for remote host $RNODE"
1445 do_lnetctl discover ${RNIDS[0]} ||
1446 error "Unable to discover ${RNIDS[0]}"
1448 local mr=$($LNETCTL peer show --nid ${RNIDS[0]} |
1449 awk '/Multi-Rail/{print $NF}')
1451 if ${need_mr} && [[ $mr == False ]]; then
1452 cleanup_health_test || return $?
1456 if ( ! ${need_mr} && [[ ${#RNIDS[@]} -gt 1 ]] ) ||
1457 ( ! ${need_mr} && [[ ${#LNIDS[@]} -gt 1 ]] ); then
1458 cleanup_health_test || return $?
1462 if ${need_mr} && [[ ${#RNIDS[@]} -lt 2 ]]; then
1463 # Add a second, reachable NID to rnode.
1464 local net=${RNIDS[0]}
1468 local if=$(do_rpc_nodes --quiet $RNODE lnet_if_list)
1470 error "Failed to determine interface for $RNODE"
1472 do_rpc_nodes $RNODE "$LNETCTL lnet configure"
1473 do_rpc_nodes $RNODE "$LNETCTL net add --net $net --if $if" ||
1475 if [[ $rc -ne 0 ]]; then
1476 error "Failed to add interface to $RNODE rc=$?"
1478 RNIDS[1]="${RNIDS[0]}1"
1479 NET_DEL_ARGS="--net $net --if $if"
1483 if ${need_mr} && [[ ${#LNIDS[@]} -lt 2 ]]; then
1484 local net=${LNIDS[0]}
1487 do_lnetctl lnet configure &&
1488 do_lnetctl net add --net $net --if ${INTERFACES[0]} ||
1490 if [[ $rc -ne 0 ]]; then
1491 error "Failed to add interface rc=$?"
1493 LNIDS[1]="${LNIDS[0]}1"
1499 $LNETCTL peer show -v 2 | egrep -e nid -e health
1501 $LCTL set_param debug=+net
1507 cleanup_health_test() {
1510 if [[ -n $NET_DEL_ARGS ]]; then
1511 do_rpc_nodes $RNODE \
1512 "$LNETCTL net del $NET_DEL_ARGS" ||
1517 unload_modules || rc=$?
1520 do_rpc_nodes $RNODE unload_modules_local ||
1526 error "Failed cleanup"
1531 add_health_test_drop_rules() {
1535 for lnid in "${LNIDS[@]}"; do
1536 for rnid in "${RNIDS[@]}"; do
1537 $LCTL net_drop_add -s $lnid -d $rnid -m GET -r 1 -e ${hstatus}
1542 # See lnet/lnet/lib-msg.c:lnet_health_check()
1543 LNET_LOCAL_RESEND_STATUSES="local_interrupt local_dropped local_aborted"
1544 LNET_LOCAL_RESEND_STATUSES+=" local_no_route local_timeout"
1545 LNET_LOCAL_NO_RESEND_STATUSES="local_error"
1547 setup_health_test false || return $?
1550 for hstatus in ${LNET_LOCAL_RESEND_STATUSES} \
1551 ${LNET_LOCAL_NO_RESEND_STATUSES}; do
1552 echo "Simulate $hstatus"
1553 lnet_health_pre || return $?
1555 add_health_test_drop_rules ${hstatus}
1556 do_lnetctl discover ${RNIDS[0]} &&
1557 error "Should have failed"
1558 $LCTL net_drop_del -a
1562 check_no_resends || return $?
1563 check_no_local_health || return $?
1566 cleanup_health_test || return $?
1570 run_test 204 "Check no health or resends for single-rail local failures"
1573 setup_health_test true || return $?
1576 for hstatus in ${LNET_LOCAL_RESEND_STATUSES}; do
1577 echo "Simulate $hstatus"
1578 lnet_health_pre || return $?
1580 add_health_test_drop_rules ${hstatus}
1581 do_lnetctl discover ${RNIDS[0]} &&
1582 error "Should have failed"
1583 $LCTL net_drop_del -a
1587 check_resends || return $?
1588 check_local_health || return $?
1591 for hstatus in ${LNET_LOCAL_NO_RESEND_STATUSES}; do
1592 echo "Simulate $hstatus"
1593 lnet_health_pre || return $?
1595 add_health_test_drop_rules ${hstatus}
1596 do_lnetctl discover ${RNIDS[0]} &&
1597 error "Should have failed"
1598 $LCTL net_drop_del -a
1602 check_no_resends || return $?
1603 check_local_health || return $?
1606 cleanup_health_test || return $?
1610 run_test 205 "Check health and resends for multi-rail local failures"
1612 # See lnet/lnet/lib-msg.c:lnet_health_check()
1613 LNET_REMOTE_RESEND_STATUSES="remote_dropped"
1614 LNET_REMOTE_NO_RESEND_STATUSES="remote_error remote_timeout"
1616 setup_health_test false || return $?
1619 for hstatus in ${LNET_REMOTE_RESEND_STATUSES} \
1620 ${LNET_REMOTE_NO_RESEND_STATUSES}; do
1621 echo "Simulate $hstatus"
1622 lnet_health_pre || return $?
1624 add_health_test_drop_rules ${hstatus}
1625 do_lnetctl discover ${RNIDS[0]} &&
1626 error "Should have failed"
1627 $LCTL net_drop_del -a
1631 check_no_resends || return $?
1632 check_no_local_health || return $?
1633 check_no_remote_health || return $?
1636 cleanup_health_test || return $?
1640 run_test 206 "Check no health or resends for single-rail remote failures"
1643 setup_health_test true || return $?
1646 for hstatus in ${LNET_REMOTE_RESEND_STATUSES}; do
1647 echo "Simulate $hstatus"
1648 lnet_health_pre || return $?
1650 add_health_test_drop_rules ${hstatus}
1652 do_lnetctl discover ${RNIDS[0]} &&
1653 error "Should have failed"
1657 $LCTL net_drop_del -a
1659 check_resends || return $?
1660 check_no_local_health || return $?
1661 check_remote_health || return $?
1662 do_lnetctl peer set --health 1000 --all ||
1663 error "Unable to reset health rc=$?"
1665 for hstatus in ${LNET_REMOTE_NO_RESEND_STATUSES}; do
1666 echo "Simulate $hstatus"
1667 lnet_health_pre || return $?
1669 add_health_test_drop_rules ${hstatus}
1671 do_lnetctl discover ${RNIDS[0]} &&
1672 error "Should have failed"
1676 $LCTL net_drop_del -a
1678 check_no_resends || return $?
1679 check_no_local_health || return $?
1680 check_remote_health || return $?
1681 do_lnetctl peer set --health 1000 --all ||
1682 error "Unable to reset health rc=$?"
1685 cleanup_health_test || return $?
1689 run_test 207 "Check health and resends for multi-rail remote errors"
1691 test_208_load_and_check_lnet() {
1695 local num_expected=1
1697 load_lnet "networks=\"\" ip2nets=\"${ip2nets_str}\""
1700 error "Failed to load LNet with ip2nets \"${ip2nets_str}\""
1706 nids=( $($LCTL list_nids) )
1708 [[ ${#nids[@]} -ne ${num_expected} ]] &&
1709 error "Expect ${num_expected} NIDs found ${#nids[@]}"
1711 [[ ${nids[0]} == ${p_nid} ]] ||
1712 error "Expect NID \"${p_nid}\" found \"${nids[0]}\""
1714 [[ -n $s_nid ]] && [[ ${nids[1]} != ${s_nid} ]] &&
1715 error "Expect second NID \"${s_nid}\" found \"${nids[1]}\""
1717 $LCTL net down &>/dev/null
1722 cleanup_netns || error "Failed to cleanup netns before test execution"
1723 cleanup_lnet || error "Failed to unload modules before test execution"
1724 setup_fakeif || error "Failed to add fake IF"
1726 have_interface "$FAKE_IF" ||
1727 error "Expect $FAKE_IF configured but not found"
1729 local if0_ip=$(ip --oneline addr show dev ${INTERFACES[0]} |
1730 awk '/inet /{print $4}' |
1732 if0_ip=($(echo "${if0_ip[@]}" | tr ' ' '\n' | uniq | tr '\n' ' '))
1733 local ip2nets_str="tcp(${INTERFACES[0]}) $if0_ip"
1735 echo "Configure single NID \"$ip2nets_str\""
1736 test_208_load_and_check_lnet "${ip2nets_str}" "${if0_ip}@tcp"
1738 ip2nets_str="tcp(${INTERFACES[0]}) $if0_ip; tcp1($FAKE_IF) $FAKE_IP"
1739 echo "Configure two NIDs; two NETs \"$ip2nets_str\""
1740 test_208_load_and_check_lnet "${ip2nets_str}" "${if0_ip}@tcp" \
1743 ip2nets_str="tcp(${INTERFACES[0]}) $if0_ip; tcp($FAKE_IF) $FAKE_IP"
1744 echo "Configure two NIDs; one NET \"$ip2nets_str\""
1745 test_208_load_and_check_lnet "${ip2nets_str}" "${if0_ip}@tcp" \
1747 local addr1=( ${if0_ip//./ } )
1748 local addr2=( ${FAKE_IP//./ } )
1749 local range="[${addr1[0]},${addr2[0]}]"
1752 for i in $(seq 1 3); do
1753 range+=".[${addr1[$i]},${addr2[$i]}]"
1755 ip2nets_str="tcp(${INTERFACES[0]},${FAKE_IF}) ${range}"
1757 echo "Configured two NIDs; one NET alt syntax \"$ip2nets_str\""
1758 test_208_load_and_check_lnet "${ip2nets_str}" "${if0_ip}@tcp" \
1763 echo "alt syntax with missing IF \"$ip2nets_str\""
1764 load_lnet "networks=\"\" ip2nets=\"${ip2nets_str}\""
1766 echo "$LCTL net up should fail"
1768 error "LNet bringup should have failed"
1772 run_test 208 "Test various kernel ip2nets configurations"
1775 setup_health_test false || return $?
1777 echo "Simulate network_timeout w/SR config"
1780 add_health_test_drop_rules network_timeout
1782 do_lnetctl discover ${RNIDS[0]} &&
1783 error "Should have failed"
1784 $LCTL net_drop_del -a
1788 check_no_resends || return $?
1789 check_no_local_health || return $?
1790 check_no_remote_health || return $?
1792 cleanup_health_test || return $?
1794 setup_health_test true || return $?
1796 echo "Simulate network_timeout w/MR config"
1800 add_health_test_drop_rules network_timeout
1802 do_lnetctl discover ${RNIDS[0]} &&
1803 error "Should have failed"
1804 $LCTL net_drop_del -a
1808 check_no_resends || return $?
1809 check_local_health || return $?
1810 check_remote_health || return $?
1812 cleanup_health_test || return $?
1816 run_test 209 "Check health, but not resends, for network timeout"
1818 check_nid_in_recovq() {
1819 local recovq=$($LNETCTL debug recovery $1)
1821 local nids=$($LCTL list_nids | xargs echo)
1825 echo "Check \"$1\" recovery queue"
1827 if [[ $(grep -c 'nid-'<<<$recovq) -ne $expect ]]; then
1828 error "Expect $expect NIDs found: \"$recovq\""
1831 [[ $expect -eq 0 ]] && return 0
1833 for nid in ${nids}; do
1834 grep -q "nid-0: $nid"<<<$recovq &&
1839 error "Didn't find local NIDs in recovery queue: \"$recovq\""
1845 # First enqueue happens at time 0.
1846 # 2nd at 0 + 2^0 = 1
1847 # 3rd at 1 + 2^1 = 3
1848 # 4th at 3 + 2^2 = 7
1849 # 5th at 7 + 2^3 = 15
1850 # e.g. after 10 seconds we would expect to have seen the 4th enqueue,
1851 # (3 pings sent, 4th about to happen) and the 5th enqueue is yet to
1853 # If the recovery limit is 10 seconds, then when the 5th enqueue happens
1854 # we expect the peer NI to have aged out, so it will not actually be
1856 check_ping_count() {
1860 echo "Check ping counts:"
1862 if [[ $queue == "ni" ]]; then
1863 $LNETCTL net show -v 2 | egrep 'nid|health value|ping'
1864 ping_count=( $($LNETCTL net show -v 2 |
1865 awk '/ping_count/{print $NF}') )
1866 elif [[ $queue == "peer_ni" ]]; then
1867 $LNETCTL peer show -v 2 | egrep 'nid|health value|ping'
1868 ping_count=( $($LNETCTL peer show -v 2 |
1869 awk '/ping_count/{print $NF}') )
1871 error "Unrecognized queue \"$queue\""
1877 for count in "${ping_count[@]}"; do
1878 if [[ $count -eq $expect ]]; then
1879 if [[ $expect -ne 0 ]] && $found ; then
1880 error "Found more than one interface matching \"$expect\" ping count"
1883 echo "Expect ping count \"$expect\" found \"$count\""
1886 elif [[ $count -ne 0 ]]; then
1887 error "Found interface with ping count \"$count\" but expect \"$expect\""
1896 reinit_dlc || return $?
1897 add_net "tcp" "${INTERFACES[0]}" || return $?
1898 add_net "tcp1" "${INTERFACES[0]}" || return $?
1900 local prim_nid=$($LCTL list_nids | head -n 1)
1902 do_lnetctl discover $prim_nid ||
1903 error "failed to discover myself"
1905 # Set recovery limit to 10 seconds.
1906 do_lnetctl set recovery_limit 10 ||
1907 error "failed to set recovery_limit"
1909 $LCTL set_param debug=+net
1910 # Use local_error so LNet doesn't attempt to resend the discovery ping
1911 $LCTL net_drop_add -s *@tcp -d *@tcp -m GET -r 1 -e local_error
1912 $LCTL net_drop_add -s *@tcp1 -d *@tcp1 -m GET -r 1 -e local_error
1913 do_lnetctl discover $($LCTL list_nids | head -n 1) &&
1914 error "Expected discovery to fail"
1917 check_nid_in_recovq "-l" 1
1918 check_ping_count "ni" "2"
1922 check_nid_in_recovq "-l" 1
1923 check_ping_count "ni" "3"
1925 $LCTL net_drop_del -a
1929 run_test 210 "Local NI recovery checks"
1932 reinit_dlc || return $?
1933 add_net "tcp" "${INTERFACES[0]}" || return $?
1934 add_net "tcp1" "${INTERFACES[0]}" || return $?
1936 local prim_nid=$($LCTL list_nids | head -n 1)
1938 do_lnetctl discover $prim_nid ||
1939 error "failed to discover myself"
1941 # Set recovery limit to 10 seconds.
1942 do_lnetctl set recovery_limit 10 ||
1943 error "failed to set recovery_limit"
1945 $LCTL net_drop_add -s *@tcp -d *@tcp -m GET -r 1 -e remote_error
1946 $LCTL net_drop_add -s *@tcp1 -d *@tcp1 -m GET -r 1 -e remote_error
1948 # Set health to 0 on one interface. This forces it onto the recovery
1950 $LNETCTL peer set --nid $prim_nid --health 0
1952 # After 5 seconds, we expect the peer NI to still be in recovery
1954 check_nid_in_recovq "-p" 1
1955 check_ping_count "peer_ni" "2"
1957 # After 15 seconds, the peer NI should have been fully processed out of
1958 # the recovery queue. We'll allow a total of 17 seconds to account for
1959 # differences in sleeping for whole seconds vs. the more accurate time
1960 # keeping that is done in the recovery code.
1962 check_nid_in_recovq "-p" 0
1963 check_ping_count "peer_ni" "4"
1965 $LCTL net_drop_del -a
1967 # Set health to force it back onto the recovery queue. Set to 500 means
1968 # in 5 seconds it should be back at maximum value. We'll wait a couple
1969 # more seconds than that to be safe.
1970 # NB: we reset the recovery limit to 0 (indefinite) so the peer NI is
1972 do_lnetctl set recovery_limit 0 ||
1973 error "failed to set recovery_limit"
1975 $LNETCTL peer set --nid $prim_nid --health 500
1977 check_nid_in_recovq "-p" 1
1978 check_ping_count "peer_ni" "2"
1982 check_nid_in_recovq "-p" 0
1983 check_ping_count "peer_ni" "0"
1987 run_test 211 "Remote NI recovery checks"
1990 local rnodes=$(remote_nodes_list)
1991 [[ -z $rnodes ]] && skip "Need at least 1 remote node"
1993 cleanup_lnet || error "Failed to cleanup before test execution"
1995 # Loading modules should configure LNet with the appropriate
1996 # test-framework configuration
1997 load_lnet "config_on_load=1" || error "Failed to load modules"
1999 local my_nid=$($LCTL list_nids | head -n 1)
2001 error "Failed to get primary NID for local host $HOSTNAME"
2003 local rnode=$(awk '{print $1}' <<<$rnodes)
2004 local rnodenids=$(do_node $rnode $LCTL list_nids | xargs echo)
2007 if [[ -z $rnodenids ]]; then
2008 do_rpc_nodes $rnode load_lnet "config_on_load=1"
2010 rnodenids=$(do_node $rnode $LCTL list_nids | xargs echo)
2013 local rnodepnid=$(awk '{print $1}' <<< $rnodenids)
2015 [[ -z $rnodepnid ]] &&
2016 error "Failed to get primary NID for remote host $rnode"
2018 log "Initial discovery"
2019 do_lnetctl discover --force $rnodepnid ||
2020 error "Failed to discover $rnodepnid"
2022 do_node $rnode "$LNETCTL discover --force $my_nid" ||
2023 error "$rnode failed to discover $my_nid"
2025 log "Fail local discover ping to set LNET_PEER_REDISCOVER flag"
2026 $LCTL net_drop_add -s "*@$NETTYPE" -d "*@$NETTYPE" -r 1 -e local_error
2027 do_lnetctl discover --force $rnodepnid &&
2028 error "Discovery should have failed"
2029 $LCTL net_drop_del -a
2032 for nid in $rnodenids; do
2033 # We need GET (PING) delay just long enough so we can trigger
2034 # discovery on the remote peer
2035 $LCTL net_delay_add -s "*@$NETTYPE" -d $nid -r 1 -m GET -l 3
2036 $LCTL net_drop_add -s "*@$NETTYPE" -d $nid -r 1 -m GET -e local_error
2037 # We need PUT (PUSH) delay just long enough so we can process
2039 $LCTL net_delay_add -s "*@$NETTYPE" -d $nid -r 1 -m PUT -l 6
2042 log "Force $HOSTNAME to discover $rnodepnid (in background)"
2043 # We want to get a PING sent that we know will eventually fail.
2044 # The delay rules we added will ensure the ping is not sent until
2045 # the PUSH is also in flight (see below), and the drop rule ensures that
2046 # when the PING is eventually sent it will error out
2047 do_lnetctl discover --force $rnodepnid &
2050 # We want a discovery PUSH from rnode to put rnode back on our
2051 # discovery queue. This should cause us to try and send a PUSH to rnode
2052 # while the PING is still outstanding.
2053 log "Force $rnode to discover $my_nid"
2054 do_node $rnode $LNETCTL discover --force $my_nid
2056 # At this point we'll have both PING_SENT and PUSH_SENT set for the
2057 # rnode peer. Wait for the PING to error out which should terminate the
2058 # discovery process that we backgrounded.
2059 log "Wait for $pid1"
2061 log "Finished wait on $pid1"
2063 # The PING send failure clears the PING_SENT flag and puts the peer back
2064 # on the discovery queue. When discovery thread processes the peer it
2065 # will mistakenly clear the PUSH_SENT flag (and set PUSH_FAILED).
2066 # Discovery will then complete for this peer even though we have an
2068 # When PUSH is actually unlinked it will be forced back onto the
2069 # discovery queue, but we no longer have a ref on the peer. When
2070 # discovery completes again, we'll trip the ASSERT in
2071 # lnet_destroy_peer_locked()
2073 # Delete the delay rules to send the PUSH
2074 $LCTL net_delay_del -a
2075 # Delete the drop rules
2076 $LCTL net_drop_del -a
2079 error "Failed to unload modules"
2081 do_rpc_nodes $rnode unload_modules_local ||
2082 error "Failed to unload modules on $rnode"
2087 run_test 212 "Check discovery refcount loss bug (LU-14627)"
2090 cleanup_netns || error "Failed to cleanup netns before test execution"
2091 cleanup_lnet || error "Failed to unload modules before test execution"
2093 setup_fakeif || error "Failed to add fake IF"
2094 have_interface "$FAKE_IF" ||
2095 error "Expect $FAKE_IF configured but not found"
2097 reinit_dlc || return $?
2099 add_net "tcp" "${INTERFACES[0]}" || return $?
2100 add_net "tcp" "$FAKE_IF" || return $?
2102 local nid1=$(lctl list_nids | head -n 1)
2103 local nid2=$(lctl list_nids | tail --lines 1)
2105 [[ $(lctl which_nid $nid1 $nid2) == $nid1 ]] ||
2106 error "Expect nid1 \"$nid1\" to be preferred"
2108 [[ $(lctl which_nid $nid2 $nid1) == $nid2 ]] ||
2109 error "Expect nid2 \"$nid2\" to be preferred"
2113 run_test 213 "Check LNetDist calculation for multiple local NIDs"
2115 function check_ni_status() {
2119 local status=$($LNETCTL net show |
2121 awk '/status/{print $NF}')
2123 echo "NI ${nid} expect status \"${expect}\" found \"${status}\""
2124 if [[ $status != $expect ]]; then
2125 error "Error: Expect NI status \"$expect\" for NID \"$nid\" but found \"$status\""
2132 cleanup_netns || error "Failed to cleanup netns before test execution"
2133 cleanup_lnet || error "Failed to unload modules before test execution"
2135 setup_fakeif || error "Failed to add fake IF"
2136 have_interface "$FAKE_IF" ||
2137 error "Expect $FAKE_IF configured but not found"
2139 reinit_dlc || return $?
2141 add_net "tcp" "${INTERFACES[0]}" || return $?
2142 add_net "tcp" "$FAKE_IF" || return $?
2144 local nid1=$(lctl list_nids | head -n 1)
2145 local nid2=$(lctl list_nids | tail --lines 1)
2147 check_ni_status "0@lo" up
2148 check_ni_status "$nid1" up
2149 check_ni_status "$nid2" up
2151 echo "Set $FAKE_IF down"
2152 echo "ip link set dev $FAKE_IF down"
2153 ip link set dev $FAKE_IF down
2154 check_ni_status "0@lo" up
2155 check_ni_status "$nid1" up
2156 check_ni_status "$nid2" down
2158 run_test 214 "Check local NI status when link is downed"
2164 $LNETCTL net show -v 2 |
2165 egrep -e nid -e $stat |
2167 awk '/'$stat':/{print $NF}'
2172 for nidvar in nid1 nid2; do
2173 for stat in send_count recv_count; do
2174 s=$(get_ni_stat ${!nidvar} $stat)
2175 eval ${nidvar}_pre_${stat}=$s
2182 for nidvar in nid1 nid2; do
2183 for stat in send_count recv_count; do
2184 s=$(get_ni_stat ${!nidvar} $stat)
2185 eval ${nidvar}_post_${stat}=$s
2195 eval pre=\${${nidvar}_pre_${stat}}
2196 eval post=\${${nidvar}_post_${stat}}
2198 echo "${!nidvar} pre ${stat} $pre post ${stat} $post"
2200 [[ $pre -ne $post ]]
2204 cleanup_netns || error "Failed to cleanup netns before test execution"
2205 cleanup_lnet || error "Failed to unload modules before test execution"
2207 reinit_dlc || return $?
2209 add_net "tcp1" "${INTERFACES[0]}" || return $?
2210 add_net "tcp2" "${INTERFACES[0]}" || return $?
2212 local nid1=$($LCTL list_nids | head -n 1)
2213 local nid2=$($LCTL list_nids | tail --lines 1)
2215 do_lnetctl peer add --prim $nid1 --nid $nid2 ||
2216 error "Failed to add peer"
2220 for nidvarA in nid1 nid2; do
2223 for nidvarB in nid1 nid2; do
2224 [[ $nidvarA == $nidvarB ]] && continue
2228 echo "$LNETCTL ping $dst x $npings"
2229 for i in $(seq 1 $npings); do
2230 $LNETCTL ping $dst &>/dev/null ||
2231 error "$LNETCTL ping $dst failed"
2236 # No source specified, sends to either NID should cause
2237 # counts to increase across both NIs
2238 for nidvar in nid1 nid2; do
2239 for stat in send_count recv_count; do
2240 ni_stat_changed $nidvar $stat ||
2241 error "$stat unchanged for ${!nidvar}"
2247 echo "$LNETCTL ping --source $src $dst x $npings"
2248 for i in $(seq 1 $npings); do
2249 $LNETCTL ping --source $src $dst &>/dev/null ||
2250 error "$LNETCTL ping --source $src $dst failed"
2255 # src nid == dest nid means stats for the _other_ NI
2256 # should be unchanged
2257 for nidvar in nid1 nid2; do
2258 for stat in send_count recv_count; do
2259 if [[ ${!nidvar} == $src ]]; then
2260 ni_stat_changed $nidvar $stat ||
2261 error "$stat unchanged for ${!nidvar}"
2263 ni_stat_changed $nidvar $stat &&
2264 error "$stat changed for ${!nidvar}"
2269 # Double number of pings for next iteration because the net
2270 # sequence numbers will have diverged
2271 npings=$(($npings * 2))
2274 # Ping from nid1 to nid2 should fail
2275 do_lnetctl ping --source $nid1 $nid2 &&
2276 error "ping from $nid1 to $nid2 should fail"
2278 # Ping from nid2 to nid1 should fail
2279 do_lnetctl ping --source $nid2 $nid1 &&
2280 error "ping from $nid2 to $nid1 should fail"
2284 run_test 215 "Test lnetctl ping --source option"
2289 reinit_dlc || return $?
2291 add_net "tcp" "${INTERFACES[0]}" || return $?
2292 add_net "tcp1" "${INTERFACES[0]}" || return $?
2294 local nids=( $($LCTL list_nids | xargs echo) )
2296 do_lnetctl discover ${nids[0]} ||
2297 error "Initial discovery failed"
2299 do_lnetctl ping --source ${nids[0]} ${nids[0]} ||
2300 error "Initial ping failed $?"
2302 do_lnetctl ping --source ${nids[1]} ${nids[1]} ||
2303 error "Initial ping failed $?"
2306 for src in "${nids[@]}"; do
2307 for dst in "${nids[@]}"; do
2308 $LCTL net_drop_add -r 1 -s $src -d $dst -e network_timeout
2312 do_lnetctl ping ${nids[0]} || rc=$?
2314 $LCTL net_drop_del -a
2317 error "expected ping to fail"
2319 check_nid_in_recovq "-p" 0
2320 check_nid_in_recovq "-l" 1
2324 run_test 216 "Failed send to peer NI owned by local host should not trigger peer NI recovery"
2327 reinit_dlc || return $?
2329 [[ $($LNETCTL net show | grep -c nid) -ne 1 ]] &&
2330 error "Unexpected number of NIs after initalizing DLC"
2332 do_lnetctl discover 0@lo ||
2333 error "Failed to discover 0@lo"
2337 run_test 217 "Don't leak memory when discovering peer with nnis <= 1"
2340 reinit_dlc || return $?
2342 [[ ${#INTERFACES[@]} -lt 2 ]] &&
2343 skip "Need two LNet interfaces"
2345 add_net "tcp" "${INTERFACES[0]}" || return $?
2347 local nid1=$($LCTL list_nids | head -n 1)
2349 do_lnetctl ping $nid1 ||
2352 add_net "tcp" "${INTERFACES[1]}" || return $?
2354 local nid2=$($LCTL list_nids | tail --lines 1)
2356 do_lnetctl ping $nid2 ||
2359 $LCTL net_drop_add -s $nid1 -d $nid1 -e local_error -r 1
2361 do_lnetctl ping $nid1 &&
2362 error "ping should have failed"
2364 local health_recovered
2367 for i in $(seq 1 5); do
2368 health_recovered=$($LNETCTL net show -v 2 |
2369 grep -c 'health value: 1000')
2371 if [[ $health_recovered -ne 2 ]]; then
2372 echo "Wait 1 second for health to recover"
2379 health_recovered=$($LNETCTL net show -v 2 |
2380 grep -c 'health value: 1000')
2382 $LCTL net_drop_del -a
2384 [[ $health_recovered -ne 2 ]] &&
2385 do_lnetctl net show -v 2 | egrep -e nid -e health &&
2386 error "Health hasn't recovered"
2390 run_test 218 "Local recovery pings should exercise all available paths"
2393 reinit_dlc || return $?
2394 add_net "tcp" "${INTERFACES[0]}" || return $?
2395 add_net "tcp1" "${INTERFACES[0]}" || return $?
2397 local nid1=$(lctl list_nids | head -n 1)
2398 local nid2=$(lctl list_nids | tail --lines 1)
2400 do_lnetctl ping $nid1 ||
2401 error "Ping failed $?"
2402 do_lnetctl ping $nid2 ||
2403 error "Ping failed $?"
2405 do_lnetctl discover $nid2 ||
2406 error "Discovery failed"
2408 $LNETCTL peer show --nid $nid1 | grep -q $nid2 ||
2409 error "$nid2 is not listed under $nid1"
2411 run_test 219 "Consolidate peer entries"
2415 echo "Check valid values; Should succeed"
2419 for ((i = 4; i < 16; i+=1)); do
2420 reinit_dlc || return $?
2421 add_net "tcp" "${INTERFACES[0]}" || return $?
2422 do_lnetctl net set --all --conns-per-peer $i ||
2423 error "should have succeeded $?"
2424 $LNETCTL net show -v 1 | grep -q "conns_per_peer: $i" ||
2425 error "failed to set conns-per-peer to $i"
2426 lnid="$(lctl list_nids | head -n 1)"
2427 do_lnetctl ping "$lnid" ||
2428 error "failed to ping myself"
2430 # "lctl --net tcp conn_list" prints the list of active
2431 # connections. Since we're pinging ourselves, there should be
2432 # 2 Control connections plus 2*conns_per_peer connections
2433 # created (one Bulk Input, one Bulk Output in each pair).
2434 # Here's the sample output for conns_per_peer set to 1:
2435 # 12345-1.1.1.1@tcp I[0]host01->host01:988 2626560/1061296 nonagle
2436 # 12345-1.1.1.1@tcp O[0]host01->host01:1022 2626560/1061488 nonagle
2437 # 12345-1.1.1.1@tcp C[0]host01->host01:988 2626560/1061296 nonagle
2438 # 12345-1.1.1.1@tcp C[0]host01->host01:1023 2626560/1061488 nonagle
2439 cmd="printf 'network tcp\nconn_list\n' | lctl | grep -c '$lnid'"
2441 # Expect 2+conns_per_peer*2 connections. Wait no longer
2443 wait_update $HOSTNAME "$cmd" "$((2+i*2))" 2 ||
2444 error "expected number of tcp connections $((2+i*2))"
2447 reinit_dlc || return $?
2448 add_net "tcp" "${INTERFACES[0]}" || return $?
2449 echo "Set > 127; Should fail"
2450 do_lnetctl net set --all --conns-per-peer 128 &&
2451 error "should have failed $?"
2453 reinit_dlc || return $?
2454 add_net "tcp" "${INTERFACES[0]}" || return $?
2455 echo "Set < 0; Should be ignored"
2456 do_lnetctl net set --all --conns-per-peer -1 ||
2457 error "should have succeeded $?"
2458 $LNETCTL net show -v 1 | grep -q "conns_per_peer: 1" ||
2459 error "Did not stay at default"
2461 run_test 230 "Test setting conns-per-peer"
2463 ### Test that linux route is added for each ni
2465 reinit_dlc || return $?
2466 add_net "tcp" "${INTERFACES[0]}" || return $?
2467 ip route show table ${INTERFACES[0]} | grep -q "${INTERFACES[0]}"
2469 run_test 250 "test that linux routes are added"
2474 local out=$TMP/$tfile
2475 local prefix=/usr/include/linux/lnet
2477 # We use a hard coded prefix so that this test will not fail
2480 if ! which $CC > /dev/null 2>&1; then
2481 skip_env "$CC is not installed"
2484 cleanup_lnet || exit 1
2487 local cc_args="-Wall -Werror -std=c99 -c -x c /dev/null -o $out"
2488 if ! [[ -d $prefix ]]; then
2489 # Assume we're running in tree and fixup the include path.
2490 prefix=$LUSTRE/../lnet/include/uapi/linux/lnet
2491 cc_args+=" -I $LUSTRE/../lnet/include/uapi"
2494 for header in $prefix/*.h; do
2495 if ! [[ -f "$header" ]]; then
2499 echo "$CC $cc_args -include $header"
2500 $CC $cc_args -include $header ||
2501 error "cannot compile '$header'"
2505 run_test 300 "packaged LNet UAPI headers can be compiled"