tests: Enable isolation of KeyChain during run of unit/integrated tests
Change-Id: Ia136e4bb074c14e8d824f563594cbc0ad7592c3b
Refs: #3655
diff --git a/tests/unit-tests/face.t.cpp b/tests/unit-tests/face.t.cpp
index 3a40320..ac87d37 100644
--- a/tests/unit-tests/face.t.cpp
+++ b/tests/unit-tests/face.t.cpp
@@ -27,7 +27,8 @@
#include "transport/unix-transport.hpp"
#include "boost-test.hpp"
-#include "unit-test-time-fixture.hpp"
+#include "identity-management-time-fixture.hpp"
+#include "key-chain-fixture.hpp"
#include "make-interest-data.hpp"
namespace ndn {
@@ -35,12 +36,12 @@
using ndn::util::DummyClientFace;
-class FaceFixture : public UnitTestTimeFixture
+class FaceFixture : public IdentityManagementTimeFixture
{
public:
explicit
FaceFixture(bool enableRegistrationReply = true)
- : face(io, { true, enableRegistrationReply })
+ : face(io, m_keyChain, { true, enableRegistrationReply })
{
}
@@ -587,7 +588,7 @@
BOOST_AUTO_TEST_CASE(DestructionWithoutCancellingPendingInterests) // Bug #2518
{
{
- DummyClientFace face2(io);
+ DummyClientFace face2(io, m_keyChain);
face2.expressInterest(Interest("/Hello/World", time::milliseconds(50)),
bind([]{}), bind([]{}));
advanceClocks(time::milliseconds(10), 10);
@@ -597,9 +598,15 @@
// should not segfault
}
-BOOST_AUTO_TEST_CASE(FaceTransport)
+struct PibDirWithDefaultTpm
+{
+ const std::string PATH = "build/keys-with-default-tpm";
+};
+
+BOOST_FIXTURE_TEST_CASE(FaceTransport, PibDirFixture<PibDirWithDefaultTpm>)
{
KeyChain keyChain;
+ boost::asio::io_service io;
BOOST_CHECK(Face().getTransport() != nullptr);