Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup-kdc.sh is not installing Kerberos on some distros causing System.Net.Security.Tests.NegotiateStreamTests to no-op #23537

Closed
ghost opened this issue Sep 13, 2017 · 20 comments
Labels
area-System.Net.Security os-linux Linux OS (any supported distro) test-run-core Test failures in .NET Core test runs
Milestone

Comments

@ghost
Copy link

ghost commented Sep 13, 2017

Opened on behalf of @JiayiLi1

The test System.Net.Security.Tests.NegotiateStreamTest/NegotiateStream_EchoServer_NTLM_ClientWriteRead_Successive_Async_Success has failed.

System.ComponentModel.Win32Exception : Invalid argument

    Stack Trace:

       at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow) in /root/corefx-987254/src/Common/src/Interop/Unix/System.Native/Interop.ForkAndExecProcess.cs:line 43
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) in /root/corefx-987254/src/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs:line 291
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) in /root/corefx-987254/src/System.Diagnostics.Process/src/System/Diagnostics/Process.cs:line 1248
   at System.Net.Security.Tests.KDCSetup.CheckAndClearCredentials(ITestOutputHelper output) in /root/corefx-987254/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs:line 78
   at System.Net.Security.Tests.NegotiateStreamTest..ctor(KDCSetup fixture, ITestOutputHelper output) in /root/corefx-987254/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs:line 151

Build : Master - 20170913.01 (Core Tests)
Failing configurations:

  • suse.422.amd64-x64
    • Release

Detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20170913.01/workItem/System.Net.Security.Tests/analysis/xunit/System.Net.Security.Tests.NegotiateStreamTest~2FNegotiateStream_EchoServer_NTLM_ClientWriteRead_Successive_Async_Success

@KristinXie1
Copy link

failed tests:
NegotiateStream_EchoServer_ClientWriteRead_Successive_Async_Success
NegotiateStream_EchoServer_ClientWriteRead_Successive_Sync_Success
NegotiateStream_EchoServer_NTLM_ClientWriteRead_Successive_Async_Success
NegotiateStream_EchoServer_NTLM_ClientWriteRead_Successive_Sync_Success
NegotiateStream_StreamToStream_AuthToHttpTarget_Success
NegotiateStream_StreamToStream_KerberosAuthDefaultCredentialsNoSeed_Failure
NegotiateStream_StreamToStream_KerberosAuthDefaultCredentials_Success
NegotiateStream_StreamToStream_KerberosAuthInvalidPassword_Failure
NegotiateStream_StreamToStream_KerberosAuthInvalidTarget_Failure
NegotiateStream_StreamToStream_KerberosAuthInvalidUser_Failure
NegotiateStream_StreamToStream_KerberosAuthWithoutRealm_Success
NegotiateStream_StreamToStream_KerberosAuthentication_Success
NegotiateStream_StreamToStream_NtlmAuthentication_Fallback_Success
NegotiateStream_StreamToStream_NtlmAuthentication_KerberosCreds_Success
NegotiateStream_StreamToStream_NtlmAuthentication_NtlmUser_InvalidCredentials_Fail
NegotiateStream_StreamToStream_NtlmAuthentication_ValidCredentials_Success

@davidsh
Copy link
Contributor

davidsh commented Sep 13, 2017

cc: @karelz @danmosemsft

System.Net.Security.NegotiateStream seems broken on Linux.

@danmoseley
Copy link
Member

It may be as simple as "kdestroy" not being available on suse 4.22.
@karelz someone should either update the images, or cause this test to skip on suse, or find an alternative way to achieve whatever it's doing. Perhaps some apt-get type command needs to go into the dockerfile.

            var startInfo = new ProcessStartInfo(KDestroyCmd);
            startInfo.UseShellExecute = true;
            startInfo.CreateNoWindow = true;
            startInfo.Arguments = "-A";
            using (Process clearCreds = Process.Start(startInfo))

@davidsh
Copy link
Contributor

davidsh commented Sep 13, 2017

or cause this test to skip on suse,

These tests have been failing on Ubuntu 17.10 as well. I thought @Priya91 was looking into that.

@Priya91
Copy link
Contributor

Priya91 commented Sep 13, 2017

From the callstack, it looks like these tests are failing due to some wrong arguments to fork and exec.. This is not the same issue as the one on ubuntu 17.10, that's a different bug.

@danmoseley
Copy link
Member

This is causing 350 tests to fail. It is only on Centos, Debian, Fedora, Ubuntu 17.xx and SUSE. Not RH, SLES, Ubuntu 16.xx,

https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20170916.01/workItem/System.Net.Security.Tests

