mesos git commit: Windows: Enabled more agent tests.

2018-05-14 Thread andschwa
Repository: mesos
Updated Branches:
  refs/heads/master 9ecd9a4e8 -> c586699e7


Windows: Enabled more agent tests.

These just worked when enabled.

Review: https://reviews.apache.org/r/67051/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c586699e
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c586699e
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c586699e

Branch: refs/heads/master
Commit: c586699e70479d26f68dc016932ba36a3ab15314
Parents: 9ecd9a4
Author: Andrew Schwartzmeyer 
Authored: Mon May 14 14:21:10 2018 -0700
Committer: Andrew Schwartzmeyer 
Committed: Mon May 14 14:21:10 2018 -0700

--
 src/tests/slave_tests.cpp | 14 +-
 1 file changed, 5 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/c586699e/src/tests/slave_tests.cpp
--
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 53c9630..65d8605 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -1997,9 +1997,7 @@ TEST_F(SlaveTest, GetStateTaskGroupPending)
 
 // This test checks that when a slave is in RECOVERING state it responds
 // to HTTP requests for "/state" endpoint with ServiceUnavailable.
-TEST_F_TEMP_DISABLED_ON_WINDOWS(
-SlaveTest,
-StateEndpointUnavailableDuringRecovery)
+TEST_F(SlaveTest, StateEndpointUnavailableDuringRecovery)
 {
   Try master = StartMaster();
   ASSERT_SOME(master);
@@ -6150,8 +6148,7 @@ TEST_F(SlaveTest, KillAllInitialTasksTerminatesExecutor)
 
 // This test verifies that the executor is shutdown during re-registration if
 // all of its initial tasks could not be delivered.
-TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest,
-AgentFailoverTerminatesExecutorWithNoTask)
+TEST_F(SlaveTest, AgentFailoverTerminatesExecutorWithNoTask)
 {
   // Start a master.
   Try master = StartMaster();
@@ -6410,8 +6407,7 @@ TEST_F(SlaveTest, 
KillAllInitialTasksTerminatesHTTPExecutor)
 //
 // TODO(mzhu): This test could be simplified if we had a test scheduler that
 // provides some basic task launching functionality (see MESOS-8511).
-TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest,
-AgentFailoverTerminatesHTTPExecutorWithNoTask)
+TEST_F(SlaveTest, AgentFailoverTerminatesHTTPExecutorWithNoTask)
 {
   Try master = StartMaster();
   ASSERT_SOME(master);
@@ -10652,7 +10648,7 @@ TEST_F(SlaveTest, ResourceProviderSubscribe)
 // This test checks that before a workload (executor or task) is
 // launched, all resources from resoruce providers nended to run the
 // current set of workloads are properly published.
-TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, ResourceProviderPublishAll)
+TEST_F(SlaveTest, ResourceProviderPublishAll)
 {
   // Start an agent and a master.
   Try master = StartMaster();
@@ -10755,7 +10751,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, 
ResourceProviderPublishAll)
 {LAUNCH({createTask(
 offers->at(0).slave_id(),
 Resources(offers->at(0).resources()).reserved(framework.roles(0)),
-createCommandInfo("sleep 1000"))})},
+createCommandInfo(SLEEP_COMMAND(1000)))})},
 filters);
 
 AWAIT_READY(publish);



[13/13] mesos git commit: Windows: Enabled more agent tests.

2017-11-29 Thread andschwa
Windows: Enabled more agent tests.

These tests "just worked" once the isolators and command was fixed to be
Windows-compatible. Particularly, `/bin/echo --author` was replaced with
an equivalent PowerShell command, and `posix/cpu,posix/mem` was replaced
with `windows/cpu`.

Review: https://reviews.apache.org/r/63817


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/453d631c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/453d631c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/453d631c

Branch: refs/heads/master
Commit: 453d631cf116275f567e222c54481b614d1bb965
Parents: 0dee8b1
Author: Andrew Schwartzmeyer 
Authored: Fri Nov 3 12:42:35 2017 -0700
Committer: Andrew Schwartzmeyer 
Committed: Wed Nov 29 19:24:11 2017 -0800

