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

Two test failures in NegotiateSecurityFilterTests #533

Open
michael-o opened this issue Jun 7, 2017 · 5 comments
Open

Two test failures in NegotiateSecurityFilterTests #533

michael-o opened this issue Jun 7, 2017 · 5 comments

Comments

@michael-o
Copy link

michael-o commented Jun 7, 2017

mvn test tells me:

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   NegotiateSecurityFilterTests.testChallengeNTLMPOST:275 expected:<1> but was:<3>
[ERROR]   NegotiateSecurityFilterTests.testChallengeNTLMPUT:304 expected:<1> but was:<3>
[INFO]
[ERROR] Tests run: 46, Failures: 2, Errors: 0, Skipped: 5
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] waffle-parent ...................................... SUCCESS [  6.530 s]
[INFO] waffle-jna ......................................... SUCCESS [  8.689 s]
[INFO] waffle-tests ....................................... FAILURE [ 10.655 s]

Debugging the test in Eclipse tells me that this code block is used:

public SecurityFilterProviderCollection(final IWindowsAuthProvider auth) {
    this.providers.add(new NegotiateSecurityFilterProvider(auth));
    this.providers.add(new BasicSecurityFilterProvider(auth));
}

so there are always three WWW-Authenticate values: Negotiate, NTLM, Basic realm="..."

Turning both values to 3 gives me:

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   NegotiateSecurityFilterTests.testChallengeNTLMPOST:276
[ERROR]   NegotiateSecurityFilterTests.testChallengeNTLMPUT:305
[INFO]
[ERROR] Tests run: 46, Failures: 2, Errors: 0, Skipped: 5
[INFO]

The reason for this subsequent failures is

  1. Assert.assertTrue(wwwAuthenticates[0].startsWith("NTLM ")); the index is incorrect
  2. the missing NTLM type 2 message.

even turning that assertion off gives me:

[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR]   NegotiateSecurityFilterTests.testChallengeNTLMPOST:278 expected:<[keep-aliv]e> but was:<[clos]e>
[ERROR]   NegotiateSecurityFilterTests.testChallengeNTLMPUT:306 expected:<3> but was:<2>
[INFO]

In case of NTLM, close makes absolutely no sense here.

My machine (Windows 7 Enterprise) is part of a forest. Just created a Windows 10 Pro VM in VirtualBox which is not joined with any domain. The test passes. So these tests don't seem to be portable for me. Are they?

@hazendaz
Copy link
Member

@michael-o For me these have always worked. I'm not on a domain on my home machine so I'm sure that has something to do with it. I haven't seen others with issues so I suspect this maybe a rare case. What I can say is that neither travis ci or appvoyer even run tests due to other issues. So if you have time and can write some better tests that still cover the necessary items, I would say go for it and I can merge it in.

@michael-o
Copy link
Author

michael-o commented Jun 11, 2017

@hazendaz Do you have a chance to test this in a domain? I highly suspect that this is the case.

@hazendaz
Copy link
Member

@michael-o Yes I can try this later this week.

@hazendaz
Copy link
Member

@michael-o Sorry for delay. I'm unable to test on a machine with a domain due to some restrictive policies. When I get some more time I'll try turning tests back on for appvoyer and hopefully can flush out these issues there.

@michael-o
Copy link
Author

@hazendaz Sure thing, don't hurry. I am busy myself. I'll see wether I can reproduce this with a new Samba version on a Windows 7 joined machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants