use namespace for ca and rename CaState to ca::RequestState
Change-Id: I2250bf7fb68503465dae18e16dc3c512fe809037
diff --git a/tests/unit-tests/bench.t.cpp b/tests/unit-tests/bench.t.cpp
index 48f2048..9dcab39 100644
--- a/tests/unit-tests/bench.t.cpp
+++ b/tests/unit-tests/bench.t.cpp
@@ -37,7 +37,7 @@
auto cert = key.getDefaultCertificate();
util::DummyClientFace face(io, m_keyChain, {true, true});
- CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
+ ca::CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
advanceClocks(time::milliseconds(20), 60);
auto profileData = ca.getCaProfileData();
@@ -96,7 +96,7 @@
auto cert = key.getDefaultCertificate();
util::DummyClientFace face(io, m_keyChain, {true, true});
- CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
+ ca::CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-1", "ca-storage-memory");
advanceClocks(time::milliseconds(20), 60);
// generate NEW Interest
diff --git a/tests/unit-tests/ca-memory.t.cpp b/tests/unit-tests/ca-memory.t.cpp
index 9774610..6936dd6 100644
--- a/tests/unit-tests/ca-memory.t.cpp
+++ b/tests/unit-tests/ca-memory.t.cpp
@@ -26,6 +26,8 @@
namespace ndncert {
namespace tests {
+using namespace ca;
+
BOOST_FIXTURE_TEST_SUITE(TestCaMemory, IdentityManagementFixture)
BOOST_AUTO_TEST_CASE(RequestOperations)
@@ -38,7 +40,7 @@
// add operation
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState request1(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert1, makeStringBlock(ndn::tlv::ContentType_Key, "PretendItIsAKey"));
+ RequestState request1(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert1, makeStringBlock(ndn::tlv::ContentType_Key, "PretendItIsAKey"));
BOOST_CHECK_NO_THROW(storage.addRequest(request1));
// get operation
@@ -52,7 +54,7 @@
json.put("code", "1234");
// update operation
- CaState request2(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert1,
+ RequestState request2(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert1,
"email", "test", time::system_clock::now(), 3, time::seconds(3600),
std::move(json), makeStringBlock(ndn::tlv::ContentType_Key, "PretendItIsAKey"), 0);
storage.updateRequest(request2);
@@ -65,7 +67,7 @@
auto key2 = identity2.getDefaultKey();
auto cert2 = key2.getDefaultCertificate();
RequestID requestId2 = {8,7,6,5,4,3,2,1};
- CaState request3(Name("/ndn/site2"), requestId2, RequestType::NEW, Status::BEFORE_CHALLENGE, cert2, makeStringBlock(ndn::tlv::ContentType_Key, "PretendItIsAKey"));
+ RequestState request3(Name("/ndn/site2"), requestId2, RequestType::NEW, Status::BEFORE_CHALLENGE, cert2, makeStringBlock(ndn::tlv::ContentType_Key, "PretendItIsAKey"));
storage.addRequest(request3);
// list operation
diff --git a/tests/unit-tests/ca-module.t.cpp b/tests/unit-tests/ca-module.t.cpp
index a9177ac..69d87d5 100644
--- a/tests/unit-tests/ca-module.t.cpp
+++ b/tests/unit-tests/ca-module.t.cpp
@@ -30,6 +30,8 @@
namespace ndncert {
namespace tests {
+using namespace ca;
+
BOOST_FIXTURE_TEST_SUITE(TestCaModule, DatabaseFixture)
BOOST_AUTO_TEST_CASE(Initialization)
@@ -466,7 +468,7 @@
time::system_clock::now() + time::hours(10)));
m_keyChain.sign(clientCert, signingByKey(clientKey.getName()).setSignatureInfo(signatureInfo));
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState certRequest(Name("/ndn"), requestId, RequestType::NEW, Status::SUCCESS, clientCert, makeEmptyBlock(ndn::tlv::ContentType_Key));
+ RequestState certRequest(Name("/ndn"), requestId, RequestType::NEW, Status::SUCCESS, clientCert, makeEmptyBlock(ndn::tlv::ContentType_Key));
auto issuedCert = ca.issueCertificate(certRequest);
CaProfile item;
diff --git a/tests/unit-tests/ca-sqlite.t.cpp b/tests/unit-tests/ca-sqlite.t.cpp
index a2c0542..e780dde 100644
--- a/tests/unit-tests/ca-sqlite.t.cpp
+++ b/tests/unit-tests/ca-sqlite.t.cpp
@@ -25,6 +25,8 @@
namespace ndncert {
namespace tests {
+using namespace ca;
+
BOOST_FIXTURE_TEST_SUITE(TestCaSqlite, DatabaseFixture)
BOOST_AUTO_TEST_CASE(RequestOperations)
@@ -37,7 +39,7 @@
// add operation
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState request1(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert1, makeStringBlock(ndn::tlv::ContentType_Key, "PretendItIsAKey"));
+ RequestState request1(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert1, makeStringBlock(ndn::tlv::ContentType_Key, "PretendItIsAKey"));
storage.addRequest(request1);
// get operation
@@ -50,7 +52,7 @@
// update operation
JsonSection json;
json.put("test", "4567");
- CaState request2(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert1,
+ RequestState request2(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert1,
"email", "test", time::system_clock::now(), 3, time::seconds(3600),
std::move(json), makeEmptyBlock(ndn::tlv::ContentType_Key), 0);
storage.updateRequest(request2);
@@ -63,7 +65,7 @@
auto key2 = identity2.getDefaultKey();
auto cert2 = key2.getDefaultCertificate();
RequestID requestId2 = {8,7,6,5,4,3,2,1};
- CaState request3(Name("/ndn/site2"), requestId2, RequestType::NEW, Status::BEFORE_CHALLENGE, cert2, makeStringBlock(ndn::tlv::ContentType_Key, "PretendItIsAKey"));
+ RequestState request3(Name("/ndn/site2"), requestId2, RequestType::NEW, Status::BEFORE_CHALLENGE, cert2, makeStringBlock(ndn::tlv::ContentType_Key, "PretendItIsAKey"));
storage.addRequest(request3);
// list operation
@@ -89,7 +91,7 @@
// add operation
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState request1(Name("/ndn/site1"),requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert1, makeEmptyBlock(ndn::tlv::ContentType_Key));
+ RequestState request1(Name("/ndn/site1"),requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert1, makeEmptyBlock(ndn::tlv::ContentType_Key));
BOOST_CHECK_NO_THROW(storage.addRequest(request1));
// add again
BOOST_CHECK_THROW(storage.addRequest(request1), std::runtime_error);
diff --git a/tests/unit-tests/challenge-credential.t.cpp b/tests/unit-tests/challenge-credential.t.cpp
index 00333ab..e048e29 100644
--- a/tests/unit-tests/challenge-credential.t.cpp
+++ b/tests/unit-tests/challenge-credential.t.cpp
@@ -54,7 +54,7 @@
auto keyA = identityA.getDefaultKey();
auto certA = key.getDefaultCertificate();
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState state(Name("/example"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, certA, makeEmptyBlock(ndn::tlv::ContentType_Key));
+ ca::RequestState state(Name("/example"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, certA, makeEmptyBlock(ndn::tlv::ContentType_Key));
// create requester's credential
auto identityB = addIdentity(Name("/trust/cert"));
diff --git a/tests/unit-tests/challenge-email.t.cpp b/tests/unit-tests/challenge-email.t.cpp
index 3435a00..b319040 100644
--- a/tests/unit-tests/challenge-email.t.cpp
+++ b/tests/unit-tests/challenge-email.t.cpp
@@ -46,7 +46,7 @@
auto key = identity.getDefaultKey();
auto cert = key.getDefaultCertificate();
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert, makeEmptyBlock(ndn::tlv::ContentType_Key));
+ ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert, makeEmptyBlock(ndn::tlv::ContentType_Key));
Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_EMAIL));
@@ -96,7 +96,7 @@
auto key = identity.getDefaultKey();
auto cert = key.getDefaultCertificate();
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert, makeEmptyBlock(ndn::tlv::ContentType_Key));
+ ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert, makeEmptyBlock(ndn::tlv::ContentType_Key));
Block paramTLV = makeEmptyBlock(tlv::EncryptedPayload);
paramTLV.push_back(makeStringBlock(tlv::ParameterKey, ChallengeEmail::PARAMETER_KEY_EMAIL));
@@ -118,7 +118,7 @@
JsonSection json;
json.put(ChallengeEmail::PARAMETER_KEY_CODE, "4567");
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert,
+ ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert,
"email", ChallengeEmail::NEED_CODE, time::system_clock::now(),
3, time::seconds(3600), std::move(json), makeEmptyBlock(ndn::tlv::ContentType_Key), 0);
@@ -141,7 +141,7 @@
JsonSection json;
json.put(ChallengeEmail::PARAMETER_KEY_CODE, "4567");
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert,
+ ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert,
"email", ChallengeEmail::NEED_CODE, time::system_clock::now(),
3, time::seconds(3600), std::move(json), makeEmptyBlock(ndn::tlv::ContentType_Key), 0);
diff --git a/tests/unit-tests/challenge-pin.t.cpp b/tests/unit-tests/challenge-pin.t.cpp
index 772bc2e..a82c1b1 100644
--- a/tests/unit-tests/challenge-pin.t.cpp
+++ b/tests/unit-tests/challenge-pin.t.cpp
@@ -39,7 +39,7 @@
auto key = identity.getDefaultKey();
auto cert = key.getDefaultCertificate();
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert, makeEmptyBlock(ndn::tlv::ContentType_Key));
+ ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::BEFORE_CHALLENGE, cert, makeEmptyBlock(ndn::tlv::ContentType_Key));
ChallengePin challenge;
challenge.handleChallengeRequest(makeEmptyBlock(tlv::EncryptedPayload), request);
@@ -57,7 +57,7 @@
JsonSection secret;
secret.add(ChallengePin::PARAMETER_KEY_CODE, "12345");
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert,
+ ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert,
"pin", ChallengePin::NEED_CODE, time::system_clock::now(),
3, time::seconds(3600), std::move(secret), makeEmptyBlock(ndn::tlv::ContentType_Key), 0);
@@ -80,7 +80,7 @@
JsonSection secret;
secret.add(ChallengePin::PARAMETER_KEY_CODE, "12345");
RequestID requestId = {1,2,3,4,5,6,7,8};
- CaState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert,
+ ca::RequestState request(Name("/ndn/site1"), requestId, RequestType::NEW, Status::CHALLENGE, cert,
"pin", ChallengePin::NEED_CODE, time::system_clock::now(),
3, time::seconds(3600), std::move(secret), makeEmptyBlock(ndn::tlv::ContentType_Key), 0);
diff --git a/tests/unit-tests/configuration.t.cpp b/tests/unit-tests/configuration.t.cpp
index e887165..1957338 100644
--- a/tests/unit-tests/configuration.t.cpp
+++ b/tests/unit-tests/configuration.t.cpp
@@ -30,7 +30,7 @@
BOOST_AUTO_TEST_CASE(CAConfigFile)
{
- CaConfig config;
+ ca::CaConfig config;
config.load("tests/unit-tests/config-files/config-ca-1");
BOOST_CHECK_EQUAL(config.m_caItem.m_caPrefix, "/ndn");
BOOST_CHECK_EQUAL(config.m_caItem.m_caInfo, "ndn testbed ca");
@@ -78,7 +78,7 @@
BOOST_AUTO_TEST_CASE(CAConfigFileWithErrors)
{
- CaConfig config;
+ ca::CaConfig config;
// nonexistent file
BOOST_CHECK_THROW(config.load("tests/unit-tests/config-files/Nonexist"), std::runtime_error);
// missing challenge
diff --git a/tests/unit-tests/protocol-detail.t.cpp b/tests/unit-tests/protocol-detail.t.cpp
index e02afaf..2461521 100644
--- a/tests/unit-tests/protocol-detail.t.cpp
+++ b/tests/unit-tests/protocol-detail.t.cpp
@@ -32,7 +32,7 @@
BOOST_AUTO_TEST_CASE(TestInfo)
{
- CaConfig config;
+ ca::CaConfig config;
config.load("tests/unit-tests/config-files/config-ca-1");
const auto& identity = addIdentity("/test");
@@ -57,7 +57,7 @@
BOOST_CHECK_EQUAL(std::get<1>(decodedParameters[0]), "zhiyi@cs.ucla.edu");
BOOST_CHECK_EQUAL(decodedParameters.size(), 1);
- CaConfig config;
+ ca::CaConfig config;
config.load("tests/unit-tests/config-files/config-ca-5");
std::vector<Name> ids;
ids.push_back(Name("/example"));
diff --git a/tests/unit-tests/requester.t.cpp b/tests/unit-tests/requester.t.cpp
index 0ab1d67..c67b8fe 100644
--- a/tests/unit-tests/requester.t.cpp
+++ b/tests/unit-tests/requester.t.cpp
@@ -74,7 +74,7 @@
availableNames.push_back(Name("/site2"));
util::DummyClientFace face(io, m_keyChain, {true, true});
- CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-5", "ca-storage-memory");
+ ca::CaModule ca(face, m_keyChain, "tests/unit-tests/config-files/config-ca-5", "ca-storage-memory");
Data reply;
reply.setName(Name("/site/CA/PROBE"));