Add a test for getTetherStats.
Bug: 9580643
Change-Id: I26f7adb9639f1ddf4eda0c98bcc6cd3a83d3ba0b
diff --git a/server/IptablesBaseTest.h b/server/IptablesBaseTest.h
index a8521b1..a354ef2 100644
--- a/server/IptablesBaseTest.h
+++ b/server/IptablesBaseTest.h
@@ -16,6 +16,8 @@
* IptablesBaseTest.h - utility class for tests that use iptables
*/
+#include <deque>
+
#include "NetdConstants.h"
class IptablesBaseTest : public ::testing::Test {
@@ -27,6 +29,7 @@
static int fake_android_fork_exec(int argc, char* argv[], int *status, bool, bool);
static int fakeExecIptables(IptablesTarget target, ...);
static int fakeExecIptablesRestore(IptablesTarget target, const std::string& commands);
+ static FILE *fake_popen(const char *cmd, const char *type);
void expectIptablesCommands(const std::vector<std::string>& expectedCmds);
void expectIptablesCommands(const ExpectedIptablesCommands& expectedCmds);
void expectIptablesRestoreCommands(const std::vector<std::string>& expectedCmds);
@@ -35,5 +38,6 @@
protected:
static std::vector<std::string> sCmds;
static ExpectedIptablesCommands sRestoreCmds;
+ static std::deque<std::string> sPopenContents;
int expectIptablesCommand(IptablesTarget target, int pos, const std::string& cmd);
};