security: Move PIB-related code into security/pib/

Change-Id: I94ea7ce646e66382f7c534ca1c8d6cbeeb87b1a4
diff --git a/tests/unit-tests/security/certificate-container.t.cpp b/tests/unit-tests/security/pib/certificate-container.t.cpp
similarity index 92%
rename from tests/unit-tests/security/certificate-container.t.cpp
rename to tests/unit-tests/security/pib/certificate-container.t.cpp
index 6ff8499..514cc3d 100644
--- a/tests/unit-tests/security/certificate-container.t.cpp
+++ b/tests/unit-tests/security/pib/certificate-container.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/certificate-container.hpp"
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/certificate-container.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -31,6 +31,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_AUTO_TEST_SUITE(TestCertificateContainer)
 
 BOOST_FIXTURE_TEST_CASE(TestCertificateContainer, PibDataFixture)
@@ -73,6 +74,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestCertificateContainer
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/identity-container.t.cpp b/tests/unit-tests/security/pib/identity-container.t.cpp
similarity index 92%
rename from tests/unit-tests/security/identity-container.t.cpp
rename to tests/unit-tests/security/pib/identity-container.t.cpp
index c2c1c0e..4cf57e9 100644
--- a/tests/unit-tests/security/identity-container.t.cpp
+++ b/tests/unit-tests/security/pib/identity-container.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/identity-container.hpp"
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/identity-container.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -31,6 +31,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_AUTO_TEST_SUITE(TestIdentityContainer)
 
 BOOST_FIXTURE_TEST_CASE(Basic, PibDataFixture)
@@ -71,6 +72,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestIdentityContainer
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/identity.t.cpp b/tests/unit-tests/security/pib/identity.t.cpp
similarity index 93%
rename from tests/unit-tests/security/identity.t.cpp
rename to tests/unit-tests/security/pib/identity.t.cpp
index 5e04d4c..d31f7c6 100644
--- a/tests/unit-tests/security/identity.t.cpp
+++ b/tests/unit-tests/security/pib/identity.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/identity.hpp"
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/identity.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -31,6 +31,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_FIXTURE_TEST_SUITE(TestIdentity, PibDataFixture)
 
 BOOST_AUTO_TEST_CASE(ValidityChecking)
@@ -81,6 +82,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestIdentity
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/key-container.t.cpp b/tests/unit-tests/security/pib/key-container.t.cpp
similarity index 93%
rename from tests/unit-tests/security/key-container.t.cpp
rename to tests/unit-tests/security/pib/key-container.t.cpp
index 817a84f..ee5bf1c 100644
--- a/tests/unit-tests/security/key-container.t.cpp
+++ b/tests/unit-tests/security/pib/key-container.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/key-container.hpp"
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/key-container.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -31,6 +31,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_AUTO_TEST_SUITE(TestKeyContainer)
 
 BOOST_FIXTURE_TEST_CASE(Basic, PibDataFixture)
@@ -74,6 +75,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestKeyContainer
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/key.t.cpp b/tests/unit-tests/security/pib/key.t.cpp
similarity index 94%
rename from tests/unit-tests/security/key.t.cpp
rename to tests/unit-tests/security/pib/key.t.cpp
index 7d9ddc1..673c149 100644
--- a/tests/unit-tests/security/key.t.cpp
+++ b/tests/unit-tests/security/pib/key.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/key.hpp"
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/key.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -31,6 +31,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_FIXTURE_TEST_SUITE(TestKey, PibDataFixture)
 
 BOOST_AUTO_TEST_CASE(ValidityChecking)
@@ -87,6 +88,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestKey
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/pib-data-fixture.cpp b/tests/unit-tests/security/pib/pib-data-fixture.cpp
similarity index 99%
rename from tests/unit-tests/security/pib-data-fixture.cpp
rename to tests/unit-tests/security/pib/pib-data-fixture.cpp
index 18b2cfb..25eb83c 100644
--- a/tests/unit-tests/security/pib-data-fixture.cpp
+++ b/tests/unit-tests/security/pib/pib-data-fixture.cpp
@@ -20,6 +20,11 @@
  */
 
 #include "pib-data-fixture.hpp"
