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

Function TEST_F

src/tests/containerizer/linux_filesystem_isolator_tests.cpp:105–146  ·  view source on GitHub ↗

This test verifies that the root filesystem of the container is properly changed to the one that's provisioned by the provisioner.

Source from the content-addressed store, hash-verified

103// This test verifies that the root filesystem of the container is
104// properly changed to the one that's provisioned by the provisioner.
105TEST_F(LinuxFilesystemIsolatorTest, ROOT_ChangeRootFilesystem)
106{
107 AWAIT_READY(DockerArchive::create(GetRegistryPath(), "test_image"));
108
109 slave::Flags flags = CreateSlaveFlags();
110
111 Fetcher fetcher(flags);
112
113 Try<MesosContainerizer*> create =
114 MesosContainerizer::create(flags, true, &fetcher);
115
116 ASSERT_SOME(create);
117
118 Owned<Containerizer> containerizer(create.get());
119
120 ContainerID containerId;
121 containerId.set_value(id::UUID::random().toString());
122
123 ExecutorInfo executor = createExecutorInfo(
124 "test_executor",
125 "[ ! -d '" + sandbox.get() + "' ]");
126
127 executor.mutable_container()->CopyFrom(createContainerInfo("test_image"));
128
129 string directory = path::join(flags.work_dir, "sandbox");
130 ASSERT_SOME(os::mkdir(directory));
131
132 Future<Containerizer::LaunchResult> launch = containerizer->launch(
133 containerId,
134 createContainerConfig(None(), executor, directory),
135 map<string, string>(),
136 None());
137
138 AWAIT_ASSERT_EQ(Containerizer::LaunchResult::SUCCESS, launch);
139
140 Future<Option<ContainerTermination>> wait = containerizer->wait(containerId);
141
142 AWAIT_READY(wait);
143 ASSERT_SOME(wait.get());
144 ASSERT_TRUE(wait->get().has_status());
145 EXPECT_WEXITSTATUS_EQ(0, wait->get().status());
146}
147
148
149// This test verifies that pseudo devices like /dev/random are properly mounted

Callers

nothing calls this directly

Calls 15

randomFunction · 0.85
createExecutorInfoFunction · 0.85
createContainerInfoFunction · 0.85
createContainerConfigFunction · 0.85
NoneClass · 0.85
createPersistentVolumeFunction · 0.85
MegabytesFunction · 0.85
getPersistentVolumePathFunction · 0.85
createVolumeSandboxPathFunction · 0.85
touchFunction · 0.85
createVolumeHostPathFunction · 0.85
getExecutorLatestRunPathFunction · 0.85

Tested by

no test coverage detected