tests: sync common testing infrastructure with ndn-cxx
Upgrade waf to version 2.0.21
Change-Id: I30615cc49416088e9c5e4d602fd11360c0ed9328
diff --git a/tests/unit/validator/certificate-fetcher-ndns-app-cert.cpp b/tests/unit/validator/certificate-fetcher-ndns-app-cert.t.cpp
similarity index 93%
rename from tests/unit/validator/certificate-fetcher-ndns-app-cert.cpp
rename to tests/unit/validator/certificate-fetcher-ndns-app-cert.t.cpp
index d425832..ae41eeb 100644
--- a/tests/unit/validator/certificate-fetcher-ndns-app-cert.cpp
+++ b/tests/unit/validator/certificate-fetcher-ndns-app-cert.t.cpp
@@ -17,18 +17,20 @@
* NDNS, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "validator/validator.hpp"
#include "validator/certificate-fetcher-ndns-appcert.hpp"
+
#include "ndns-label.hpp"
-#include "util/cert-helper.hpp"
#include "daemon/name-server.hpp"
#include "daemon/rrset-factory.hpp"
#include "mgmt/management-tool.hpp"
+#include "util/cert-helper.hpp"
+#include "validator/validator.hpp"
-#include "test-common.hpp"
+#include "boost-test.hpp"
#include "unit/database-test-data.hpp"
#include <ndn-cxx/security/validation-policy-simple-hierarchy.hpp>
+#include <ndn-cxx/util/dummy-client-face.hpp>
namespace ndn {
namespace ndns {
@@ -39,7 +41,7 @@
static unique_ptr<security::Validator>
makeValidatorAppCert(Face& face)
{
- return make_unique<security::Validator>(make_unique<::ndn::security::ValidationPolicySimpleHierarchy>(),
+ return make_unique<security::Validator>(make_unique<security::ValidationPolicySimpleHierarchy>(),
make_unique<CertificateFetcherAppCert>(face));
}
@@ -54,7 +56,7 @@
buildAppCertAndData();
auto serverValidator = NdnsValidatorBuilder::create(m_validatorFace, 10, 0,
- TEST_CONFIG_PATH "/validator.conf");
+ UNIT_TESTS_TMPDIR "/validator.conf");
// initialize all servers
auto addServer = [this, &serverValidator] (const Name& zoneName) {
m_serverFaces.push_back(make_unique<util::DummyClientFace>(m_io, m_keyChain,
@@ -81,7 +83,7 @@
buildAppCertAndData()
{
// create NDNS-stored certificate and the signed data
- Identity ndnsimIdentity = addIdentity(m_ndnsimName);
+ Identity ndnsimIdentity = m_keyChain.createIdentity(m_ndnsimName);
Key randomKey = m_keyChain.createKey(ndnsimIdentity);
Certificate ndnsStoredAppCert = randomKey.getDefaultCertificate();
RrsetFactory rf(TEST_DATABASE.string(), m_ndnsimName, m_keyChain,
diff --git a/tests/unit/validator/validator.cpp b/tests/unit/validator/validator.t.cpp
similarity index 97%
rename from tests/unit/validator/validator.cpp
rename to tests/unit/validator/validator.t.cpp
index 2948ae3..0161125 100644
--- a/tests/unit/validator/validator.cpp
+++ b/tests/unit/validator/validator.t.cpp
@@ -19,12 +19,14 @@
#include "validator/validator.hpp"
#include "ndns-label.hpp"
-#include "util/cert-helper.hpp"
#include "daemon/name-server.hpp"
+#include "util/cert-helper.hpp"
-#include "test-common.hpp"
+#include "boost-test.hpp"
#include "unit/database-test-data.hpp"
+#include <ndn-cxx/util/dummy-client-face.hpp>
+
namespace ndn {
namespace ndns {
namespace tests {
@@ -37,7 +39,7 @@
ValidatorTestFixture()
: m_validatorFace(m_io, m_keyChain, {true, true})
, m_validator(NdnsValidatorBuilder::create(m_validatorFace, 500, 0,
- TEST_CONFIG_PATH "/validator.conf"))
+ UNIT_TESTS_TMPDIR "/validator.conf"))
{
// generate a random cert
// check how does name-server test do