From e4f9236e27af5d1f3c84572859a08cc53cb919bb Mon Sep 17 00:00:00 2001 From: Ivan Rogach Date: Tue, 19 Nov 2024 10:50:28 +0100 Subject: [PATCH] Add tests Signed-off-by: Ivan Rogach --- tests/tests.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/tests.cpp b/tests/tests.cpp index 2e87714..b6a93e4 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -412,6 +412,18 @@ TEST_F(EvseSecurityTests, retrieve_root_ca) { ASSERT_EQ(path, retrieved_path); } +TEST_F(EvseSecurityTests, retrieve_root_location) { + std::string file_path = "certs/ca/v2g/V2G_CA_BUNDLE.pem"; + std::string retrieved_file_location = this->evse_security->get_verify_location(CaCertificateType::V2G); + + ASSERT_EQ(file_path, retrieved_file_location); + + std::string dir_path = "certs/ca/v2g/"; + std::string retrieved_dir_location = this->evse_security->get_verify_location(CaCertificateType::V2G); + + ASSERT_EQ(dir_path, retrieved_dir_location); +} + TEST_F(EvseSecurityTests, install_root_ca_01) { const auto v2g_root_ca = read_file_to_string(fs::path("certs/ca/v2g/V2G_ROOT_CA_NEW.pem")); const auto result = this->evse_security->install_ca_certificate(v2g_root_ca, CaCertificateType::V2G);