+#include "../../identity-management-time-fixture.hpp"
+
+namespace ndn {
+namespace security {
+namespace tests {
 
 /**
  * The test data can be generated with a TestCertDataGenerator defined as below:
@@ -311,9 +316,6 @@
   0x2C, 0x3D, 0x86, 0xCF, 0xF6, 0x8D, 0x2F, 0x13, 0x60, 0x28, 0xB1, 0x13, 0xFE, 0x49, 0x3B, 0xA4, 0xAD
 };
 
-namespace ndn {
-namespace security {
-
 PibDataFixture::PibDataFixture()
   : id1("/pib/interface/id/1")
   , id2("/pib/interface/id/2")
@@ -336,5 +338,6 @@
 {
 }
 
+} // namespace tests
 } // namespace security
 } // namespace ndn
diff --git a/tests/unit-tests/security/pib-data-fixture.hpp b/tests/unit-tests/security/pib/pib-data-fixture.hpp
similarity index 97%
rename from tests/unit-tests/security/pib-data-fixture.hpp
rename to tests/unit-tests/security/pib/pib-data-fixture.hpp
index 5e92dd1..2971cd5 100644
--- a/tests/unit-tests/security/pib-data-fixture.hpp
+++ b/tests/unit-tests/security/pib/pib-data-fixture.hpp
@@ -28,6 +28,7 @@
 
 namespace ndn {
 namespace security {
+namespace tests {
 
 class PibDataFixture
 {
@@ -58,6 +59,7 @@
   v1::IdentityCertificate id2Key2Cert2;
 };
 
+} // namespace tests
 } // namespace security
 } // namespace ndn
 
diff --git a/tests/unit-tests/security/pib-impl.t.cpp b/tests/unit-tests/security/pib/pib-impl.t.cpp
similarity index 97%
rename from tests/unit-tests/security/pib-impl.t.cpp
rename to tests/unit-tests/security/pib/pib-impl.t.cpp
index d86a95d..9a0e85f 100644
--- a/tests/unit-tests/security/pib-impl.t.cpp
+++ b/tests/unit-tests/security/pib/pib-impl.t.cpp
@@ -19,9 +19,9 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/pib-memory.hpp"
-#include "security/pib-sqlite3.hpp"
-#include "security/pib.hpp"
+#include "security/pib/pib-memory.hpp"
+#include "security/pib/pib-sqlite3.hpp"
+#include "security/pib/pib.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -34,6 +34,7 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
 BOOST_AUTO_TEST_SUITE(TestPibImpl)
 
 class PibMemoryWrapper
@@ -227,6 +228,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestPibImpl
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/pib-memory.t.cpp b/tests/unit-tests/security/pib/pib-memory.t.cpp
similarity index 93%
rename from tests/unit-tests/security/pib-memory.t.cpp
rename to tests/unit-tests/security/pib/pib-memory.t.cpp
index 74dde3f..9d2c3f8 100644
--- a/tests/unit-tests/security/pib-memory.t.cpp
+++ b/tests/unit-tests/security/pib/pib-memory.t.cpp
@@ -19,7 +19,7 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/pib-memory.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 
@@ -27,10 +27,10 @@
 namespace security {
 namespace tests {
 
-BOOST_AUTO_TEST_SUITE(Security)
-BOOST_AUTO_TEST_SUITE(TestPibMemory)
-
 // most functionalities are tested in pib-impl.t.cpp
+BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
+BOOST_AUTO_TEST_SUITE(TestPibMemory)
 
 BOOST_AUTO_TEST_CASE(TpmLocatorManagement)
 {
@@ -41,6 +41,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestPibMemory
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/pib-sqlite3.t.cpp b/tests/unit-tests/security/pib/pib-sqlite3.t.cpp
similarity index 97%
rename from tests/unit-tests/security/pib-sqlite3.t.cpp
rename to tests/unit-tests/security/pib/pib-sqlite3.t.cpp
index 656900e..7055a37 100644
--- a/tests/unit-tests/security/pib-sqlite3.t.cpp
+++ b/tests/unit-tests/security/pib/pib-sqlite3.t.cpp
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/pib-sqlite3.hpp"
-#include "security/pib.hpp"
+#include "security/pib/pib-sqlite3.hpp"
+#include "security/pib/pib.hpp"
 
 #include "boost-test.hpp"
 
@@ -30,6 +30,9 @@
 namespace security {
 namespace tests {
 
+BOOST_AUTO_TEST_SUITE(Security)
+BOOST_AUTO_TEST_SUITE(TestPib)
+
 class PibSqlite3TestFixture
 {
 public:
@@ -51,7 +54,6 @@
   PibSqlite3 impl;
 };
 
-BOOST_AUTO_TEST_SUITE(Security)
 BOOST_FIXTURE_TEST_SUITE(TestPibSqlite3, PibSqlite3TestFixture)
 
 // most functionalities are tested in pib-impl.t.cpp
@@ -119,6 +121,7 @@
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestPibSqlite3
+BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security
 
 } // namespace tests
diff --git a/tests/unit-tests/security/pib.t.cpp b/tests/unit-tests/security/pib/pib.t.cpp
similarity index 92%
rename from tests/unit-tests/security/pib.t.cpp
rename to tests/unit-tests/security/pib/pib.t.cpp
index be617ac..7c6b47f 100644
--- a/tests/unit-tests/security/pib.t.cpp
+++ b/tests/unit-tests/security/pib/pib.t.cpp
@@ -19,8 +19,8 @@
  * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
  */
 
-#include "security/pib.hpp"
-#include "security/pib-memory.hpp"
+#include "security/pib/pib.hpp"
+#include "security/pib/pib-memory.hpp"
 
 #include "boost-test.hpp"
 #include "pib-data-fixture.hpp"
@@ -30,7 +30,8 @@
 namespace tests {
 
 BOOST_AUTO_TEST_SUITE(Security)
-BOOST_FIXTURE_TEST_SUITE(TestPib, PibDataFixture)
+BOOST_AUTO_TEST_SUITE(TestPib)
+BOOST_FIXTURE_TEST_SUITE(Common, PibDataFixture)
 
 BOOST_AUTO_TEST_CASE(ValidityChecking)
 {
@@ -79,6 +80,7 @@
   BOOST_CHECK_THROW(pib.getDefaultIdentity(), Pib::Error);
 }
 
+BOOST_AUTO_TEST_SUITE_END() // Common
 BOOST_AUTO_TEST_SUITE_END() // TestPib
 BOOST_AUTO_TEST_SUITE_END() // Security