diff --git a/tests/9_FakeManifestTest.hpp b/tests/9_FakeManifestTest.hpp index e4379cd..a95a73c 100644 --- a/tests/9_FakeManifestTest.hpp +++ b/tests/9_FakeManifestTest.hpp @@ -9,6 +9,11 @@ class FakeManifestTest : public Test { { install(get, "missingmanifest"); + if (!exists("sdroot/image.png")) { + error << "The downloaded file in package 'missingmanifest' on server 'c' did not successfully extract" << endl; + return false; + } + std::string sum = calculateMD5("sdroot/image.png").c_str(); const char * rightSum = "26a7965e5aa6acced42de92eeee76d7a"; if (rightSum != sum) { @@ -16,6 +21,13 @@ class FakeManifestTest : public Test { return false; } + // make sure the missingmanifest has "installed" state + auto missingmanifest = get->lookup("missingmanifest"); + if (!missingmanifest || missingmanifest->getStatus() != INSTALLED) { + error << "The package 'missingmanifest' on server 'c' was not installed" << endl; + return false; + } + // install one more time, and make sure we're still all good install(get, "missingmanifest"); @@ -25,6 +37,9 @@ class FakeManifestTest : public Test { return false; } + // TODO: test zip extractions with an extra folder or no folder directory + // TODO: test upgrade of fake manifest packages + return true; } }; \ No newline at end of file diff --git a/tests/server/c/zips/missingmanifest.zip b/tests/server/c/zips/missingmanifest.zip index 612d456..7939036 100644 Binary files a/tests/server/c/zips/missingmanifest.zip and b/tests/server/c/zips/missingmanifest.zip differ diff --git a/tests/test_utils.cpp b/tests/test_utils.cpp index a2f6247..a3d0d43 100644 --- a/tests/test_utils.cpp +++ b/tests/test_utils.cpp @@ -60,7 +60,9 @@ std::string calculateMD5(const char* path) char* file_buffer; file_descript = open(path, O_RDONLY); - if(file_descript < 0) exit(-1); + if(file_descript < 0) { + return ""; + } file_size = get_size_by_fd(file_descript);