You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by tn...@apache.org on 2015/07/07 21:26:22 UTC

[1/2] mesos git commit: Only run netcat tests when nc is available.

Repository: mesos
Updated Branches:
  refs/heads/master eb6986938 -> a925b77d5


Only run netcat tests when nc is available.

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


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

Branch: refs/heads/master
Commit: a925b77d53fabcc22e4b4988e18b40387e17b0ab
Parents: eecf0d4
Author: Timothy Chen <tn...@apache.org>
Authored: Tue Jul 7 11:51:36 2015 -0700
Committer: Timothy Chen <tn...@apache.org>
Committed: Tue Jul 7 12:26:12 2015 -0700

----------------------------------------------------------------------
 src/tests/docker_containerizer_tests.cpp |  2 +-
 src/tests/environment.cpp                | 26 ++++++++++++++++++++++++++
 src/tests/port_mapping_tests.cpp         | 12 ++++++------
 3 files changed, 33 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a925b77d/src/tests/docker_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/docker_containerizer_tests.cpp b/src/tests/docker_containerizer_tests.cpp
index 0a87333..a3da786 100644
--- a/src/tests/docker_containerizer_tests.cpp
+++ b/src/tests/docker_containerizer_tests.cpp
@@ -2120,7 +2120,7 @@ TEST_F(DockerContainerizerTest,
 // exposing the host port to the container port, by sending data
 // to the host port and receiving it in the container by listening
 // to the mapped container port.
-TEST_F(DockerContainerizerTest, ROOT_DOCKER_PortMapping)
+TEST_F(DockerContainerizerTest, ROOT_DOCKER_NC_PortMapping)
 {
   Try<PID<Master> > master = StartMaster();
   ASSERT_SOME(master);

http://git-wip-us.apache.org/repos/asf/mesos/blob/a925b77d/src/tests/environment.cpp
----------------------------------------------------------------------
diff --git a/src/tests/environment.cpp b/src/tests/environment.cpp
index 3726e5d..5253470 100644
--- a/src/tests/environment.cpp
+++ b/src/tests/environment.cpp
@@ -239,6 +239,31 @@ private:
 };
 
 
+class NetcatFilter : public TestFilter
+{
+public:
+  NetcatFilter()
+  {
+    netcatError = os::system("which nc") != 0;
+    if (netcatError) {
+      std::cerr
+        << "-------------------------------------------------------------\n"
+        << "No 'nc' command found so no tests depending on 'nc' will run\n"
+        << "-------------------------------------------------------------"
+        << std::endl;
+    }
+  }
+
+  bool disable(const ::testing::TestInfo* test) const
+  {
+    return matches(test, "NC_") && netcatError;
+  }
+
+private:
+  bool netcatError;
+};
+
+
 class BenchmarkFilter : public TestFilter
 {
 public:
@@ -368,6 +393,7 @@ Environment::Environment(const Flags& _flags) : flags(_flags)
   filters.push_back(Owned<TestFilter>(new BenchmarkFilter()));
   filters.push_back(Owned<TestFilter>(new NetworkIsolatorTestFilter()));
   filters.push_back(Owned<TestFilter>(new PerfFilter()));
+  filters.push_back(Owned<TestFilter>(new NetcatFilter()));
 
   // Construct the filter string to handle system or platform specific tests.
   ::testing::UnitTest* unitTest = ::testing::UnitTest::GetInstance();

http://git-wip-us.apache.org/repos/asf/mesos/blob/a925b77d/src/tests/port_mapping_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/port_mapping_tests.cpp b/src/tests/port_mapping_tests.cpp
index ac49cdf..f01c3e1 100644
--- a/src/tests/port_mapping_tests.cpp
+++ b/src/tests/port_mapping_tests.cpp
@@ -429,7 +429,7 @@ static bool waitForFileCreation(
 // 'validPort' and 'invalidPort'. Verify that only the connection
 // through 'validPort' is successful by confirming that the expected
 // data has been written to its output file.
-TEST_F(PortMappingIsolatorTest, ROOT_ContainerToContainerTCP)
+TEST_F(PortMappingIsolatorTest, ROOT_NC_ContainerToContainerTCP)
 {
   Try<Isolator*> isolator = PortMappingIsolatorProcess::create(flags);
   CHECK_SOME(isolator);
@@ -589,7 +589,7 @@ TEST_F(PortMappingIsolatorTest, ROOT_ContainerToContainerTCP)
 
 
 // The same container-to-container test but with UDP.
-TEST_F(PortMappingIsolatorTest, ROOT_ContainerToContainerUDP)
+TEST_F(PortMappingIsolatorTest, ROOT_NC_ContainerToContainerUDP)
 {
   Try<Isolator*> isolator = PortMappingIsolatorProcess::create(flags);
   CHECK_SOME(isolator);
@@ -751,7 +751,7 @@ TEST_F(PortMappingIsolatorTest, ROOT_ContainerToContainerUDP)
 
 // Test the scenario where a UDP server is in a container while host
 // tries to establish a UDP connection.
-TEST_F(PortMappingIsolatorTest, ROOT_HostToContainerUDP)
+TEST_F(PortMappingIsolatorTest, ROOT_NC_HostToContainerUDP)
 {
   Try<Isolator*> isolator = PortMappingIsolatorProcess::create(flags);
   CHECK_SOME(isolator);
@@ -868,7 +868,7 @@ TEST_F(PortMappingIsolatorTest, ROOT_HostToContainerUDP)
 
 // Test the scenario where a TCP server is in a container while host
 // tries to establish a TCP connection.
-TEST_F(PortMappingIsolatorTest, ROOT_HostToContainerTCP)
+TEST_F(PortMappingIsolatorTest, ROOT_NC_HostToContainerTCP)
 {
   Try<Isolator*> isolator = PortMappingIsolatorProcess::create(flags);
   CHECK_SOME(isolator);
@@ -1450,7 +1450,7 @@ TEST_F(PortMappingIsolatorTest, ROOT_TooManyContainers)
 
 // Test the scenario where PortMappingIsolator uses a very small
 // egress rate limit.
-TEST_F(PortMappingIsolatorTest, ROOT_SmallEgressLimit)
+TEST_F(PortMappingIsolatorTest, ROOT_NC_SmallEgressLimit)
 {
   // Note that the underlying rate limiting mechanism usually has a
   // small allowance for burst. Empirically, as least 10x of the rate
@@ -1605,7 +1605,7 @@ bool HasTCPSocketsRTT(const ResourceStatistics& statistics)
 
 // Test that RTT can be returned properly from usage(). This test is
 // very similar to SmallEgressLimitTest in its setup.
-TEST_F(PortMappingIsolatorTest, ROOT_PortMappingStatistics)
+TEST_F(PortMappingIsolatorTest, ROOT_NC_PortMappingStatistics)
 {
   // To-be-tested egress rate limit, in Bytes/s.
   const Bytes rate = 2000;


[2/2] mesos git commit: Fix running docker executor tests.

Posted by tn...@apache.org.
Fix running docker executor tests.

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


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

Branch: refs/heads/master
Commit: eecf0d4a2a31506878c98c9dd562175816efdcbf
Parents: eb69869
Author: Timothy Chen <tn...@apache.org>
Authored: Tue Jul 7 11:50:21 2015 -0700
Committer: Timothy Chen <tn...@apache.org>
Committed: Tue Jul 7 12:26:12 2015 -0700

----------------------------------------------------------------------
 src/tests/docker_containerizer_tests.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/eecf0d4a/src/tests/docker_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/docker_containerizer_tests.cpp b/src/tests/docker_containerizer_tests.cpp
index d4ccb0b..0a87333 100644
--- a/src/tests/docker_containerizer_tests.cpp
+++ b/src/tests/docker_containerizer_tests.cpp
@@ -467,7 +467,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_Launch_Executor)
   executorInfo.mutable_executor_id()->CopyFrom(executorId);
 
   CommandInfo command;
-  command.set_value("test-executor");
+  command.set_value("/bin/test-executor");
   executorInfo.mutable_command()->CopyFrom(command);
 
   ContainerInfo containerInfo;
@@ -580,7 +580,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_Launch_Executor_Bridged)
   executorInfo.mutable_executor_id()->CopyFrom(executorId);
 
   CommandInfo command;
-  command.set_value("test-executor");
+  command.set_value("/bin/test-executor");
   executorInfo.mutable_command()->CopyFrom(command);
 
   ContainerInfo containerInfo;
@@ -2958,7 +2958,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_DockerInspectDiscard)
   executorInfo.mutable_executor_id()->CopyFrom(executorId);
 
   CommandInfo command;
-  command.set_value("test-executor");
+  command.set_value("/bin/test-executor");
   executorInfo.mutable_command()->CopyFrom(command);
 
   ContainerInfo containerInfo;