update ca-profile
Change-Id: Iae0124f4ea1e366976eed307a96e3dd540a56278
diff --git a/tests/unit-tests/configuration.t.cpp b/tests/unit-tests/configuration.t.cpp
index c2f84e8..9b5c8b5 100644
--- a/tests/unit-tests/configuration.t.cpp
+++ b/tests/unit-tests/configuration.t.cpp
@@ -33,27 +33,27 @@
{
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");
- BOOST_CHECK_EQUAL(config.m_caItem.m_maxValidityPeriod, time::seconds(864000));
- BOOST_CHECK_EQUAL(*config.m_caItem.m_maxSuffixLength, 3);
- BOOST_CHECK_EQUAL(config.m_caItem.m_probeParameterKeys.size(), 1);
- BOOST_CHECK_EQUAL(config.m_caItem.m_probeParameterKeys.front(), "full name");
- BOOST_CHECK_EQUAL(config.m_caItem.m_supportedChallenges.size(), 1);
- BOOST_CHECK_EQUAL(config.m_caItem.m_supportedChallenges.front(), "pin");
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_caPrefix, "/ndn");
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_caInfo, "ndn testbed ca");
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_maxValidityPeriod, time::seconds(864000));
+ BOOST_CHECK_EQUAL(*config.m_caProfile.m_maxSuffixLength, 3);
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_probeParameterKeys.size(), 1);
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_probeParameterKeys.front(), "full name");
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_supportedChallenges.size(), 1);
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_supportedChallenges.front(), "pin");
config.load("tests/unit-tests/config-files/config-ca-2");
- BOOST_CHECK_EQUAL(config.m_caItem.m_caPrefix, "/ndn");
- BOOST_CHECK_EQUAL(config.m_caItem.m_caInfo, "missing max validity period, max suffix length, and probe");
- BOOST_CHECK_EQUAL(config.m_caItem.m_maxValidityPeriod, time::seconds(86400));
- BOOST_CHECK(!config.m_caItem.m_maxSuffixLength.has_value());
- BOOST_CHECK_EQUAL(config.m_caItem.m_probeParameterKeys.size(), 0);
- BOOST_CHECK_EQUAL(config.m_caItem.m_supportedChallenges.size(), 2);
- BOOST_CHECK_EQUAL(config.m_caItem.m_supportedChallenges.front(), "pin");
- BOOST_CHECK_EQUAL(config.m_caItem.m_supportedChallenges.back(), "email");
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_caPrefix, "/ndn");
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_caInfo, "missing max validity period, max suffix length, and probe");
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_maxValidityPeriod, time::seconds(86400));
+ BOOST_CHECK(!config.m_caProfile.m_maxSuffixLength.has_value());
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_probeParameterKeys.size(), 0);
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_supportedChallenges.size(), 2);
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_supportedChallenges.front(), "pin");
+ BOOST_CHECK_EQUAL(config.m_caProfile.m_supportedChallenges.back(), "email");
config.load("tests/unit-tests/config-files/config-ca-5");
- BOOST_CHECK_EQUAL(config.m_redirection->at(0)->getName(),
+ BOOST_CHECK_EQUAL(config.m_redirection[0]->getName(),
"/ndn/site1/KEY/%11%BC%22%F4c%15%FF%17/self/%FD%00%00%01Y%C8%14%D9%A5");
BOOST_CHECK_EQUAL(config.m_nameAssignmentFuncs.size(), 3);
BOOST_CHECK_EQUAL(config.m_nameAssignmentFuncs[0]->m_nameFormat[0], "group");
@@ -91,9 +91,9 @@
{
requester::ProfileStorage profileStorage;
profileStorage.load("tests/unit-tests/config-files/config-client-1");
- BOOST_CHECK_EQUAL(profileStorage.getCaItems().size(), 2);
+ BOOST_CHECK_EQUAL(profileStorage.getCaProfiles().size(), 2);
- auto& profile1 = profileStorage.getCaItems().front();
+ auto& profile1 = profileStorage.getCaProfiles().front();
BOOST_CHECK_EQUAL(profile1.m_caPrefix, "/ndn/edu/ucla");
BOOST_CHECK_EQUAL(profile1.m_caInfo, "ndn testbed ca");
BOOST_CHECK_EQUAL(profile1.m_maxValidityPeriod, time::seconds(864000));
@@ -103,7 +103,7 @@
BOOST_CHECK_EQUAL(profile1.m_cert->getName(),
"/ndn/site1/KEY/%11%BC%22%F4c%15%FF%17/self/%FD%00%00%01Y%C8%14%D9%A5");
- auto& profile2 = profileStorage.getCaItems().back();
+ auto& profile2 = profileStorage.getCaProfiles().back();
BOOST_CHECK_EQUAL(profile2.m_caPrefix, "/ndn/edu/ucla/zhiyi");
BOOST_CHECK_EQUAL(profile2.m_caInfo, "");
BOOST_CHECK_EQUAL(profile2.m_maxValidityPeriod, time::seconds(86400));
@@ -134,13 +134,13 @@
item.m_caInfo = "test";
profileStorage.addCaProfile(item);
- BOOST_CHECK_EQUAL(profileStorage.getCaItems().size(), 3);
- auto lastItem = profileStorage.getCaItems().back();
+ BOOST_CHECK_EQUAL(profileStorage.getCaProfiles().size(), 3);
+ auto lastItem = profileStorage.getCaProfiles().back();
BOOST_CHECK_EQUAL(lastItem.m_caPrefix, "/test");
profileStorage.removeCaProfile(Name("/test"));
- BOOST_CHECK_EQUAL(profileStorage.getCaItems().size(), 2);
- lastItem = profileStorage.getCaItems().back();
+ BOOST_CHECK_EQUAL(profileStorage.getCaProfiles().size(), 2);
+ lastItem = profileStorage.getCaProfiles().back();
BOOST_CHECK_EQUAL(lastItem.m_caPrefix, "/ndn/edu/ucla/zhiyi");
}