JDK-8058658 : [TEST_BUG] Test sun/security/smartcardio/TestDirect.java fails for Mac OSX 10.9
  • Type: Bug
  • Component: security-libs
  • Sub-Component: javax.smartcardio
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: os_x
  • CPU: generic
  • Submitted: 2014-09-17
  • Updated: 2014-09-26
  • Resolved: 2014-09-26
Related Reports
Relates :  
Relates :  
Relates :  
Description
Test name(s): sun/security/smartcardio/TestDirect.java
JDK tested: 8u40b05,8u40b02
OS tested:Mac OsX
Is it a regression? No 
Regression introduced in release/build: N/A 
               
Is it platform specific? Yes 
      
The is failure reproduced: Mac OSX 10.9

----------System.err:(13/712)----------
java.lang.Exception: No card terminals available
	at TestDirect.main(TestDirect.java:45)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:745)

JavaTest Message: Test threw exception: java.lang.Exception: No card terminals available
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.Exception: No card terminals available
result: Failed. Execution failed: `main' threw exception: java.lang.Exception: No card terminals available


test result: Failed. Execution failed: `main' threw exception: java.lang.Exception: No card terminals available
Comments
RFE filed: JDK-8059212
26-09-2014

I see that there are more than one test, I thought it is only one. In this case RFE is ok. I close this bug and will make an RFE.
26-09-2014

My point is that this failure of TestDirect.java does not demonstrate any broken functionality, but rather a (presumably bad) way how ALL these smartcardio tests are written. Thus, I don't see a good point in fixing this only test only because it was introduced with a recent change, but leave all the other tests as they are.
26-09-2014

When I run all the (manual) tests from the same directory on a machine without cardreader, I see this output: ------------------------------------- runner starting test: sun/security/smartcardio/TestChannel.java runner finished test: sun/security/smartcardio/TestChannel.java Failed. Execution failed: `main' threw exception: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: PC/SC, provider: SunPCSC, class: sun.security.smartcardio.SunPCSC$Factory) runner starting test: sun/security/smartcardio/TestConnect.java runner finished test: sun/security/smartcardio/TestConnect.java Failed. Execution failed: `main' threw exception: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: PC/SC, provider: SunPCSC, class: sun.security.smartcardio.SunPCSC$Factory) runner starting test: sun/security/smartcardio/TestConnectAgain.java runner finished test: sun/security/smartcardio/TestConnectAgain.java Failed. Execution failed: `main' threw exception: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: PC/SC, provider: SunPCSC, class: sun.security.smartcardio.SunPCSC$Factory) runner starting test: sun/security/smartcardio/TestControl.java runner finished test: sun/security/smartcardio/TestControl.java Failed. Execution failed: `main' threw exception: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: PC/SC, provider: SunPCSC, class: sun.security.smartcardio.SunPCSC$Factory) runner starting test: sun/security/smartcardio/TestDefault.java runner finished test: sun/security/smartcardio/TestDefault.java Failed. Execution failed: `main' threw exception: java.lang.Exception: no terminals runner starting test: sun/security/smartcardio/TestDirect.java runner finished test: sun/security/smartcardio/TestDirect.java Failed. Execution failed: `main' threw exception: java.lang.Exception: No card terminals available runner starting test: sun/security/smartcardio/TestExclusive.java runner finished test: sun/security/smartcardio/TestExclusive.java Failed. Execution failed: `main' threw exception: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: PC/SC, provider: SunPCSC, class: sun.security.smartcardio.SunPCSC$Factory) runner starting test: sun/security/smartcardio/TestMultiplePresent.java runner finished test: sun/security/smartcardio/TestMultiplePresent.java Failed. Execution failed: `main' threw exception: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: PC/SC, provider: SunPCSC, class: sun.security.smartcardio.SunPCSC$Factory) runner starting test: sun/security/smartcardio/TestPresent.java runner finished test: sun/security/smartcardio/TestPresent.java Failed. Execution failed: `main' threw exception: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: PC/SC, provider: SunPCSC, class: sun.security.smartcardio.SunPCSC$Factory) runner starting test: sun/security/smartcardio/TestTransmit.java runner finished test: sun/security/smartcardio/TestTransmit.java Failed. Execution failed: `main' threw exception: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: PC/SC, provider: SunPCSC, class: sun.security.smartcardio.SunPCSC$Factory) Test results: failed: 10 ------------------------------------- Now, it's not that clear to me, why TestDirect.java should be made different from all the other related tests? I.e. why shouldn't it fail when all the others do? If you believe all these tests should be modified, wouldn't it be more logical to create a RFE with such a request?
26-09-2014

Most manual tests have a GUI instruction. Even if they are not Java client tests.
26-09-2014

This test should not fail if card reader is not available. It should check for card reader availability and tell the tester to skip the test in this case. Perhaps a GUI instruction is needed for this.
26-09-2014

Thanks for confirming! Closing as not an issue then.
19-09-2014

According to the blog I checked and found that USBSmartCardReader is not present in stt-mac-05.ru.oracle.com.
18-09-2014

When I run pcsctest command on that host, I see no cardreaders available. ------------ stt-mac-05:~ gtee$ pcsctest MUSCLE PC/SC Lite Test Program Testing SCardEstablishContext : Service not available. ----------- This might be a problem with the pcscd daemon, but I cannot restart it myself having only regular user permissions. Please refer to this blogpost for more information: http://ludovicrousseau.blogspot.co.uk/2014/03/level-1-smart-card-support-on-mac-os-x.html
18-09-2014

Were there any cardreaders installed on the host?
17-09-2014

RULE sun/security/smartcardio/TestDirect.java Exception java.lang.Exception: No card terminals available
17-09-2014