Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Re-enable additional tests on WSL (#25807)
Browse files Browse the repository at this point in the history
* Re-enable DriveInfo test on Windows Subsystem for Linux

https://github.com/dotnet/corefx/issues/11570

* Re-enable additional tests on WSL

Related microsoft/WSL#1011 and microsoft/WSL#308

* correct xunit Facts

* Disable some network tests on WSL

Disable some network tests on WindowsSubsystemForLinux due to https://github.com/dotnet/corefx/issues/15513
  • Loading branch information
joshfree authored Dec 12, 2017
1 parent 5cae322 commit 1e95551
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public void PropertiesOfInvalidDrive()
Assert.Equal(invalidDriveName, invalidDrive.VolumeLabel); // VolumeLabel is equivalent to Name on Unix
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/11570
[PlatformSpecific(TestPlatforms.AnyUnix)]
public void PropertiesOfValidDrive()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public async Task Windows_OperationsOnNamedServerWithDisposedClient()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/1011
[Fact]
[PlatformSpecific(TestPlatforms.AnyUnix)] // Unix implemented on sockets, where disposal information doesn't propagate
public async Task Unix_OperationsOnNamedServerWithDisposedClient()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public IPInterfacePropertiesTest_Linux()
_log = TestLogging.GetInstance();
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
public void IPInfoTest_AccessAllProperties_NoErrors()
{
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
Expand Down Expand Up @@ -102,7 +103,8 @@ public void IPInfoTest_AccessAllProperties_NoErrors()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
public void IPInfoTest_AccessAllIPv4Properties_NoErrors()
{
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
Expand All @@ -125,7 +127,8 @@ public void IPInfoTest_AccessAllIPv4Properties_NoErrors()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
public void IPInfoTest_AccessAllIPv6Properties_NoErrors()
{
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
Expand All @@ -150,7 +153,8 @@ public void IPInfoTest_AccessAllIPv6Properties_NoErrors()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
[Trait("IPv6", "true")]
public void IPv6ScopeId_AccessAllValues_Success()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public NetworkInterfaceBasicTest()
_log = TestLogging.GetInstance();
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
public void BasicTest_GetNetworkInterfaces_AtLeastOne()
{
Assert.NotEqual<int>(0, NetworkInterface.GetAllNetworkInterfaces().Length);
Expand Down Expand Up @@ -51,7 +52,8 @@ public void BasicTest_AccessInstanceProperties_NoExceptions()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
[PlatformSpecific(TestPlatforms.Linux)] // Some APIs are not supported on Linux
public void BasicTest_AccessInstanceProperties_NoExceptions_Linux()
{
Expand Down Expand Up @@ -109,7 +111,8 @@ public void BasicTest_AccessInstanceProperties_NoExceptions_Osx()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
[Trait("IPv4", "true")]
public void BasicTest_StaticLoopbackIndex_MatchesLoopbackNetworkInterface()
{
Expand All @@ -131,7 +134,8 @@ public void BasicTest_StaticLoopbackIndex_MatchesLoopbackNetworkInterface()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
[Trait("IPv4", "true")]
public void BasicTest_StaticLoopbackIndex_ExceptionIfV4NotSupported()
{
Expand All @@ -140,7 +144,8 @@ public void BasicTest_StaticLoopbackIndex_ExceptionIfV4NotSupported()
_log.WriteLine("Loopback IPv4 index: " + NetworkInterface.LoopbackInterfaceIndex);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
[Trait("IPv6", "true")]
public void BasicTest_StaticIPv6LoopbackIndex_MatchesLoopbackNetworkInterface()
{
Expand All @@ -164,7 +169,8 @@ public void BasicTest_StaticIPv6LoopbackIndex_MatchesLoopbackNetworkInterface()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
[Trait("IPv6", "true")]
public void BasicTest_StaticIPv6LoopbackIndex_ExceptionIfV6NotSupported()
{
Expand Down Expand Up @@ -196,7 +202,8 @@ public void BasicTest_GetIPInterfaceStatistics_Success()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
[PlatformSpecific(TestPlatforms.Linux)] // Some APIs are not supported on Linux
public void BasicTest_GetIPInterfaceStatistics_Success_Linux()
{
Expand Down Expand Up @@ -244,13 +251,16 @@ public void BasicTest_GetIPInterfaceStatistics_Success_OSX()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308

// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
public void BasicTest_GetIsNetworkAvailable_Success()
{
Assert.True(NetworkInterface.GetIsNetworkAvailable());
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
[PlatformSpecific(~TestPlatforms.OSX)]
[InlineData(false)]
[InlineData(true)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public void BasicTest_GetIPv4InterfaceStatistics_Success()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
// dotnet: /d/git/corefx/src/Native/Unix/Common/pal_safecrt.h:47: errno_t memcpy_s(void *, size_t, const void *, size_t): Assertion `sizeInBytes >= count' failed.
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/dotnet/corefx/issues/15513
[PlatformSpecific(TestPlatforms.Linux)] // Some APIs are not supported on Linux
public void BasicTest_GetIPv4InterfaceStatistics_Success_Linux()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,13 +506,13 @@ public void ConnectAsyncV6IPEndPointToV6Host_Success()
DualModeConnectAsync_IPEndPointToHost_Helper(IPAddress.IPv6Loopback, IPAddress.IPv6Loopback, false);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
[Fact]
public void ConnectAsyncV4IPEndPointToV6Host_Fails()
{
DualModeConnectAsync_IPEndPointToHost_Fails_Helper(IPAddress.Loopback, IPAddress.IPv6Loopback);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
[Fact]
public void ConnectAsyncV6IPEndPointToV4Host_Fails()
{
DualModeConnectAsync_IPEndPointToHost_Fails_Helper(IPAddress.IPv6Loopback, IPAddress.Loopback);
Expand Down
2 changes: 1 addition & 1 deletion src/System.Net.Sockets/tests/FunctionalTests/SelectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void Select_Read_OneReadyAtATime(int reads)
}

[PlatformSpecific(~TestPlatforms.OSX)] // typical OSX install has very low max open file descriptors value
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsSubsystemForLinux))] // https://github.com/Microsoft/BashOnWindows/issues/308
[Fact]
public void Select_Error_OneReadyAtATime()
{
const int Errors = 90; // value larger than the internal value in SocketPal.Unix that swaps between stack and heap allocation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ private async Task MulticastInterface_Set_Helper(int interfaceIndex)
receiveSocket.ReceiveTimeout = 1000;
receiveSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.AddMembership, new MulticastOption(multicastAddress, interfaceIndex));

// https://github.com/Microsoft/BashOnWindows/issues/990
if (!PlatformDetection.IsWindowsSubsystemForLinux)
{
sendSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastInterface, IPAddress.HostToNetworkOrder(interfaceIndex));
}
sendSocket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MulticastInterface, IPAddress.HostToNetworkOrder(interfaceIndex));

var receiveBuffer = new byte[1024];
var receiveTask = receiveSocket.ReceiveAsync(new ArraySegment<byte>(receiveBuffer), SocketFlags.None);
Expand Down

0 comments on commit 1e95551

Please sign in to comment.