summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>2017-07-25 19:20:32 -0600
committerLorenzo Colitti <lorenzo@google.com>2017-08-08 08:59:50 +0900
commit4150d6c1e51c10c9a7ea1fe40efa2e56ea7d0485 (patch)
tree3ca9773d9e59b194e14cd795dc0b007b09708f9b
parent74be71b57ab385ff0fb049da48efc169b66d1020 (diff)
downloadnetd-4150d6c1e51c10c9a7ea1fe40efa2e56ea7d0485.tar.gz
netutils_wrapper: Add support for NDK type in ndc commandsoreo-dr1-dev
This fixes the following error - ~:/system/bin/ndc-wrapper-1.0 network interface add handle8606370526 r_rmnet_data0 NetUtilsWrapper: Unexpected command: /system/bin/ndc network interface add handle8606370526 r_rmnet_data0 Bug: 36682246 Test: netutils_wrapper_test passes Change-Id: I0b0bb76ed47cdead672dd97ed0c040330ec0b8de
-rw-r--r--netutils_wrappers/NetUtilsWrapper-1.0.cpp6
-rw-r--r--netutils_wrappers/NetUtilsWrapperTest-1.0.cpp4
2 files changed, 7 insertions, 3 deletions
diff --git a/netutils_wrappers/NetUtilsWrapper-1.0.cpp b/netutils_wrappers/NetUtilsWrapper-1.0.cpp
index a9fbf3fb..ccf32add 100644
--- a/netutils_wrappers/NetUtilsWrapper-1.0.cpp
+++ b/netutils_wrappers/NetUtilsWrapper-1.0.cpp
@@ -52,9 +52,9 @@ const char *netcmds[] = {
const char *EXPECTED_REGEXPS[] = {
#define CMD "^" SYSTEM_DIRNAME
// Create, delete, and manage OEM networks.
- CMD "ndc network (create|destroy) oem[0-9]+( |$)",
- CMD "ndc network interface (add|remove) oem[0-9]+ " VENDOR_IFACE,
- CMD "ndc network route (add|remove) oem[0-9]+ ",
+ CMD "ndc network (create|destroy) (oem|handle)[0-9]+( |$)",
+ CMD "ndc network interface (add|remove) (oem|handle)[0-9]+ " VENDOR_IFACE,
+ CMD "ndc network route (add|remove) (oem|handle)[0-9]+ ",
CMD "ndc ipfwd (enable|disable) ",
CMD "ndc ipfwd (add|remove) .*" VENDOR_IFACE,
diff --git a/netutils_wrappers/NetUtilsWrapperTest-1.0.cpp b/netutils_wrappers/NetUtilsWrapperTest-1.0.cpp
index a32cc3b7..4f47c78b 100644
--- a/netutils_wrappers/NetUtilsWrapperTest-1.0.cpp
+++ b/netutils_wrappers/NetUtilsWrapperTest-1.0.cpp
@@ -47,6 +47,10 @@ std::vector<Command> COMMANDS = {
{VALID, "/system/bin/ndc network interface add oem10 oem9"},
{INVALID, "/system/bin/ndc network interface add 100 v_oem9"},
{VALID, "/system/bin/ndc network interface add oem10 r_rmnet_data0"},
+ {VALID, "/system/bin/ndc network interface add handle42966108894 v_oem9"},
+ {VALID, "/system/bin/ndc network interface add handle42966108894 oem9"},
+ {VALID, "/system/bin/ndc network interface add handle42966108894 r_rmnet_data0"},
+ {INVALID, "/system/bin/ndc network interface add handle42966108894"},
{VALID, "/system/bin/ip xfrm state"},
};