This test checks that a framework cannot register with a role that is not in the configured list.
| 71 | // This test checks that a framework cannot register with a role that |
| 72 | // is not in the configured list. |
| 73 | TEST_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 |
nothing calls this directly
no test coverage detected