Add a basic test for blaze archive extraction.
Blaze expects all extracted archive files to have an `mtime` of > 9 years in the future - see `blaze_util::IFileMtime::IsUntampered`.
The new test checks that archives passed to `ExtractArchiveOrDie` and `BlessFiles` are extracted and that `mtime` adheres to this requirement.
Also moved `BlessFiles` to `archive_utils`.
PiperOrigin-RevId: 534233490
Change-Id: I03ef4277e6cfe58112d5cc8b0d929e161f778133
diff --git a/src/main/cpp/archive_utils.h b/src/main/cpp/archive_utils.h
index f970080..e74ae67 100644
--- a/src/main/cpp/archive_utils.h
+++ b/src/main/cpp/archive_utils.h
@@ -35,6 +35,13 @@
const std::string &expected_install_md5,
const std::string &output_dir);
+// Sets the timestamps of the extracted files to the future via
+// blaze_util::IFileMtime::SetToDistanceFuture and ensures that the files we
+// have written are actually on the disk. Later, the blaze client calls
+// blaze_util::IFileMtime::IsUntampered to ensure the files were "blessed" with
+// these distant mtimes.
+void BlessFiles(const std::string &embedded_binaries);
+
// Retrieves the build label (version string) from `archive_path` into
// `build_label`.
void ExtractBuildLabel(const std::string &archive_path,