Add a test for NatController.
Bug: 9580643
Change-Id: I6ac3b754ec0b720674c6221e3a776314e86fe58c
diff --git a/server/NatController.cpp b/server/NatController.cpp
index 19d19c7..fba96ca 100644
--- a/server/NatController.cpp
+++ b/server/NatController.cpp
@@ -40,6 +40,8 @@
const char* NatController::LOCAL_NAT_POSTROUTING = "natctrl_nat_POSTROUTING";
const char* NatController::LOCAL_TETHER_COUNTERS_CHAIN = "natctrl_tether_counters";
+auto NatController::execFunction = android_fork_execvp;
+
NatController::NatController() {
}
@@ -55,7 +57,7 @@
int NatController::runCmd(int argc, const char **argv) {
int res;
- res = android_fork_execvp(argc, (char **)argv, NULL, false, false);
+ res = execFunction(argc, (char **)argv, NULL, false, false);
#if !LOG_NDEBUG
std::string full_cmd = argv[0];