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

Function TEST_F

src/tests/fetcher_cache_tests.cpp:635–661  ·  view source on GitHub ↗

Tests fetching from the local asset directory without cache. This gives us a baseline for the following tests and lets us debug our test infrastructure without extra complications.

Source from the content-addressed store, hash-verified

633// gives us a baseline for the following tests and lets us debug our
634// test infrastructure without extra complications.
635TEST_F(FetcherCacheTest, LocalUncached)
636{
637 startSlave();
638 driver->start();
639
640 const int index = 0;
641 CommandInfo::URI uri;
642 uri.set_value(commandPath);
643 uri.set_executable(true);
644
645 CommandInfo commandInfo;
646 commandInfo.set_value("./" + COMMAND_NAME + " " + taskName(index));
647 commandInfo.add_uris()->CopyFrom(uri);
648
649 const Try<Task> task = launchTask(commandInfo, index);
650 ASSERT_SOME(task);
651
652 AWAIT_READY(awaitFinished(task.get()));
653
654 EXPECT_EQ(0u, fetcherProcess->cacheSize());
655 ASSERT_SOME(fetcherProcess->cacheFiles());
656 EXPECT_TRUE(fetcherProcess->cacheFiles()->empty());
657
658 const string path = path::join(task->runDirectory.string(), COMMAND_NAME);
659 EXPECT_TRUE(isExecutable(path));
660 EXPECT_TRUE(os::exists(path + taskName(index)));
661}
662
663
664// Tests fetching from the local asset directory with simple caching.

Callers

nothing calls this directly

Calls 15

taskNameFunction · 0.85
awaitFinishedFunction · 0.85
isExecutableFunction · 0.85
InvokeClass · 0.85
BytesClass · 0.85
CopyFromMethod · 0.80
cacheSizeMethod · 0.80
cacheFilesMethod · 0.80
actionMethod · 0.80
atMethod · 0.80
resetCountsMethod · 0.80
availableCacheSpaceMethod · 0.80

Tested by

no test coverage detected