MCPcopy Create free account
hub / github.com/apache/mesos / setupArchiveAsset

Method setupArchiveAsset

src/tests/fetcher_cache_tests.cpp:360–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358
359
360void FetcherCacheTest::setupArchiveAsset()
361{
362 string path = path::join(assetsDirectory, ARCHIVED_COMMAND_NAME);
363 ASSERT_SOME(os::write(path, ARCHIVED_COMMAND_SCRIPT));
364
365 // Make the archived command file executable before archiving it,
366 // since the executable flag for CommandInfo::URI has no effect on
367 // what comes out of an archive.
368 ASSERT_SOME(os::chmod(path, S_IRWXU | S_IRWXG | S_IRWXO));
369
370 const string cwd = os::getcwd();
371 ASSERT_SOME(os::chdir(assetsDirectory));
372 // Create an uncompressed archive (see MESOS-3579).
373 ASSERT_SOME(os::shell(
374 "tar cf '" + ARCHIVE_NAME + "' '" + ARCHIVED_COMMAND_NAME + "' 2>&1"));
375 ASSERT_SOME(os::chdir(cwd));
376 archivePath = path::join(assetsDirectory, ARCHIVE_NAME);
377
378 // Make the archive file read-only, so we can tell if it becomes
379 // executable by accident.
380 ASSERT_SOME(os::chmod(archivePath, S_IRUSR | S_IRGRP | S_IROTH));
381}
382
383
384static string taskName(int taskIndex)

Callers

nothing calls this directly

Calls 6

chmodFunction · 0.85
joinFunction · 0.50
writeFunction · 0.50
getcwdFunction · 0.50
chdirFunction · 0.50
shellFunction · 0.50

Tested by

no test coverage detected