diff options
author | Paul Hu <paulhu@google.com> | 2022-06-24 13:56:01 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2022-06-24 13:56:01 +0000 |
commit | 7c6f55ae0e1160f973bffa6b121ed25b34db82bc (patch) | |
tree | 5f09deca8805ef9c48a543ced906ca32bf8cb09f /server | |
parent | d73f19f70133eabc240a907a506f8a35ba8739cc (diff) | |
parent | 1c64f0849fc2f63dc33d11baa70a062581797175 (diff) | |
download | netd-7c6f55ae0e1160f973bffa6b121ed25b34db82bc.tar.gz |
Merge "Logging life cycle of each test"
Diffstat (limited to 'server')
-rw-r--r-- | server/InterfaceControllerTest.cpp | 5 | ||||
-rw-r--r-- | server/IptablesBaseTest.h | 4 | ||||
-rw-r--r-- | server/IptablesRestoreControllerTest.cpp | 3 | ||||
-rw-r--r-- | server/NFLogListenerTest.cpp | 3 | ||||
-rw-r--r-- | server/SockDiagTest.cpp | 3 | ||||
-rw-r--r-- | server/XfrmControllerTest.cpp | 3 |
6 files changed, 14 insertions, 7 deletions
diff --git a/server/InterfaceControllerTest.cpp b/server/InterfaceControllerTest.cpp index 006018d7..8075431f 100644 --- a/server/InterfaceControllerTest.cpp +++ b/server/InterfaceControllerTest.cpp @@ -22,6 +22,7 @@ #include <gtest/gtest.h> #include <netdutils/MockSyscalls.h> +#include <netdutils/NetNativeTestBase.h> #include <netdutils/Utils.h> #include "InterfaceController.h" @@ -66,7 +67,7 @@ class MockProperties { } // namespace -class StablePrivacyTest : public testing::Test { +class StablePrivacyTest : public NetNativeTestBase { protected: void expectOpenFile(const std::string& path, const Fd fd, int err) { if (err == 0) { @@ -179,7 +180,7 @@ TEST_F(StablePrivacyTest, ExistingPropertyWriteFail) { EXPECT_NE(ok, enableStablePrivacyAddresses(kTestIface)); } -class GetIfaceListTest : public testing::Test {}; +class GetIfaceListTest : public NetNativeTestBase {}; TEST_F(GetIfaceListTest, IfaceNames) { StatusOr<std::vector<std::string>> ifaceNames = getIfaceNames(); diff --git a/server/IptablesBaseTest.h b/server/IptablesBaseTest.h index abe3f84a..bfcc71a1 100644 --- a/server/IptablesBaseTest.h +++ b/server/IptablesBaseTest.h @@ -18,9 +18,11 @@ #include <deque> +#include <netdutils/NetNativeTestBase.h> + #include "NetdConstants.h" -class IptablesBaseTest : public ::testing::Test { +class IptablesBaseTest : public NetNativeTestBase { public: IptablesBaseTest(); diff --git a/server/IptablesRestoreControllerTest.cpp b/server/IptablesRestoreControllerTest.cpp index a05c76d1..cecdf4d9 100644 --- a/server/IptablesRestoreControllerTest.cpp +++ b/server/IptablesRestoreControllerTest.cpp @@ -32,6 +32,7 @@ #include <android-base/strings.h> #include <log/log.h> #include <netdutils/MockSyscalls.h> +#include <netdutils/NetNativeTestBase.h> #include <netdutils/Stopwatch.h> #include "NetdConstants.h" @@ -55,7 +56,7 @@ using android::netdutils::Stopwatch; using testing::Return; using testing::StrictMock; -class IptablesRestoreControllerTest : public ::testing::Test { +class IptablesRestoreControllerTest : public NetNativeTestBase { public: IptablesRestoreController con; int mDefaultMaxRetries = con.MAX_RETRIES; diff --git a/server/NFLogListenerTest.cpp b/server/NFLogListenerTest.cpp index 88ab2c61..878c9884 100644 --- a/server/NFLogListenerTest.cpp +++ b/server/NFLogListenerTest.cpp @@ -25,6 +25,7 @@ #include <linux/netfilter/nfnetlink_log.h> #include <netdutils/MockSyscalls.h> +#include <netdutils/NetNativeTestBase.h> #include "NFLogListener.h" using ::testing::_; @@ -58,7 +59,7 @@ class MockNetlinkListener : public NetlinkListenerInterface { MOCK_METHOD1(registerSkErrorHandler, void(const SkErrorHandler& handler)); }; -class NFLogListenerTest : public testing::Test { +class NFLogListenerTest : public NetNativeTestBase { protected: NFLogListenerTest() { EXPECT_CALL(*mNLListener, subscribe(kNFLogPacketMsgType, _)) diff --git a/server/SockDiagTest.cpp b/server/SockDiagTest.cpp index 49601aa4..864d08d5 100644 --- a/server/SockDiagTest.cpp +++ b/server/SockDiagTest.cpp @@ -24,6 +24,7 @@ #include <linux/inet_diag.h> #include <gtest/gtest.h> +#include <netdutils/NetNativeTestBase.h> #include "Fwmark.h" #include "NetdConstants.h" @@ -33,7 +34,7 @@ namespace android { namespace net { -class SockDiagTest : public ::testing::Test { +class SockDiagTest : public NetNativeTestBase { protected: static bool isLoopbackSocket(const inet_diag_msg *msg) { return SockDiag::isLoopbackSocket(msg); diff --git a/server/XfrmControllerTest.cpp b/server/XfrmControllerTest.cpp index e7f5cfc0..f1c38073 100644 --- a/server/XfrmControllerTest.cpp +++ b/server/XfrmControllerTest.cpp @@ -41,6 +41,7 @@ #include <android-base/strings.h> #include <android-base/unique_fd.h> #include <gtest/gtest.h> +#include <netdutils/NetNativeTestBase.h> #include "Fwmark.h" #include "NetdConstants.h" @@ -127,7 +128,7 @@ void expectAddressEquals(int family, const std::string& expected, const xfrm_add EXPECT_EQ(expected, actualStr); } -class XfrmControllerTest : public ::testing::Test { +class XfrmControllerTest : public NetNativeTestBase { public: testing::StrictMock<netdutils::ScopedMockSyscalls> mockSyscalls; }; |