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

Function TEST_F

src/tests/containerizer/mesos_containerizer_tests.cpp:108–153  ·  view source on GitHub ↗

TODO(benh): Parameterize this test by each `Launcher`.

Source from the content-addressed store, hash-verified

106
107// TODO(benh): Parameterize this test by each `Launcher`.
108TEST_F(MesosContainerizerTest, Launch)
109{
110 slave::Flags flags = CreateSlaveFlags();
111 flags.launcher = "posix";
112 flags.isolation = "posix/cpu";
113
114 Fetcher fetcher(flags);
115
116 Try<MesosContainerizer*> create = MesosContainerizer::create(
117 flags,
118 true,
119 &fetcher);
120
121 ASSERT_SOME(create);
122
123 Owned<MesosContainerizer> containerizer(create.get());
124
125 SlaveState state;
126 state.id = SlaveID();
127
128 AWAIT_READY(containerizer->recover(state));
129
130 ContainerID containerId;
131 containerId.set_value(id::UUID::random().toString());
132
133 Try<string> directory = environment->mkdtemp();
134 ASSERT_SOME(directory);
135
136 Future<Containerizer::LaunchResult> launch = containerizer->launch(
137 containerId,
138 createContainerConfig(
139 None(),
140 createExecutorInfo("executor", "exit 42", "cpus:1"),
141 directory.get()),
142 map<string, string>(),
143 None());
144
145 AWAIT_ASSERT_EQ(Containerizer::LaunchResult::SUCCESS, launch);
146
147 Future<Option<ContainerTermination>> wait = containerizer->wait(containerId);
148
149 AWAIT_READY(wait);
150 ASSERT_SOME(wait.get());
151 ASSERT_TRUE(wait.get()->has_status());
152 EXPECT_WEXITSTATUS_EQ(42, wait.get()->status());
153}
154
155
156TEST_F(MesosContainerizerTest, StandaloneLaunch)

Callers

nothing calls this directly

Calls 15

randomFunction · 0.85
createContainerConfigFunction · 0.85
NoneClass · 0.85
createExecutorInfoFunction · 0.85
createCommandInfoFunction · 0.85
executorEnvironmentFunction · 0.85
getLauncherDirFunction · 0.85
getuidFunction · 0.85
FutureSatisfyFunction · 0.85
prepareFunction · 0.85
FailureClass · 0.85
destroyFunction · 0.85

Tested by

no test coverage detected