Skip to content

Commit

Permalink
Added RESERVATION_REFINEMENT capability to tests [18/20].
Browse files Browse the repository at this point in the history
  • Loading branch information
mpark committed Jun 20, 2017
1 parent 42a1913 commit ded150a
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/examples/disk_full_framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ int main(int argc, char** argv)
framework.set_user(""); // Have Mesos fill the current user.
framework.set_name("Disk Full Framework (C++)");
framework.set_checkpoint(true);
framework.add_capabilities()->set_type(
FrameworkInfo::Capability::RESERVATION_REFINEMENT);

DiskFullScheduler scheduler(flags, framework);

Expand Down
2 changes: 2 additions & 0 deletions src/examples/dynamic_reservation_framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ int main(int argc, char** argv)
framework.set_name("Dynamic Reservation Framework (C++)");
framework.set_role(flags.role.get());
framework.set_principal(flags.principal);
framework.add_capabilities()->set_type(
FrameworkInfo::Capability::RESERVATION_REFINEMENT);

DynamicReservationScheduler scheduler(
flags.command,
Expand Down
2 changes: 2 additions & 0 deletions src/examples/no_executor_framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ int main(int argc, char** argv)
framework.set_user(""); // Have Mesos fill in the current user.
framework.set_name("No Executor Framework");
framework.set_checkpoint(flags.checkpoint);
framework.add_capabilities()->set_type(
FrameworkInfo::Capability::RESERVATION_REFINEMENT);

if (flags.task_revocable_resources.isSome()) {
framework.add_capabilities()->set_type(
Expand Down
2 changes: 2 additions & 0 deletions src/examples/persistent_volume_framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,8 @@ int main(int argc, char** argv)
framework.set_principal(flags.principal);
framework.add_capabilities()->set_type(
FrameworkInfo::Capability::SHARED_RESOURCES);
framework.add_capabilities()->set_type(
FrameworkInfo::Capability::RESERVATION_REFINEMENT);

if (flags.master.get() == "local") {
// Configure master.
Expand Down
2 changes: 2 additions & 0 deletions src/examples/test_framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ int main(int argc, char** argv)
framework.set_user(""); // Have Mesos fill in the current user.
framework.set_name("Test Framework (C++)");
framework.set_role(flags.role);
framework.add_capabilities()->set_type(
FrameworkInfo::Capability::RESERVATION_REFINEMENT);

value = os::getenv("MESOS_CHECKPOINT");
if (value.isSome()) {
Expand Down
2 changes: 2 additions & 0 deletions src/examples/test_http_framework.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ int main(int argc, char** argv)
FrameworkInfo framework;
framework.set_name("Event Call Scheduler using libprocess (C++)");
framework.set_role(flags.role);
framework.add_capabilities()->set_type(
FrameworkInfo::Capability::RESERVATION_REFINEMENT);

const Result<string> user = os::user();

Expand Down
10 changes: 10 additions & 0 deletions src/tests/fault_tolerance_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2040,6 +2040,11 @@ TEST_F(FaultToleranceTest, UpdateFrameworkInfoOnSchedulerFailover)
// scheduler with updated information.

FrameworkInfo finfo1 = DEFAULT_FRAMEWORK_INFO;

// TODO(mpark): Remove this once `RESERVATION_REFINEMENT`
// is removed from `DEFAULT_FRAMEWORK_INFO`.
finfo1.clear_capabilities();

finfo1.set_name("Framework 1");
finfo1.set_failover_timeout(1000);
finfo1.mutable_labels()->add_labels()->CopyFrom(createLabel("foo", "bar"));
Expand All @@ -2065,6 +2070,11 @@ TEST_F(FaultToleranceTest, UpdateFrameworkInfoOnSchedulerFailover)
// callback.

FrameworkInfo finfo2 = DEFAULT_FRAMEWORK_INFO;

// TODO(mpark): Remove this once `RESERVATION_REFINEMENT`
// is removed from `DEFAULT_FRAMEWORK_INFO`.
finfo2.clear_capabilities();

finfo2.mutable_id()->MergeFrom(frameworkId.get());
auto capabilityType = FrameworkInfo::Capability::REVOCABLE_RESOURCES;
finfo2.add_capabilities()->set_type(capabilityType);
Expand Down
5 changes: 5 additions & 0 deletions src/tests/master_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4052,6 +4052,11 @@ TEST_F(MasterTest, StateEndpointFrameworkInfo)
AWAIT_READY(slaveRegisteredMessage);

FrameworkInfo frameworkInfo = DEFAULT_FRAMEWORK_INFO;

// TODO(mpark): Remove this once `RESERVATION_REFINEMENT`
// is removed from `DEFAULT_FRAMEWORK_INFO`.
frameworkInfo.clear_capabilities();

frameworkInfo.set_webui_url("http://localhost:8080/");

vector<FrameworkInfo::Capability::Type> capabilities = {
Expand Down
5 changes: 5 additions & 0 deletions src/tests/master_validation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3601,6 +3601,11 @@ TEST_F(FrameworkInfoValidationTest, DowngradeFromMultipleRoles)
ASSERT_SOME(master);

FrameworkInfo frameworkInfo = DEFAULT_FRAMEWORK_INFO;

// TODO(mpark): Remove this once `RESERVATION_REFINEMENT`
// is removed from `DEFAULT_FRAMEWORK_INFO`.
frameworkInfo.clear_capabilities();

frameworkInfo.add_roles("role1");
frameworkInfo.add_roles("role2");
frameworkInfo.add_capabilities()->set_type(
Expand Down
2 changes: 2 additions & 0 deletions src/tests/mesos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ struct DefaultFrameworkInfo
framework.set_user(os::user().get());
framework.set_principal(
DefaultCredential<TCredential>::create().principal());
framework.add_capabilities()->set_type(
TFrameworkInfo::Capability::RESERVATION_REFINEMENT);

return framework;
}
Expand Down

0 comments on commit ded150a

Please sign in to comment.