diff --git a/src/monad b/src/monad index 0bbda079b..f6bd69cc0 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit 0bbda079b92fbd071f0c7ef533eac87653a6a410 +Subproject commit f6bd69cc07c0d564379c684654a3c37b0fbfdaad diff --git a/src/monad-native b/src/monad-native index 9bb5b7e52..102f6163a 160000 --- a/src/monad-native +++ b/src/monad-native @@ -1 +1 @@ -Subproject commit 9bb5b7e52c3f1a18cac367c7fb7579406c6786fc +Subproject commit 102f6163a17afec6e27107ec0fdfec5fd458c706 diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index c408c68da..7196862eb 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -88,8 +88,6 @@ namespace PSTests // It should be the same as what our platform code returns Assert.Equal(hostname, Platform.NonWindowsGetMachineName()); } - - } [Fact] @@ -113,8 +111,47 @@ namespace PSTests // It should be the same as what our platform code returns Assert.Equal(hostname, Platform.NonWindowsGetHostName()); } + } + [Fact] + public static void TestGetDomainName() + { + var startInfo = new ProcessStartInfo + { + FileName = @"/usr/bin/env", + Arguments = "dnsdomainname", + RedirectStandardOutput = true, + UseShellExecute = false + }; + using (Process process = Process.Start(startInfo)) + { + // Get output of call to hostname without trailing newline + string domainName = process.StandardOutput.ReadToEnd().Trim(); + process.WaitForExit(); + // The process should return an exit code of 0 on success + Assert.Equal(0, process.ExitCode); + // It should be the same as what our platform code returns + Assert.Equal(domainName, Platform.NonWindowsGetDomainName()); + } + } + + [Fact] + public static void TestIsExecutable() + { + Assert.True(Platform.NonWindowsIsExecutable("/bin/ls")); + } + + [Fact] + public static void TestIsNotExecutable() + { + Assert.False(Platform.NonWindowsIsExecutable("/etc/hosts")); + } + + [Fact] + public static void TestDirectoryIsNotExecutable() + { + Assert.False(Platform.NonWindowsIsExecutable("/etc")); } [Fact]