RFR: 8215916: The failure reason of an optional JAAS LoginModule is not logged

Jayashree Huttanagoudar duke at openjdk.org
Fri Jul 15 13:06:51 UTC 2022


On Fri, 8 Jul 2022 13:12:23 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Could you please review the changes?
>> This patch is to address : https://bugs.openjdk.org/browse/JDK-8215916?jql=labels%20%3D%20starter-bug
>
> `SmartLoginModule.java` is a class used by a test, itself is not one since there's no `main()` method.
> 
> Your new test needs to be a regression test, which means before the fix it fails and after the fix it succeeds. Also, seeing the exception message in a jtreg output with your own eyes is not a test. The test itself should detect the exception and decide whether it's a success or a failure. In the case, I'd recommend you use the `System.setErr` method to store the output into a `ByteArrayOutputStream` and then look into it.

@wangweij I was trying to add a tets case(I can say its still primary version of the test case. Still there are modifications needed)
First I wanted to make it fit with framework with suitable annotations like `@test` `@compile` and `@run` etc. 

When I am trying the below command, its failing with some exit status which I am unable to find why! :

# jtreg/bin/jtreg -jdk:/root/jdk/build/linux-x86_64-server-release/images/jdk/ -verbose test/jdk/javax/security/auth/login/LoginContext/jaaslogin/
runner starting test: javax/security/auth/login/LoginContext/jaaslogin/sample/SampleAcn.java
runner finished test: javax/security/auth/login/LoginContext/jaaslogin/sample/SampleAcn.java
Failed. Unexpected exit from test [exit code: 255]
Test results: failed: 1
Report written to /root/jdk/JTreport/html/report.html
Results written to /root/jdk/JTwork
Error: Some tests failed or other problems occurred.

I will also investigate further but if you notice something evident could you please let me know whats wrong here?

-------------

PR: https://git.openjdk.org/jdk/pull/9159



More information about the security-dev mailing list