You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/07/11 01:39:23 UTC
[37/50] mesos git commit: Windows: Disable code using `os::shell()`.
Windows: Disable code using `os::shell()`.
The disabled tests were already disabled, but at runtime instead of
compile time. Deleting `os::shell()` forces us to temporarily disable
the IP discovery command flag until we can move the implementation of
`subprocess()` into stout.
Review: https://reviews.apache.org/r/60331/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/129d431c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/129d431c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/129d431c
Branch: refs/heads/master
Commit: 129d431c0635d5f2412d13bf38e929dfbdd000a5
Parents: 3ec06c6
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Jul 10 14:39:46 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Mon Jul 10 17:15:37 2017 -0700
----------------------------------------------------------------------
src/slave/main.cpp | 10 ++++++++++
src/tests/fetcher_tests.cpp | 24 ++++++++++++++++++++----
2 files changed, 30 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/129d431c/src/slave/main.cpp
----------------------------------------------------------------------
diff --git a/src/slave/main.cpp b/src/slave/main.cpp
index 578f7c8..a4a8ced 100644
--- a/src/slave/main.cpp
+++ b/src/slave/main.cpp
@@ -302,6 +302,7 @@ int main(int argc, char** argv)
}
if (flags.ip_discovery_command.isSome()) {
+#ifndef __WINDOWS__
Try<string> ipAddress = os::shell(flags.ip_discovery_command.get());
if (ipAddress.isError()) {
@@ -309,17 +310,26 @@ int main(int argc, char** argv)
}
os::setenv("LIBPROCESS_IP", strings::trim(ipAddress.get()));
+#else
+ EXIT(EXIT_FAILURE)
+ << "The `--ip_discovery_command` is not yet supported on Windows";
+#endif // __WINDOWS__
} else if (flags.ip.isSome()) {
os::setenv("LIBPROCESS_IP", flags.ip.get());
}
if (flags.ip6_discovery_command.isSome()) {
+#ifndef __WINDOWS__
Try<string> ip6Address = os::shell(flags.ip6_discovery_command.get());
if (ip6Address.isError()) {
EXIT(EXIT_FAILURE) << ip6Address.error();
}
os::setenv("LIBPROCESS_IP6", strings::trim(ip6Address.get()));
+#else
+ EXIT(EXIT_FAILURE)
+ << "The `--ip6_discovery_command` is not yet supported on Windows";
+#endif // __WINDOWS__
} else if (flags.ip6.isSome()) {
os::setenv("LIBPROCESS_IP6", flags.ip6.get());
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/129d431c/src/tests/fetcher_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/fetcher_tests.cpp b/src/tests/fetcher_tests.cpp
index 99149ba..01da9fe 100644
--- a/src/tests/fetcher_tests.cpp
+++ b/src/tests/fetcher_tests.cpp
@@ -657,7 +657,9 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, NoExtractExecutable)
}
-TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, ExtractNotExecutable)
+// NOTE: This is disabled on Windows because `os::shell()` is deleted.
+#ifndef __WINDOWS__
+TEST_F(FetcherTest, ExtractNotExecutable)
{
// First construct a temporary file that can be fetched and archived with tar
// gzip.
@@ -709,10 +711,13 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, ExtractNotExecutable)
verifyMetrics(1, 0);
}
+#endif // __WINDOWS__
// Tests extracting tar file with extension .tar.
-TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, ExtractTar)
+// NOTE: This is disabled on Windows because `os::shell()` is deleted.
+#ifndef __WINDOWS__
+TEST_F(FetcherTest, ExtractTar)
{
// First construct a temporary file that can be fetched and archived with
// tar.
@@ -755,9 +760,12 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, ExtractTar)
verifyMetrics(1, 0);
}
+#endif // __WINDOWS__
-TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, ExtractGzipFile)
+// NOTE: This is disabled on Windows because `os::shell()` is deleted.
+#ifndef __WINDOWS__
+TEST_F(FetcherTest, ExtractGzipFile)
{
// First construct a temporary file that can be fetched and archived with
// gzip.
@@ -795,6 +803,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, ExtractGzipFile)
verifyMetrics(1, 0);
}
+#endif // __WINDOWS__
TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, UNZIP_ExtractFile)
@@ -999,6 +1008,8 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, UseCustomOutputFile)
}
+// NOTE: This is disabled on Windows because `os::shell()` is deleted.
+#ifndef __WINDOWS__
TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, CustomGzipOutputFile)
{
// First construct a temporary file that can be fetched.
@@ -1038,6 +1049,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, CustomGzipOutputFile)
verifyMetrics(1, 0);
}
+#endif // __WINDOWS__
// TODO(hausdorff): `os::chmod` does not exist on Windows.
@@ -1138,7 +1150,10 @@ TEST_F(FetcherTest, HdfsURI)
// agent towards the fetcher. By supplying an invalid SSL setup, we
// force the fetcher to fail if the parent process does not filter
// them out.
-TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, SSLEnvironmentSpillover)
+//
+// NOTE: This is disabled on Windows because `os::shell()` is deleted.
+#ifndef __WINDOWS__
+TEST_F(FetcherTest, SSLEnvironmentSpillover)
{
// Patch some critical libprocess environment variables into the
// parent process of the mesos-fetcher. We expect this test to fail
@@ -1192,6 +1207,7 @@ TEST_F_TEMP_DISABLED_ON_WINDOWS(FetcherTest, SSLEnvironmentSpillover)
os::setenv("LIBPROCESS_SSL_KEY_FILE", key);
}
}
+#endif // __WINDOWS__
} // namespace tests {
} // namespace internal {