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

Function TEST_F

src/tests/containerizer/docker_volume_isolator_tests.cpp:231–384  ·  view source on GitHub ↗

This test verifies that multiple docker volumes with both absolute path and relative path are properly mounted to a container without rootfs, and launches a command task that reads files from the mounted docker volumes.

Source from the content-addressed store, hash-verified

229// rootfs, and launches a command task that reads files from the
230// mounted docker volumes.
231TEST_F(DockerVolumeIsolatorTest, ROOT_CommandTaskNoRootfsWithVolumes)
232{
233 Try<Owned<cluster::Master>> master = StartMaster();
234 ASSERT_SOME(master);
235
236 slave::Flags flags = CreateSlaveFlags();
237
238 MockDockerVolumeDriverClient* mockClient = new MockDockerVolumeDriverClient;
239
240 Try<Owned<MesosContainerizer>> containerizer =
241 createContainerizer(flags, Owned<DriverClient>(mockClient));
242
243 ASSERT_SOME(containerizer);
244
245 Owned<MasterDetector> detector = master.get()->createDetector();
246
247 Try<Owned<cluster::Slave>> slave = StartSlave(
248 detector.get(),
249 containerizer->get(),
250 flags);
251
252 ASSERT_SOME(slave);
253
254 MockScheduler sched;
255
256 MesosSchedulerDriver driver(
257 &sched,
258 DEFAULT_FRAMEWORK_INFO,
259 master.get()->pid,
260 DEFAULT_CREDENTIAL);
261
262 Future<FrameworkID> frameworkId;
263 EXPECT_CALL(sched, registered(&driver, _, _))
264 .WillOnce(FutureArg<1>(&frameworkId));
265
266 Future<vector<Offer>> offers;
267 EXPECT_CALL(sched, resourceOffers(&driver, _))
268 .WillOnce(FutureArg<1>(&offers))
269 .WillRepeatedly(Return()); // Ignore subsequent offers.
270
271 driver.start();
272
273 AWAIT_READY(frameworkId);
274
275 AWAIT_READY(offers);
276 ASSERT_FALSE(offers->empty());
277
278 const Offer& offer = offers.get()[0];
279
280 const string key = "iops";
281 const string value = "150";
282
283 hashmap<string, string> options = {{key, value}};
284
285 // Create a volume with relative path.
286 const string driver1 = "driver1";
287 const string name1 = "name1";
288 const string containerPath1 = "tmp/foo1";

Callers

nothing calls this directly

Calls 15

touchFunction · 0.85
NothingClass · 0.85
FailureClass · 0.85
createDetectorMethod · 0.80
CopyFromMethod · 0.80
startMethod · 0.65
launchTasksMethod · 0.65
stopMethod · 0.65
joinMethod · 0.65
killTaskMethod · 0.65
joinFunction · 0.50
getcwdFunction · 0.50

Tested by

no test coverage detected