X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Ftest_db_crypto.cpp;h=a4934484ffc7ddc564d7946d68bcfdb7bab0a47a;hb=60a4223c6d9ebeeb9173f4225f364d3c6df2bd99;hp=9946a34589870b99ef33b0a55f3fe89b22ec2ce6;hpb=62261f24512d706677aec547752740f77729ec72;p=platform%2Fcore%2Fsecurity%2Fkey-manager.git diff --git a/tests/test_db_crypto.cpp b/tests/test_db_crypto.cpp index 9946a34..a493448 100644 --- a/tests/test_db_crypto.cpp +++ b/tests/test_db_crypto.cpp @@ -19,6 +19,7 @@ const unsigned int c_test_retries = 1000; const unsigned int c_num_names = 500; const unsigned int c_num_names_add_test = 5000; const unsigned int c_names_per_label = 15; + } // namespace anonymous BOOST_FIXTURE_TEST_SUITE(DBCRYPTO_TEST, DBFixture) @@ -65,6 +66,22 @@ BOOST_AUTO_TEST_CASE(DBtestTransaction) { BOOST_CHECK_MESSAGE(!row_optional, "Row still present after rollback"); } +BOOST_AUTO_TEST_CASE(DBtestBackend) { + DB::Row rowPattern = create_default_row(); + rowPattern.data = RawBuffer(32, 1); + rowPattern.dataSize = rowPattern.data.size(); + rowPattern.tag = RawBuffer(AES_GCM_TAG_SIZE, 1); + + rowPattern.backendId = CryptoBackend::OpenSSL; + check_DB_integrity(rowPattern); + + rowPattern.backendId = CryptoBackend::TrustZone; + check_DB_integrity(rowPattern); + + rowPattern.backendId = CryptoBackend::None; + check_DB_integrity(rowPattern); +} + BOOST_AUTO_TEST_SUITE_END() @@ -247,6 +264,7 @@ void verifyDBisValid(DBFixture & fixture) ret_list.clear(); } } + struct DBVer1Migration : public DBFixture { DBVer1Migration() : DBFixture("/usr/share/ckm-db-test/testme_ver1.db") @@ -258,6 +276,12 @@ struct DBVer2Migration : public DBFixture DBVer2Migration() : DBFixture("/usr/share/ckm-db-test/testme_ver2.db") {} }; + +struct DBVer3Migration : public DBFixture +{ + DBVer3Migration() : DBFixture("/usr/share/ckm-db-test/testme_ver3.db") + {} +}; } BOOST_AUTO_TEST_CASE(DBMigrationDBVer1) @@ -272,6 +296,12 @@ BOOST_AUTO_TEST_CASE(DBMigrationDBVer2) verifyDBisValid(DBver2); } +BOOST_AUTO_TEST_CASE(DBMigrationDBVer3) +{ + DBVer3Migration DBver3; + verifyDBisValid(DBver3); +} + BOOST_AUTO_TEST_CASE(DBMigrationDBCurrent) { DBFixture currentDB;