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

Function TEST_F

src/tests/fetcher_tests.cpp:100–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99
100TEST_F(FetcherTest, FileURI)
101{
102 string fromDir = path::join(os::getcwd(), "from");
103 ASSERT_SOME(os::mkdir(fromDir));
104 string testFile = path::join(fromDir, "test");
105 EXPECT_SOME(os::write(testFile, "data"));
106
107 string localFile = path::join(os::getcwd(), "test");
108 EXPECT_FALSE(os::exists(localFile));
109
110 slave::Flags flags = CreateSlaveFlags();
111
112 ContainerID containerId;
113 containerId.set_value(id::UUID::random().toString());
114
115 CommandInfo commandInfo;
116 CommandInfo::URI* uri = commandInfo.add_uris();
117 uri->set_value(uri::from_path(testFile));
118
119 Fetcher fetcher(flags);
120
121 Future<Nothing> fetch = fetcher.fetch(
122 containerId, commandInfo, os::getcwd(), None());
123 AWAIT_READY(fetch);
124
125 EXPECT_TRUE(os::exists(localFile));
126
127 verifyMetrics(1, 0);
128}
129
130
131// Verify that the fetcher cache correctly handles duplicates

Callers

nothing calls this directly

Calls 15

randomFunction · 0.85
from_pathFunction · 0.85
NoneClass · 0.85
getuidFunction · 0.85
chmodFunction · 0.85
testFunction · 0.85
OKClass · 0.85
failureMethod · 0.80
MetricsFunction · 0.70
fetchMethod · 0.65
joinFunction · 0.50
getcwdFunction · 0.50

Tested by

no test coverage detected