diff mbox series

[iproute2,2/2] testsuite: Add test for ip --json neigh get

Message ID 9b167a5bf910676cdae24edeb47aa77c2f312476.1669930736.git.cdleonard@gmail.com (mailing list archive)
State Accepted
Commit acea9032e92eabacb520201e9f14f6965faadd3b
Delegated to: David Ahern
Headers show
Series [iproute2,1/2] ip neigh: Support --json on ip neigh get | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Leonard Crestez Dec. 1, 2022, 9:41 p.m. UTC
Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
---
 testsuite/tests/ip/neigh/basic.t | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100755 testsuite/tests/ip/neigh/basic.t
diff mbox series

Patch

diff --git a/testsuite/tests/ip/neigh/basic.t b/testsuite/tests/ip/neigh/basic.t
new file mode 100755
index 000000000000..9c13c8ef4b25
--- /dev/null
+++ b/testsuite/tests/ip/neigh/basic.t
@@ -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"'