+test_19() {
+ reinit_dlc || return $?
+ cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
+peer:
+ - primary nid: 19@gni
+ Multi-Rail: True
+ peer ni:
+ - nid: 19@gni
+EOF
+ append_global_yaml
+ compare_peer_add "19@gni"
+}
+run_test 19 "Add peer with single nid (gni)"
+
+test_20() {
+ reinit_dlc || return $?
+ cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
+peer:
+ - primary nid: 20@gni
+ Multi-Rail: True
+ peer ni:
+ - nid: 20@gni
+ - nid: 20.20.20.20@tcp
+ - nid: 20.20.20.20@o2ib
+EOF
+ append_global_yaml
+ compare_peer_add "20@gni" "20.20.20.20@tcp,20.20.20.20@o2ib"
+}
+run_test 20 "Add peer with gni primary and tcp, o2ib secondary"
+
+test_21() {
+ reinit_dlc || return $?
+ cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
+peer:
+ - primary nid: 21@gni
+ Multi-Rail: True
+ peer ni:
+ - nid: 21@gni
+ - nid: 22@gni
+ - nid: 23@gni
+ - nid: 24@gni
+ - nid: 25@gni
+EOF
+ append_global_yaml
+ echo"Add peer with nidrange (gni)"
+ compare_peer_add "21@gni" "[22-25]@gni" || error
+ echo "Add peer with nidrange that overlaps primary nid (gni)"
+ compare_peer_add "21@gni" "[21-25]@gni"
+}
+run_test 21 "Add peer with nidrange (gni)"
+
+test_22() {
+ reinit_dlc || return $?
+ cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
+peer:
+ - primary nid: 22@gni
+ Multi-Rail: True
+ peer ni:
+ - nid: 22@gni
+ - nid: 24@gni
+ - nid: 25@gni
+ - nid: 27@gni
+ - nid: 28@gni
+ - nid: 29@gni
+EOF
+ append_global_yaml
+ do_lnetctl peer add --prim_nid 22@gni --nid [24-29]@gni ||
+ error "Peer add failed $?"
+ compare_peer_del "22@gni" "26@gni"
+}
+run_test 22 "Delete single secondary nid from peer (gni)"
+
+test_23() {
+ reinit_dlc || return $?
+ cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
+peer:
+ - primary nid: 23@gni
+ Multi-Rail: True
+ peer ni:
+ - nid: 23@gni
+EOF
+ append_global_yaml
+
+ do_lnetctl peer add --prim_nid 23@gni --nid [25-29]@gni ||
+ error "Peer add failed $?"
+ compare_peer_del "23@gni" "[25-29]@gni"
+}
+run_test 23 "Delete all secondary nids from peer (gni)"
+
+test_24() {
+ reinit_dlc || return $?
+ cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
+peer:
+ - primary nid: 24@gni
+ Multi-Rail: True
+ peer ni:
+ - nid: 24@gni
+ - nid: 11@gni
+ - nid: 13.13.13.13@o2ib
+ - nid: 14.13.13.13@o2ib
+ - nid: 14.15.13.13@o2ib
+ - nid: 15.17.1.5@tcp
+ - nid: 15.17.1.10@tcp
+ - nid: 15.17.1.20@tcp
+EOF
+ append_global_yaml
+ do_lnetctl peer add --prim_nid 24@gni \
+ --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 ||
+ error "Peer add failed $?"
+ compare_peer_del "24@gni" "5@gni,13.15.13.13@o2ib,15.17.1.15@tcp"
+}
+run_test 24 "Delete a secondary nid from peer (tcp, o2ib and gni)"
+
+test_25() {
+ reinit_dlc || return $?
+ cat <<EOF > $TMP/sanity-lnet-$testnum-expected.yaml
+peer:
+ - primary nid: 25@gni
+ Multi-Rail: True
+ peer ni:
+ - nid: 25@gni
+EOF
+ append_global_yaml
+ do_lnetctl peer add --prim_nid 25@gni \
+ --nid [26-27].[4-10/3].26.26@tcp,26.26.26.26@o2ib,[30-35]@gni ||
+ error "Peer add failed $?"
+ compare_peer_del "25@gni" \
+ "[26-27].[4-10/3].26.26@tcp,26.26.26.26@o2ib,[30-35]@gni"
+}
+run_test 25 "Delete all secondary nids from peer (tcp, gni and o2ib)"
+