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

Method SetUp

src/tests/fetcher_cache_tests.cpp:191–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189
190
191void FetcherCacheTest::SetUp()
192{
193 MesosTest::SetUp();
194
195 flags = CreateSlaveFlags();
196 flags.resources = "cpus:1000;mem:1000";
197
198 assetsDirectory = path::join(flags.work_dir, ASSETS_DIRECTORY_NAME);
199 ASSERT_SOME(os::mkdir(assetsDirectory));
200
201 setupCommandFileAsset();
202 setupArchiveAsset();
203
204 Try<Owned<cluster::Master>> _master = StartMaster();
205 ASSERT_SOME(_master);
206 master = _master.get();
207
208 FrameworkInfo frameworkInfo;
209 frameworkInfo.set_name("default");
210 frameworkInfo.set_checkpoint(true);
211
212 driver.reset(new MesosSchedulerDriver(
213 &scheduler, frameworkInfo, master->pid, DEFAULT_CREDENTIAL));
214
215 EXPECT_CALL(scheduler, registered(driver.get(), _, _));
216
217 // This installs a temporary reaction to resourceOffers calls, which
218 // must be in place BEFORE starting the scheduler driver. This
219 // "cover" is necessary, because we only add relevant mock actions
220 // in launchTask() and launchTasks() AFTER starting the driver.
221 EXPECT_CALL(scheduler, resourceOffers(driver.get(), _))
222 .WillRepeatedly(DeclineOffers());
223}
224
225
226// Dumps the contents of a text file to cout, assuming

Callers

nothing calls this directly

Calls 4

joinFunction · 0.50
mkdirFunction · 0.50
getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected