validator-config: use cert file name for groupId

refs #5136

Change-Id: I0a737593e11eddcd372c3c6d3cb742dd2a0a9cab
This commit is contained in:
Varun Patil committed 2020-11-27 08:29:34 +05:30
1 parent 20d264e148
commit 574c3f96f8
2 files changed
+37 -1

No files matched your search

@@ -135,7 +135,7 @@ ValidationPolicyConfig::processConfigTrustAnchor(const ConfigSection& configSect
if (propertyIt != configSection.end())
NDN_THROW(Error("Expecting end of <trust-anchor>"));
m_validator->loadAnchor(filename, absolute(file, path(filename).parent_path()).string(),
m_validator->loadAnchor(file, absolute(file, path(filename).parent_path()).string(),
refresh, false);
}
else if (boost::iequals(type, "base64")) {
@@ -177,6 +177,40 @@ public:
}
};
template<typename PacketType>
class LoadFileWithMultipleFileAnchors : public ValidationPolicyConfigFixture<PacketType>
{
public:
LoadFileWithMultipleFileAnchors()
{
std::string configFile = (this->path / "config.conf").string();
{
std::ofstream config(configFile);
config << this->baseConfig << R"CONF(
trust-anchor
{
type file
file-name "identity.ndncert"
}
trust-anchor
{
type file
file-name "trust-anchor.ndncert"
}
)CONF";
}
this->saveIdentityCert(this->identity, (this->path / "identity.ndncert").string());
BOOST_CHECK_EQUAL(this->policy.m_isConfigured, false);
this->policy.load(configFile);
BOOST_CHECK_EQUAL(this->policy.m_isConfigured, true);
BOOST_CHECK_EQUAL(this->policy.m_shouldBypass, false);
}
};
template<typename PacketType>
class LoadSectionWithFileAnchor : public ValidationPolicyConfigFixture<PacketType>
{
@@ -315,6 +349,7 @@ public:
using DataPolicies = boost::mpl::vector<LoadStringWithFileAnchor<Data>,
LoadFileWithFileAnchor<Data>,
LoadFileWithMultipleFileAnchors<Data>,
LoadSectionWithFileAnchor<Data>,
LoadStringWithBase64Anchor<Data>,
LoadStringWithDirAnchor<Data>,
@@ -325,6 +360,7 @@ using DataPolicies = boost::mpl::vector<LoadStringWithFileAnchor<Data>,
using InterestPolicies = boost::mpl::vector<LoadStringWithFileAnchor<Interest>,
LoadFileWithFileAnchor<Interest>,
LoadFileWithMultipleFileAnchors<Interest>,
LoadSectionWithFileAnchor<Interest>,
LoadStringWithBase64Anchor<Interest>,
LoadStringWithDirAnchor<Interest>,