On my personal Centos box, I had to yum install krb5-workstation to get it. On my Ubuntu box, I had to get the krb5-client package. It seems like src\System.Net.Security\tests\Scripts\Unix\setup-kdc.sh is supposed to do this.

Next step: someone SSH into one of these and debug the script.

@karelz
Copy link
Member

karelz commented Sep 16, 2017

@danmosemsft I don't see any test failures on the link you pasted.
Where can I see the 350 tests affected? Where can I find how long they are failing? (is that a recent regression?) ... Or do we still lack that kind of info about test failures?

@karelz
Copy link
Member

karelz commented Sep 16, 2017

Oh, I wasn't signed in (and the page didn't indicate that well :( ... @Chrisboh is it something that can be improved please?)
I still see only 25 tests failing on the page (on 7 OS versions). That does not add up to 350 ... what am I missing?

@karelz
Copy link
Member

karelz commented Sep 16, 2017

@wfurt can you please look at this high-impactful test failure?

@danmoseley
Copy link
Member

@karelz if you look at https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20170916.01 on the left you see 350, this is the number of failures. The failures began in https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20170915.02 . I don't know why : the script didn't change. It would probably be easy for @wfurt to figure out by running it locally.

I'll modify this PR - not a problem

@KristinXie1
Copy link

This issue is also repro in CI, outerloop_netcoreapp_centos7.1_release, detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_centos7.1_release/170/testReport/

@karelz
Copy link
Member

karelz commented Sep 18, 2017

on the left you see 350, this is the number of failures

Ah, in the higher-level report, I didn't notice that -- it counts each failure twice (automatic rerun I assume?)

@danmoseley
Copy link
Member

@karelz there are no reruns currently. The x2 is chk and ret. They don't have columns for both, for lack of space.

@danmoseley danmoseley changed the title Tests under: System.Net.Security.Tests.NegotiateStreamTest failed with "System.ComponentModel.Win32Exception" setup-kdc.sh is not installing Kerberos on some distros causing System.Net.Security.Tests.NegotiateStreamTests to no-op Sep 18, 2017
@KristinXie1
Copy link

Now it failed with "Xunit.Sdk.TrueException", detail: https://mc.dot.net/#/product/netcore/master/source/official~2Fcorefx~2Fmaster~2F/type/test~2Ffunctional~2Fcli~2F/build/20170920.02/workItem/System.Net.Security.Tests/analysis/xunit/System.Net.Security.Tests.NegotiateStreamTest~2FNegotiateStream_EchoServer_ClientWriteRead_Successive_Async_Success

The test System.Net.Security.Tests.NegotiateStreamTest/NegotiateStream_EchoServer_ClientWriteRead_Successive_Async_Success has failed.

Assert.True() Failure
Expected: True
Actual: False

    Stack Trace:

       at System.Net.Security.Tests.KDCSetup.CheckAndClearCredentials(ITestOutputHelper output) in /root/corefx-1003914/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs:line 93
   at System.Net.Security.Tests.NegotiateStreamTest..ctor(KDCSetup fixture, ITestOutputHelper output) in /root/corefx-1003914/src/System.Net.Security/tests/FunctionalTests/NegotiateStreamTestForUnix.cs:line 168

Build : Master - 20170920.02 (Core Tests)
Failing configurations:

  • Ubuntu.1604.Amd64-x64
    • Debug

@KristinXie1
Copy link

These tests all failed with "Xunit.Sdk.TrueException" in outerloop_netcoreapp_ubuntu16.04_debug, detail: https://ci.dot.net/job/dotnet_corefx/job/master/job/outerloop_netcoreapp_ubuntu16.04_debug/180/testReport/

@wfurt
Copy link
Member

wfurt commented Oct 16, 2017

It seems like this got broken by dotnet/corefx#24017
When I revert the change the test can pass OK on Ubuntu17.
It seems like with the change we cannot longer execute binaries on PATH.

The negotiate tests seems problematic as they try to install packages during test runs as well as they can mark test as Pass even if the test was not executed.
I'm inclined to track that as separate issue.

@wfurt
Copy link
Member

wfurt commented Oct 16, 2017

actually, it may have been dotnet/corefx#23705 . The execution on Unix with shell seems broken. I'll do more testing.

@Priya91
Copy link
Contributor

Priya91 commented Dec 11, 2017

This should be fixed by dotnet/corefx#24682

@Priya91 Priya91 closed this as completed Dec 11, 2017
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net.Security os-linux Linux OS (any supported distro) test-run-core Test failures in .NET Core test runs
Projects
None yet
Development

No branches or pull requests

7 participants