Share via


Smart Card Reader Insertion/Removal Test (Compact 7)

3/12/2014

The Smart Card Reader Insertion/Removal Test checks whether inserting and removing the smart card reader results in the appropriate smart card subsystem state.

Note: If the device being tested has a display, the display shows instructions for running the test, status of the test, and test results. If the device being tested does not have a display screen, instructions, status, and test results display in the Output window for Platform Builder.

Test Prerequisites

Your device must meet the following requirements before you run this test.

The following table shows the hardware requirements for the Smart Card Reader Insertion/Removal Test.

Requirements Description

Smart card reader

The smart card reader that you want to test

Any of the cards included in the PC/SC Test Cards v.2.0

You can obtain a list of these cards from the PC/SC Workgroup Web site:http://www.pcscworkgroup.com/

The following table shows the software requirements for the Smart Card Reader Surprise Removal test.

Requirements Description

Tux.exe

Test harness, which executes the test

Kato.dll

Logging engine, which logs test data

IFDTestTux.dll

The Tux DLL that contains the tests

USBCCID.dll or other smart card reader driver DLL

The smart card reader driver

Subtests

The table below lists the subtests included in this test.

SubTest ID Description

2000

Smart Card Reader Insertion and Removal Test

Setting Up the Test

This test has no additional requirements, beyond the standard test environment setup.

Running the Test

The Smart Card Reader Insertion and Removal Test verifies that insertion or removal of a smart card reader leaves the smart card subsystem in an appropriate state.

Command Syntax:

tux -o -d ifdtesttux -c "[-n iterations] [-p iterations] [-c]" [-x TestCaseID]

Command-line parameter Description

-x TestCaseID

Specifies the test case to run.

-n iterations

Specifies how many times to run the test. The default value of iterations is 1. To repeat indefinitely, set the value of iterations to 0.

-p iterations

Specifies the number of insertion and removal cycles that the test performs before executing AutoIFD.

-c

Specifies that the test never requests that the smart card be removed after AutoIFD completes. This parameter is useful for automating stress testing.

To run this test by using the default values, at the command line type : s tux -o -d ifdtesttux -x 2000

The following examples show command lines and describe the corresponding behavior of the test.

tux -o -d ifdtesttux -x2000

*Runs one iteration of the entire test.

*Requires detaching and attaching the smart card reader 5 times during the test.

tux -o -d ifdtesttux -x2000 -c "-n 5 -p 3 -c"

*Runs five iterations of the entire test.

*Requires detaching and attaching the smart card reader 3 times during each iteration of the test.

*Does not require the card be removed from the card reader on each iteration of the test.

To run the Smart Card Reader Insertion and Removal Test

======================================

1.Specify the number of iterations of the entire test by using the -c "-n <test_iterations>" command-line parameter. If you run the test with the default command line, the entire test runs once.

2.Specify the number of times per iteration of the test that the smart card reader is detached and attached by using the -c "-p <iterations>" command-line parameter.

If you run the test with the default command line, you must detach and attach the smart card reader 5 times per iteration of the test.

By default, the test requires that you remove the smart card from the card reader after completion of AutoIFD on alternating iterations of the test. You can configure the test to bypass this requirement by specifying the -c "-c" command-line parameter.

3.Detach the smart card reader from the system and then attach the smart card reader to the system. Continue to detach and attach the smart card reader as many times as specified when setting up the test.

The test opens a handle to the card reader and runs AutoIFD, which is the one-card version of the smart card protocol tests. For more information, see Smart Card Reader Test (IFDTest2).

After it has finished running AutoIFD, the test closes the handle to the smart card reader.

Verifying the Test

When the test completes running, verify that "PASS" appears in the test log for all sub-tests.

Troubleshooting the Test

The following table describes troubleshooting tips for the Smart Card Reader Insertion and Removal Test.

Issue Solution

Test fails when using legacy drivers.

Certain legacy drivers, such as STCUSB.DLL, require that calls to IOCTLs be made from the kernel. If they are not made from the kernel, the test fails.To work around this issue, run Tux using the -n parameter:tux -o -n -d ifdtesttux

When you are running these test cases on a Windows Embedded Compact PC-based development platform (CEPC), if the Smart Card reader is inserted before you turn on the CEPC, USBCCID.dll is not loaded when the CEPC is turned on.

After you turn on the CEPC, remove the Smart Card reader from the CEPC, and then reinsert it.

For additional platform specific issues, consult the CTK articles on the TechNet wiki.

See Also

Other Resources

Smart Card Tests