]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
testsuite: Add test for ip --json neigh get
authorLeonard Crestez <cdleonard@gmail.com>
Thu, 1 Dec 2022 21:41:06 +0000 (23:41 +0200)
committerDavid Ahern <dsahern@kernel.org>
Fri, 2 Dec 2022 15:55:24 +0000 (08:55 -0700)
Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
Signed-off-by: David Ahern <dsahern@kernel.org>
testsuite/tests/ip/neigh/basic.t [new file with mode: 0755]

diff --git a/testsuite/tests/ip/neigh/basic.t b/testsuite/tests/ip/neigh/basic.t
new file mode 100755 (executable)
index 0000000..9c13c8e
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+. lib/generic.sh
+
+ts_log "[Testing add/get neigh]"
+
+NEW_DEV="$(rand_dev)"
+ts_ip "$0" "Add $NEW_DEV dummy interface" link add dev $NEW_DEV type dummy
+ts_ip "$0" "Add $NEW_DEV neighbor 192.0.2.2 " neigh add 192.0.2.2 lladdr 02:00:00:00:00:01 dev $NEW_DEV
+ts_ip "$0" "List neighbors " neigh list
+test_on '02:00:00:00:00:01'
+ts_ip "$0" "Get $NEW_DEV neighbor 192.0.2.2 " --json neigh get 192.0.2.2 dev $NEW_DEV
+test_on '"lladdr":"02:00:00:00:00:01"'