Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.

For OTA-2712, remove test repo meta #1239

Merged
merged 1 commit into from
Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/aktualizr_repo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set(AKTUALIZR_REPO_LIBS
${AKTUALIZR_EXTERNAL_LIBS}
)
add_library(aktualizr_repo_lib ${AKTUALIZR_REPO_SRC})
target_include_directories(aktualizr_repo_lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(aktualizr-repo main.cc ${AKTUALIZR_REPO_SRC})
target_link_libraries(aktualizr-repo ${AKTUALIZR_REPO_LIBS})

Expand Down
1 change: 1 addition & 0 deletions src/aktualizr_secondary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ add_aktualizr_test(NAME aktualizr_secondary_update
if(BUILD_OSTREE)
add_aktualizr_test(NAME aktualizr_secondary_uptane
SOURCES uptane_test.cc
LIBRARIES aktualizr_repo_lib
LIBRARIES aktualizr-posix
ARGS ${PROJECT_BINARY_DIR}/ostree_repo PROJECT_WORKING_DIRECTORY)
target_link_libraries(t_aktualizr_secondary_uptane virtual_secondary)
Expand Down
3 changes: 3 additions & 0 deletions src/libaktualizr/crypto/crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ bool Crypto::RSAPSSVerify(const std::string &public_key, const std::string &sign
return status == 1;
}
bool Crypto::ED25519Verify(const std::string &public_key, const std::string &signature, const std::string &message) {
if (public_key.size() < crypto_sign_PUBLICKEYBYTES || signature.size() < crypto_sign_BYTES) {
return false;
}
return crypto_sign_verify_detached(reinterpret_cast<const unsigned char *>(signature.c_str()),
reinterpret_cast<const unsigned char *>(message.c_str()), message.size(),
reinterpret_cast<const unsigned char *>(public_key.c_str())) == 0;
Expand Down
2 changes: 1 addition & 1 deletion src/libaktualizr/package_manager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ endif(BUILD_OSTREE)

add_aktualizr_test(NAME packagemanager_factory SOURCES packagemanagerfactory_test.cc NO_VALGRIND
ARGS ${PROJECT_BINARY_DIR}/ostree_repo)
add_aktualizr_test(NAME fetcher SOURCES fetcher_test.cc ARGS PROJECT_WORKING_DIRECTORY)
add_aktualizr_test(NAME fetcher SOURCES fetcher_test.cc ARGS PROJECT_WORKING_DIRECTORY LIBRARIES PUBLIC aktualizr_repo_lib)
add_aktualizr_test(NAME fetcher_death SOURCES fetcher_death_test.cc NO_VALGRIND ARGS PROJECT_WORKING_DIRECTORY)

aktualizr_source_file_checks(fetcher_death_test.cc fetcher_test.cc)
Expand Down
10 changes: 5 additions & 5 deletions src/libaktualizr/primary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(HEADERS secondary_config.h

add_library(primary OBJECT ${SOURCES})

add_aktualizr_test(NAME aktualizr SOURCES aktualizr_test.cc PROJECT_WORKING_DIRECTORY ARGS ${PROJECT_BINARY_DIR}/uptane_repos)
add_aktualizr_test(NAME aktualizr SOURCES aktualizr_test.cc PROJECT_WORKING_DIRECTORY ARGS ${PROJECT_BINARY_DIR}/uptane_repos LIBRARIES aktualizr_repo_lib)
add_dependencies(t_aktualizr uptane_repo_full_no_correlation_id)
target_link_libraries(t_aktualizr virtual_secondary)

Expand All @@ -28,15 +28,15 @@ else (BUILD_OSTREE)
aktualizr_source_file_checks(aktualizr_fullostree_test.cc)
endif (BUILD_OSTREE)

add_aktualizr_test(NAME reportqueue SOURCES reportqueue_test.cc PROJECT_WORKING_DIRECTORY)
add_aktualizr_test(NAME reportqueue SOURCES reportqueue_test.cc PROJECT_WORKING_DIRECTORY LIBRARIES PUBLIC aktualizr_repo_lib)
add_aktualizr_test(NAME emptytargets SOURCES empty_targets_test.cc PROJECT_WORKING_DIRECTORY
ARGS "$<TARGET_FILE:aktualizr-repo>")
ARGS "$<TARGET_FILE:aktualizr-repo>" LIBRARIES aktualizr_repo_lib)
target_link_libraries(t_emptytargets virtual_secondary)

add_aktualizr_test(NAME device_cred_prov SOURCES device_cred_prov_test.cc PROJECT_WORKING_DIRECTORY)
add_aktualizr_test(NAME device_cred_prov SOURCES device_cred_prov_test.cc PROJECT_WORKING_DIRECTORY LIBRARIES PUBLIC aktualizr_repo_lib)
set_tests_properties(test_device_cred_prov PROPERTIES LABELS "crypto")

add_aktualizr_test(NAME uptane_key SOURCES uptane_key_test.cc PROJECT_WORKING_DIRECTORY)
add_aktualizr_test(NAME uptane_key SOURCES uptane_key_test.cc PROJECT_WORKING_DIRECTORY LIBRARIES aktualizr_repo_lib)
set_tests_properties(test_uptane_key PROPERTIES LABELS "crypto")
target_include_directories(t_uptane_key PUBLIC ${PROJECT_SOURCE_DIR}/src/virtual_secondary)
target_link_libraries(t_uptane_key virtual_secondary)
Expand Down
69 changes: 41 additions & 28 deletions src/libaktualizr/primary/aktualizr_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "utilities/fault_injection.h"

boost::filesystem::path uptane_repos_dir;
boost::filesystem::path fake_meta_dir;

void verifyNothingInstalled(const Json::Value& manifest) {
// Verify nothing has installed for the primary.
Expand Down Expand Up @@ -101,7 +102,7 @@ void process_events_FullNoUpdates(const std::shared_ptr<event::BaseEvent>& event
TEST(Aktualizr, FullNoUpdates) {
future_FullNoUpdates = promise_FullNoUpdates.get_future();
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "noupdates");
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "noupdates", fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);

auto storage = INvStorage::newStorage(conf.storage);
Expand All @@ -128,7 +129,7 @@ TEST(Aktualizr, FullNoUpdates) {
*/
TEST(Aktualizr, AddSecondary) {
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "noupdates");
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "noupdates", fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);

auto storage = INvStorage::newStorage(conf.storage);
Expand Down Expand Up @@ -165,7 +166,7 @@ TEST(Aktualizr, AddSecondary) {
*/
TEST(Aktualizr, DeviceInstallationResult) {
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFake>(temp_dir.Path());
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "", fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);

auto storage = INvStorage::newStorage(conf.storage);
Expand Down Expand Up @@ -206,7 +207,8 @@ TEST(Aktualizr, DeviceInstallationResult) {

class HttpFakeEventCounter : public HttpFake {
public:
HttpFakeEventCounter(const boost::filesystem::path& test_dir_in) : HttpFake(test_dir_in, "hasupdates") {}
HttpFakeEventCounter(const boost::filesystem::path& test_dir_in, const boost::filesystem::path& meta_dir_in)
: HttpFake(test_dir_in, "hasupdates", meta_dir_in) {}

HttpResponse handle_event(const std::string& url, const Json::Value& data) override {
(void)url;
Expand Down Expand Up @@ -336,7 +338,7 @@ void process_events_FullWithUpdates(const std::shared_ptr<event::BaseEvent>& eve
TEST(Aktualizr, FullWithUpdates) {
future_FullWithUpdates = promise_FullWithUpdates.get_future();
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFakeEventCounter>(temp_dir.Path());
auto http = std::make_shared<HttpFakeEventCounter>(temp_dir.Path(), fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);

auto storage = INvStorage::newStorage(conf.storage);
Expand All @@ -356,7 +358,8 @@ TEST(Aktualizr, FullWithUpdates) {

class HttpFakePutCounter : public HttpFake {
public:
HttpFakePutCounter(const boost::filesystem::path& test_dir_in) : HttpFake(test_dir_in, "hasupdates") {}
HttpFakePutCounter(const boost::filesystem::path& test_dir_in, const boost::filesystem::path& meta_dir_in)
: HttpFake(test_dir_in, "hasupdates", meta_dir_in) {}

HttpResponse put(const std::string& url, const Json::Value& data) override {
if (url.find("/manifest") != std::string::npos) {
Expand Down Expand Up @@ -407,7 +410,7 @@ class HttpFakePutCounter : public HttpFake {
*/
TEST(Aktualizr, FullWithUpdatesNeedReboot) {
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFakePutCounter>(temp_dir.Path());
auto http = std::make_shared<HttpFakePutCounter>(temp_dir.Path(), fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);
conf.pacman.fake_need_reboot = true;

Expand Down Expand Up @@ -496,7 +499,8 @@ TEST(Aktualizr, FullWithUpdatesNeedReboot) {

class HttpInstallationFailed : public HttpFake {
public:
HttpInstallationFailed(const boost::filesystem::path& test_dir_in) : HttpFake(test_dir_in, "hasupdates") {}
HttpInstallationFailed(const boost::filesystem::path& test_dir_in, const boost::filesystem::path& meta_dir_in)
: HttpFake(test_dir_in, "hasupdates", meta_dir_in) {}

HttpResponse handle_event(const std::string& url, const Json::Value& data) override {
(void)url;
Expand Down Expand Up @@ -594,7 +598,7 @@ class EventHandler {
*/
TEST(Aktualizr, FinalizationFailure) {
TemporaryDirectory temp_dir;
auto http_server_mock = std::make_shared<HttpInstallationFailed>(temp_dir.Path());
auto http_server_mock = std::make_shared<HttpInstallationFailed>(temp_dir.Path(), fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http_server_mock->tls_server);
conf.pacman.fake_need_reboot = true;
conf.uptane.force_install_completion = true;
Expand Down Expand Up @@ -775,7 +779,7 @@ TEST(Aktualizr, InstallationFailure) {

{
TemporaryDirectory temp_dir;
auto http_server_mock = std::make_shared<HttpInstallationFailed>(temp_dir.Path());
auto http_server_mock = std::make_shared<HttpInstallationFailed>(temp_dir.Path(), fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http_server_mock->tls_server);
auto storage = INvStorage::newStorage(conf.storage);

Expand Down Expand Up @@ -834,7 +838,7 @@ TEST(Aktualizr, InstallationFailure) {
// primary and secondary failure
{
TemporaryDirectory temp_dir;
auto http_server_mock = std::make_shared<HttpInstallationFailed>(temp_dir.Path());
auto http_server_mock = std::make_shared<HttpInstallationFailed>(temp_dir.Path(), fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http_server_mock->tls_server);
auto storage = INvStorage::newStorage(conf.storage);
const std::string sec_fault_name = std::string("secondary_install_") + secondary_ecu_id;
Expand Down Expand Up @@ -916,7 +920,7 @@ TEST(Aktualizr, InstallationFailure) {
*/
TEST(Aktualizr, AutoRebootAfterUpdate) {
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFakePutCounter>(temp_dir.Path());
auto http = std::make_shared<HttpFakePutCounter>(temp_dir.Path(), fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);
conf.pacman.fake_need_reboot = true;
conf.uptane.force_install_completion = true;
Expand Down Expand Up @@ -989,7 +993,7 @@ void process_events_FullMultipleSecondaries(const std::shared_ptr<event::BaseEve
TEST(Aktualizr, FullMultipleSecondaries) {
future_FullMultipleSecondaries = promise_FullMultipleSecondaries.get_future();
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "multisec");
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "multisec", fake_meta_dir);
Config conf("tests/config/basic.toml");
conf.provision.primary_ecu_serial = "testecuserial";
conf.provision.primary_ecu_hardware_id = "testecuhwid";
Expand Down Expand Up @@ -1082,7 +1086,7 @@ void process_events_CheckNoUpdates(const std::shared_ptr<event::BaseEvent>& even
TEST(Aktualizr, CheckNoUpdates) {
future_CheckNoUpdates = promise_CheckNoUpdates.get_future();
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "noupdates");
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "noupdates", fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);

auto storage = INvStorage::newStorage(conf.storage);
Expand Down Expand Up @@ -1176,7 +1180,7 @@ void process_events_DownloadWithUpdates(const std::shared_ptr<event::BaseEvent>&
TEST(Aktualizr, DownloadWithUpdates) {
future_DownloadWithUpdates = promise_DownloadWithUpdates.get_future();
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "hasupdates");
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "hasupdates", fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);

auto storage = INvStorage::newStorage(conf.storage);
Expand Down Expand Up @@ -1205,8 +1209,9 @@ class HttpDownloadFailure : public HttpFake {
using Responses = std::vector<std::pair<std::string, HttpResponse>>;

public:
HttpDownloadFailure(const boost::filesystem::path& test_dir_in, const Responses& file_to_response, std::string flavor)
: HttpFake(test_dir_in, flavor) {
HttpDownloadFailure(const boost::filesystem::path& test_dir_in, const Responses& file_to_response, std::string flavor,
const boost::filesystem::path& meta_dir_in)
: HttpFake(test_dir_in, flavor, meta_dir_in) {
for (auto resp : file_to_response) {
url_to_response_[tls_server + target_dir_ + resp.first] = resp.second;
}
Expand Down Expand Up @@ -1296,7 +1301,8 @@ TEST(Aktualizr, DownloadFailures) {
for (auto test_params : test_case_params) {
TemporaryDirectory temp_dir;

auto http = std::make_shared<HttpDownloadFailure>(temp_dir.Path(), test_params.downloadResponse, "hasupdates");
auto http = std::make_shared<HttpDownloadFailure>(temp_dir.Path(), test_params.downloadResponse, "hasupdates",
fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);
auto storage = INvStorage::newStorage(conf.storage);

Expand Down Expand Up @@ -1425,7 +1431,7 @@ void process_events_InstallWithUpdates(const std::shared_ptr<event::BaseEvent>&
TEST(Aktualizr, InstallWithUpdates) {
future_InstallWithUpdates = promise_InstallWithUpdates.get_future();
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "hasupdates");
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "hasupdates", fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);

auto storage = INvStorage::newStorage(conf.storage);
Expand Down Expand Up @@ -1486,7 +1492,7 @@ TEST(Aktualizr, ReportDownloadProgress) {
// The test initialization part is repeated in many tests so maybe it makes sense
// to define a fixture and move this common initialization part into the fixture's SetUp() method
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "hasupdates");
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "hasupdates", fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);
auto storage = INvStorage::newStorage(conf.storage);
UptaneTestCommon::TestAktualizr aktualizr(conf, storage, http);
Expand Down Expand Up @@ -1531,7 +1537,8 @@ TEST(Aktualizr, ReportDownloadProgress) {

class HttpFakeCampaign : public HttpFake {
public:
HttpFakeCampaign(const boost::filesystem::path& test_dir_in) : HttpFake(test_dir_in) {}
HttpFakeCampaign(const boost::filesystem::path& test_dir_in, const boost::filesystem::path& meta_dir_in)
: HttpFake(test_dir_in, "", meta_dir_in) {}

HttpResponse get(const std::string& url, int64_t maxsize) override {
EXPECT_NE(url.find("campaigner/"), std::string::npos);
Expand Down Expand Up @@ -1602,7 +1609,7 @@ class CampaignEvents {
*/
TEST(Aktualizr, CampaignCheckAndControl) {
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFakeCampaign>(temp_dir.Path());
auto http = std::make_shared<HttpFakeCampaign>(temp_dir.Path(), fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);

CampaignEvents campaign_events;
Expand Down Expand Up @@ -1685,7 +1692,7 @@ TEST(Aktualizr, FullNoCorrelationId) {

TEST(Aktualizr, ManifestCustom) {
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFake>(temp_dir.Path());
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "", fake_meta_dir);

{
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);
Expand Down Expand Up @@ -1732,7 +1739,7 @@ class CountUpdateCheckEvents {

TEST(Aktualizr, APICheck) {
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "hasupdates");
auto http = std::make_shared<HttpFake>(temp_dir.Path(), "hasupdates", fake_meta_dir);

Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);

Expand Down Expand Up @@ -1774,7 +1781,8 @@ TEST(Aktualizr, APICheck) {

class HttpPutManifestFail : public HttpFake {
public:
HttpPutManifestFail(const boost::filesystem::path& test_dir_in) : HttpFake(test_dir_in) {}
HttpPutManifestFail(const boost::filesystem::path& test_dir_in, const boost::filesystem::path& meta_dir_in)
: HttpFake(test_dir_in, "", meta_dir_in) {}
HttpResponse put(const std::string& url, const Json::Value& data) override {
(void)data;
return HttpResponse(url, 504, CURLE_OK, "");
Expand All @@ -1784,7 +1792,7 @@ class HttpPutManifestFail : public HttpFake {
/* Send UpdateCheckComplete event after failure */
TEST(Aktualizr, UpdateCheckCompleteError) {
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpPutManifestFail>(temp_dir.Path());
auto http = std::make_shared<HttpPutManifestFail>(temp_dir.Path(), fake_meta_dir);

Config conf = UptaneTestCommon::makeTestConfig(temp_dir, "http://updatefail");

Expand All @@ -1806,7 +1814,8 @@ TEST(Aktualizr, UpdateCheckCompleteError) {

class HttpFakePauseCounter : public HttpFake {
public:
HttpFakePauseCounter(const boost::filesystem::path& test_dir_in) : HttpFake(test_dir_in, "noupdates") {}
HttpFakePauseCounter(const boost::filesystem::path& test_dir_in, const boost::filesystem::path& meta_dir_in)
: HttpFake(test_dir_in, "noupdates", meta_dir_in) {}

HttpResponse handle_event(const std::string& url, const Json::Value& data) override {
(void)url;
Expand Down Expand Up @@ -1834,7 +1843,7 @@ class HttpFakePauseCounter : public HttpFake {

TEST(Aktualizr, PauseResumeQueue) {
TemporaryDirectory temp_dir;
auto http = std::make_shared<HttpFakePauseCounter>(temp_dir.Path());
auto http = std::make_shared<HttpFakePauseCounter>(temp_dir.Path(), fake_meta_dir);
Config conf = UptaneTestCommon::makeTestConfig(temp_dir, http->tls_server);

auto storage = INvStorage::newStorage(conf.storage);
Expand Down Expand Up @@ -1909,6 +1918,10 @@ int main(int argc, char** argv) {
logger_init();
logger_set_threshold(boost::log::trivial::trace);

TemporaryDirectory tmp_dir;
fake_meta_dir = tmp_dir.Path();
MetaFake meta_fake(fake_meta_dir);

return RUN_ALL_TESTS();
}
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/libaktualizr/uptane/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ else(BUILD_OSTREE AND SOTA_PACKED_CREDENTIALS)
endif(BUILD_OSTREE AND SOTA_PACKED_CREDENTIALS)


add_aktualizr_test(NAME uptane SOURCES uptane_test.cc PROJECT_WORKING_DIRECTORY)
add_aktualizr_test(NAME uptane SOURCES uptane_test.cc PROJECT_WORKING_DIRECTORY LIBRARIES aktualizr_repo_lib)
set_tests_properties(test_uptane PROPERTIES LABELS "crypto")
target_link_libraries(t_uptane virtual_secondary)

add_aktualizr_test(NAME uptane_delegation SOURCES uptane_delegation_test.cc PROJECT_WORKING_DIRECTORY
ARGS "$<TARGET_FILE:aktualizr-repo>")
ARGS "$<TARGET_FILE:aktualizr-repo>" LIBRARIES aktualizr_repo_lib)
add_dependencies(t_uptane_delegation aktualizr-repo)
target_link_libraries(t_uptane_delegation virtual_secondary)
set_tests_properties(test_uptane_delegation PROPERTIES LABELS "crypto")
Expand All @@ -55,10 +55,10 @@ set_tests_properties(test_uptane_network PROPERTIES LABELS "crypto")
target_link_libraries(t_uptane_network virtual_secondary)

add_aktualizr_test(NAME uptane_serial SOURCES uptane_serial_test.cc ARGS ${PROJECT_BINARY_DIR}
PROJECT_WORKING_DIRECTORY)
PROJECT_WORKING_DIRECTORY LIBRARIES aktualizr_repo_lib)
target_link_libraries(t_uptane_serial virtual_secondary)

add_aktualizr_test(NAME uptane_init SOURCES uptane_init_test.cc PROJECT_WORKING_DIRECTORY)
add_aktualizr_test(NAME uptane_init SOURCES uptane_init_test.cc PROJECT_WORKING_DIRECTORY LIBRARIES PUBLIC aktualizr_repo_lib)

add_aktualizr_test(NAME director SOURCES director_test.cc PROJECT_WORKING_DIRECTORY
ARGS "$<TARGET_FILE:aktualizr-repo>")
Expand Down
4 changes: 2 additions & 2 deletions src/virtual_secondary/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ add_library(${TARGET} STATIC
${SOURCES}
)

target_include_directories(${TARGET} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(${TARGET} PUBLIC ${PROJECT_SOURCE_DIR}/src/virtual_secondary)

add_aktualizr_test(NAME virtual_secondary SOURCES virtual_secondary_test.cc PROJECT_WORKING_DIRECTORY)
add_aktualizr_test(NAME virtual_secondary SOURCES virtual_secondary_test.cc PROJECT_WORKING_DIRECTORY LIBRARIES aktualizr_repo_lib)
target_link_libraries(t_virtual_secondary virtual_secondary)

aktualizr_source_file_checks(${HEADERS} ${SOURCES} ${TEST_SOURCES})
Loading