--
 src/tests/slave_tests.cpp | 85 ++
 1 file changed, 45 insertions(+), 40 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/mesos/blob/453d631c/src/tests/slave_tests.cpp
--
diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp
index 6e4a860..823bd44 100644
--- a/src/tests/slave_tests.cpp
+++ b/src/tests/slave_tests.cpp
@@ -151,7 +151,35 @@ namespace tests {
 // that seem vaguely more slave than master-related are in this file.
 // The others are in "master_tests.cpp".
 
-class SlaveTest : public MesosTest {};
+class SlaveTest : public MesosTest
+{
+public:
+  const std::string defaultIsolators{
+#ifdef __WINDOWS__
+  "windows/cpu"
+#else
+  "posix/cpu,posix/mem"
+#endif // __WINDOWS__
+  };
+
+  CommandInfo echoAuthorCommand()
+  {
+CommandInfo command;
+command.set_shell(false);
+#ifdef __WINDOWS__
+command.set_value("powershell.exe");
+command.add_arguments("powershell.exe");
+command.add_arguments("-NoProfile");
+command.add_arguments("-Command");
+command.add_arguments("echo --author");
+#else
+command.set_value("/bin/echo");
+command.add_arguments("/bin/echo");
+command.add_arguments("--author");
+#endif // __WINDOWS__
+return command;
+  };
+};
 
 
 // This test ensures that when a slave shuts itself down, it
@@ -327,7 +355,7 @@ TEST_F(SlaveTest, DuplicateTerminalUpdateBeforeAck)
 }
 
 
-TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, ShutdownUnregisteredExecutor)
+TEST_F(SlaveTest, ShutdownUnregisteredExecutor)
 {
   Try master = StartMaster();
   ASSERT_SOME(master);
@@ -336,7 +364,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, 
ShutdownUnregisteredExecutor)
   slave::Flags flags = CreateSlaveFlags();
   // Set the isolation flag so we know a MesosContainerizer will
   // be created.
-  flags.isolation = "posix/cpu,posix/mem";
+  flags.isolation = defaultIsolators;
 
   Fetcher fetcher(flags);
 
@@ -616,14 +644,14 @@ TEST_F(SlaveTest, RemoveUnregisteredTerminatedExecutor)
 // mesos-executor args. For more details of this see MESOS-1873.
 //
 // This assumes the ability to execute '/bin/echo --author'.
-TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, CommandTaskWithArguments)
+TEST_F(SlaveTest, CommandTaskWithArguments)
 {
   Try master = StartMaster();
   ASSERT_SOME(master);
 
   // Need flags for 'executor_registration_timeout'.
   slave::Flags flags = CreateSlaveFlags();
-  flags.isolation = "posix/cpu,posix/mem";
+  flags.isolation = defaultIsolators;
 
   Fetcher fetcher(flags);
 
@@ -663,13 +691,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, 
CommandTaskWithArguments)
   task.mutable_resources()->MergeFrom(offers.get()[0].resources());
 
   // Command executor will run as user running test.
-  CommandInfo command;
-  command.set_shell(false);
-  command.set_value("/bin/echo");
-  command.add_arguments("/bin/echo");
-  command.add_arguments("--author");
-
-  task.mutable_command()->MergeFrom(command);
+  task.mutable_command()->MergeFrom(echoAuthorCommand());
 
   Future statusStarting;
   Future statusRunning;
@@ -783,7 +805,7 @@ TEST_F(SlaveTest, CommandTaskWithKillPolicy)
 
 // Don't let args from the CommandInfo struct bleed over into
 // mesos-executor forking. For more details of this see MESOS-1873.
-TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, GetExecutorInfo)
+TEST_F(SlaveTest, GetExecutorInfo)
 {
   TestContainerizer containerizer;
   StandaloneMasterDetector detector;
@@ -813,14 +835,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(SlaveTest, GetExecutorInfo)
   task.mutable_slave_id()->set_value(
   "20141010-221431-251662764-60288-32120-0001");
   task.mutable_resources()->MergeFrom(taskResources);
-
-  CommandInfo command;
-  command.set_shell(false);
-  command.set_value("/bin/echo");
-  command.add_arguments("/bin/echo");
-  command.add_arguments("--author");
-
-  task.mutable_command()->MergeFrom(command);
+