security: Construct KeyChain from configuration file.
Change-Id: Iaddac24e2c4e199fdde83fa1d0067a87e18729c4
Refs: #1532
diff --git a/tests/util/test-io.cpp b/tests/util/test-io.cpp
index ffb9c61..38f3ca1 100644
--- a/tests/util/test-io.cpp
+++ b/tests/util/test-io.cpp
@@ -21,15 +21,16 @@
BOOST_AUTO_TEST_CASE(Basic)
{
- KeyChainImpl<SecPublicInfoSqlite3, SecTpmFile> keychain;
+ BOOST_REQUIRE_NO_THROW(KeyChain("sqlite3", "file"));
+ KeyChain keyChain("sqlite3", "file");
Name identity("/TestIO/Basic");
identity.appendVersion();
Name certName;
- BOOST_REQUIRE_NO_THROW(certName = keychain.createIdentity(identity));
+ BOOST_REQUIRE_NO_THROW(certName = keyChain.createIdentity(identity));
shared_ptr<IdentityCertificate> idCert;
- BOOST_REQUIRE_NO_THROW(idCert = keychain.getCertificate(certName));
+ BOOST_REQUIRE_NO_THROW(idCert = keyChain.getCertificate(certName));
std::string file("/tmp/TestIO-Basic");
io::save(*idCert, file);
@@ -37,7 +38,7 @@
BOOST_CHECK(static_cast<bool>(readCert));
BOOST_CHECK(idCert->getName() == readCert->getName());
- keychain.deleteIdentity(identity);
+ keyChain.deleteIdentity(identity);
}
BOOST_AUTO_TEST_SUITE_END()