tests: Improving ManagementTool test suite and fixing discovered bugs
Change-Id: I1c7e51cf105544325657825474f9ee85d61396ed
Refs: #2226
diff --git a/tools/ndns-add-rr-from-file.cpp b/tools/ndns-add-rr-from-file.cpp
index 4fc2066..1753fd6 100644
--- a/tools/ndns-add-rr-from-file.cpp
+++ b/tools/ndns-add-rr-from-file.cpp
@@ -108,7 +108,8 @@
else
ttl = time::seconds(ttlInt);
- ndn::ndns::ManagementTool tool(db);
+ ndn::KeyChain keyChain;
+ ndn::ndns::ManagementTool tool(db, keyChain);
tool.addRrSet(zoneName, file, ttl, dskName);
}
catch (const std::exception& ex) {
diff --git a/tools/ndns-add-rr.cpp b/tools/ndns-add-rr.cpp
index 47e7121..58df2a2 100644
--- a/tools/ndns-add-rr.cpp
+++ b/tools/ndns-add-rr.cpp
@@ -148,7 +148,8 @@
ttl = time::seconds(ttlInt);
uint64_t version = static_cast<uint64_t>(versionInt);
- ndn::ndns::ManagementTool tool(db);
+ ndn::KeyChain keyChain;
+ ndn::ndns::ManagementTool tool(db, keyChain);
tool.addRrSet(zoneName, label, type, ndnsType, version, content, dsk, ttl);
/// @todo Report success or failure
diff --git a/tools/ndns-create-zone.cpp b/tools/ndns-create-zone.cpp
index 0893bc7..99c70f7 100644
--- a/tools/ndns-create-zone.cpp
+++ b/tools/ndns-create-zone.cpp
@@ -123,7 +123,8 @@
else
certTtl = time::seconds(certTtlInt);
- ndn::ndns::ManagementTool tool(db);
+ ndn::KeyChain keyChain;
+ ndn::ndns::ManagementTool tool(db, keyChain);
tool.createZone(zone, parent, cacheTtl, certTtl, ksk, dsk);
}
catch (const std::exception& ex) {
diff --git a/tools/ndns-delete-zone.cpp b/tools/ndns-delete-zone.cpp
index 12bc7f3..141f498 100644
--- a/tools/ndns-delete-zone.cpp
+++ b/tools/ndns-delete-zone.cpp
@@ -78,7 +78,8 @@
try {
Name zone(zoneStr);
- ndn::ndns::ManagementTool tool(db);
+ ndn::KeyChain keyChain;
+ ndn::ndns::ManagementTool tool(db, keyChain);
tool.deleteZone(zone);
}
catch (const std::exception& ex) {
diff --git a/tools/ndns-export-certificate.cpp b/tools/ndns-export-certificate.cpp
index 701aa20..e72a841 100644
--- a/tools/ndns-export-certificate.cpp
+++ b/tools/ndns-export-certificate.cpp
@@ -93,7 +93,8 @@
try {
Name certName(certStr);
- ndn::ndns::ManagementTool tool(db);
+ ndn::KeyChain keyChain;
+ ndn::ndns::ManagementTool tool(db, keyChain);
tool.exportCertificate(certName, output);
}
catch (const std::exception& ex) {
diff --git a/tools/ndns-get-rr.cpp b/tools/ndns-get-rr.cpp
index bdf86e0..8e655fd 100644
--- a/tools/ndns-get-rr.cpp
+++ b/tools/ndns-get-rr.cpp
@@ -99,7 +99,8 @@
Name label(rrLabelStr);
name::Component type(rrTypeStr);
- ndn::ndns::ManagementTool tool(db);
+ ndn::KeyChain keyChain;
+ ndn::ndns::ManagementTool tool(db, keyChain);
tool.getRrSet(zoneName, label, type, std::cout);
}
catch (const std::exception& ex) {
diff --git a/tools/ndns-list-all-zones.cpp b/tools/ndns-list-all-zones.cpp
index 98c33f3..6e80512 100644
--- a/tools/ndns-list-all-zones.cpp
+++ b/tools/ndns-list-all-zones.cpp
@@ -70,7 +70,8 @@
}
try {
- ndn::ndns::ManagementTool tool(db);
+ ndn::KeyChain keyChain;
+ ndn::ndns::ManagementTool tool(db, keyChain);
tool.listAllZones(std::cout);
}
catch (const std::exception& ex) {
diff --git a/tools/ndns-list-zone.cpp b/tools/ndns-list-zone.cpp
index f1a85a2..18d3a57 100644
--- a/tools/ndns-list-zone.cpp
+++ b/tools/ndns-list-zone.cpp
@@ -97,7 +97,8 @@
try {
Name zoneName(zoneStr);
- ndn::ndns::ManagementTool tool(db);
+ ndn::KeyChain keyChain;
+ ndn::ndns::ManagementTool tool(db, keyChain);
tool.listZone(zoneName, std::cout, printRaw);
}
catch (const std::exception& ex) {
diff --git a/tools/ndns-remove-rr.cpp b/tools/ndns-remove-rr.cpp
index a3fdf89..d6159f6 100644
--- a/tools/ndns-remove-rr.cpp
+++ b/tools/ndns-remove-rr.cpp
@@ -102,7 +102,8 @@
Name label(rrLabelStr);
name::Component type(rrTypeStr);
- ndn::ndns::ManagementTool tool(db);
+ ndn::KeyChain keyChain;
+ ndn::ndns::ManagementTool tool(db, keyChain);
tool.removeRrSet(zoneName, label, type);
/// @todo Report how many records have been removed