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

Function TEST_F

src/tests/role_tests.cpp:73–99  ·  view source on GitHub ↗

This test checks that a framework cannot register with a role that is not in the configured list.

Source from the content-addressed store, hash-verified

71// This test checks that a framework cannot register with a role that
72// is not in the configured list.
73TEST_F(RoleTest, BadRegister)
74{
75 FrameworkInfo frameworkInfo = DEFAULT_FRAMEWORK_INFO;
76 frameworkInfo.set_roles(0, "invalid");
77
78 master::Flags masterFlags = CreateMasterFlags();
79 masterFlags.roles = "foo,bar";
80
81 Try<Owned<cluster::Master>> master = StartMaster(masterFlags);
82 ASSERT_SOME(master);
83
84 MockScheduler sched;
85 MesosSchedulerDriver driver(
86 &sched, frameworkInfo, master.get()->pid, DEFAULT_CREDENTIAL);
87
88 Future<Nothing> error;
89 EXPECT_CALL(sched, error(&driver, _))
90 .WillOnce(FutureSatisfy(&error));
91
92 driver.start();
93
94 // Scheduler should get error message from the master.
95 AWAIT_READY(error);
96
97 driver.stop();
98 driver.join();
99}
100
101
102// This test checks that when using implicit roles, a framework can

Callers

nothing calls this directly

Calls 15

errorFunction · 0.85
FutureSatisfyFunction · 0.85
MillisecondsClass · 0.85
allocatedResourcesFunction · 0.85
RESERVEFunction · 0.85
createPersistentVolumeFunction · 0.85
MegabytesFunction · 0.85
NoneClass · 0.85
shutdownFunction · 0.85
createBasicAuthHeadersFunction · 0.85
OKClass · 0.85

Tested by

no test coverage detected