summaryrefslogtreecommitdiff
path: root/test/buildtool/execution_api/local/local_storage.test.cpp
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2023-01-24 12:41:23 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2023-01-24 18:06:22 +0100
commit0026331ce0177bd3f902628aadcd1a84f3e2547d (patch)
tree328591a6214723d785c8348ed7d5216d020beba7 /test/buildtool/execution_api/local/local_storage.test.cpp
parentde17042b3c3296e0605f73df771111c6af49ca61 (diff)
downloadjustbuild-0026331ce0177bd3f902628aadcd1a84f3e2547d.tar.gz
FileSystemManager: Do not follow symlinks
... and ensure that cascades of checks are performed with only a single filesystem stat per method.
Diffstat (limited to 'test/buildtool/execution_api/local/local_storage.test.cpp')
-rw-r--r--test/buildtool/execution_api/local/local_storage.test.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/test/buildtool/execution_api/local/local_storage.test.cpp b/test/buildtool/execution_api/local/local_storage.test.cpp
index b85fc24d..ff2493ae 100644
--- a/test/buildtool/execution_api/local/local_storage.test.cpp
+++ b/test/buildtool/execution_api/local/local_storage.test.cpp
@@ -40,13 +40,13 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
auto file_path = storage.BlobPath(test_digest, false);
REQUIRE(file_path);
CHECK(FileSystemManager::IsFile(*file_path));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
auto exe_path = storage.BlobPath(test_digest, true);
REQUIRE(exe_path);
CHECK(FileSystemManager::IsFile(*exe_path));
- CHECK(FileSystemManager::IsExecutable(*exe_path, true));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(FileSystemManager::IsExecutable(*exe_path));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
}
SECTION("Add executable blob to storage") {
@@ -55,13 +55,13 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
auto file_path = storage.BlobPath(test_digest, false);
REQUIRE(file_path);
CHECK(FileSystemManager::IsFile(*file_path));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
auto exe_path = storage.BlobPath(test_digest, true);
REQUIRE(exe_path);
CHECK(FileSystemManager::IsFile(*exe_path));
- CHECK(FileSystemManager::IsExecutable(*exe_path, true));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(FileSystemManager::IsExecutable(*exe_path));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
}
}
@@ -89,13 +89,13 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
auto file_path = storage.BlobPath(test_blob->digest, false);
REQUIRE(file_path);
CHECK(FileSystemManager::IsFile(*file_path));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
auto exe_path = storage.BlobPath(test_blob->digest, true);
REQUIRE(exe_path);
CHECK(FileSystemManager::IsFile(*exe_path));
- CHECK(FileSystemManager::IsExecutable(*exe_path, true));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(FileSystemManager::IsExecutable(*exe_path));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
}
SECTION("Add non-executable blob to storage") {
@@ -104,13 +104,13 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
auto file_path = storage.BlobPath(test_blob->digest, false);
REQUIRE(file_path);
CHECK(FileSystemManager::IsFile(*file_path));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
auto exe_path = storage.BlobPath(test_blob->digest, true);
REQUIRE(exe_path);
CHECK(FileSystemManager::IsFile(*exe_path));
- CHECK(FileSystemManager::IsExecutable(*exe_path, true));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(FileSystemManager::IsExecutable(*exe_path));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
}
SECTION("Add executable blob to storage") {
@@ -119,13 +119,13 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
auto file_path = storage.BlobPath(test_blob->digest, false);
REQUIRE(file_path);
CHECK(FileSystemManager::IsFile(*file_path));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
auto exe_path = storage.BlobPath(test_blob->digest, true);
REQUIRE(exe_path);
CHECK(FileSystemManager::IsFile(*exe_path));
- CHECK(FileSystemManager::IsExecutable(*exe_path, true));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(FileSystemManager::IsExecutable(*exe_path));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
}
}
@@ -153,13 +153,13 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
auto file_path = storage.BlobPath(test_blob->digest, false);
REQUIRE(file_path);
CHECK(FileSystemManager::IsFile(*file_path));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
auto exe_path = storage.BlobPath(test_blob->digest, true);
REQUIRE(exe_path);
CHECK(FileSystemManager::IsFile(*exe_path));
- CHECK(FileSystemManager::IsExecutable(*exe_path, true));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(FileSystemManager::IsExecutable(*exe_path));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
}
SECTION("Add non-executable blob to storage") {
@@ -168,13 +168,13 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
auto file_path = storage.BlobPath(test_blob->digest, false);
REQUIRE(file_path);
CHECK(FileSystemManager::IsFile(*file_path));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
auto exe_path = storage.BlobPath(test_blob->digest, true);
REQUIRE(exe_path);
CHECK(FileSystemManager::IsFile(*exe_path));
- CHECK(FileSystemManager::IsExecutable(*exe_path, true));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(FileSystemManager::IsExecutable(*exe_path));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
}
SECTION("Add executable blob to storage") {
@@ -183,12 +183,12 @@ TEST_CASE_METHOD(HermeticLocalTestFixture,
auto file_path = storage.BlobPath(test_blob->digest, false);
REQUIRE(file_path);
CHECK(FileSystemManager::IsFile(*file_path));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
auto exe_path = storage.BlobPath(test_blob->digest, true);
REQUIRE(exe_path);
CHECK(FileSystemManager::IsFile(*exe_path));
- CHECK(FileSystemManager::IsExecutable(*exe_path, true));
- CHECK(not FileSystemManager::IsExecutable(*file_path, true));
+ CHECK(FileSystemManager::IsExecutable(*exe_path));
+ CHECK(not FileSystemManager::IsExecutable(*file_path));
}
}