Power Manager IOCTLs Test (Compact 7)
3/12/2014
The Power Manager IOCTLs Test verifies the implementation Power Manager IOCTLs in power manageable device drivers. The three IOCTLs verified by this test include:
* IOCTL_POWER_CAPABILITIES
* IOCTL_POWER_GET
* IOCTL_POWER_SET
The test will toggle the power states of all the power manageable devices on the system. This may temporarily affect the state of the system. The test will attempt to restore the original power state of each device after the test completes.
Test Prerequisites
Your device must meet the following requirements before you run this test.
The following prerequisites are required for this test.
Hardware Prerequisites:
In order to run the test, the platform and/or device drivers should have power management capabilities.
Software Prerequisites:
Having the SYSGEN_PM sysgen variable set when building your OS image will include the Power Manager.
The following table shows the software requirements for this test.
Requirement | Description |
---|---|
Tux.exe |
Tux test harness that executes the test. |
Kato.dll |
Logging engine that logs test data. |
Ktux.dll |
Required to run the tests in kernel mode. |
pwrtstioctls.dll |
Test library |
Subtests
The table below lists the subtests included in this test.
SubTest ID | Description |
---|---|
1001 |
This test checks implementation of IOCTL_POWER_CAPABILITIES. The test will iterate through Power Managed devices and for each it tries to get the power capabilities and verifies if power state D0 is supported. |
1002 |
This test checks implementation of IOCTL_POWER_GET. The test will iterate through Power Managed devices and for each it tries to get the current power state and verifies if it is a valid one (is one of D0 to D4), and is supported by the device as advertised by its POWER_CAPABILITIES. The Power Manager API, GetDevicePower, is used to obtain the device power state. |
1003 |
This test checks implementation of IOCTL_POWER_SET. The test will iterate through Power Managed devices and for each it cycles through all possible power states(D0 through D4)and tries to set the device to each of the power states. The test will then verify that a supported power state is set and an unsupported power state is not set. The Power Manager API, SetDvicePower, is used to set the device power state. |
1004 |
This test gets the user given device name and checks if it is a power-manageable device. Then checks the following: 1. It prints out the power capabilities of the device and verifies that power state D0 is supported. 2. It gets the current power state and verifies if it is a valid one, and if it is supported by the device as advertised by its Power_Capabilities. 3. It cycles through all possible power states(D0 through D4) and tries to set the device to each of the power states. It then verifies that a supported power state is set and an unsupported power state is not set. |
Setting Up the Test
This test has no additional requirements, beyond the standard test environment setup.
Running the Test
The Power Manager IOCTLs Test executes the tux -o -n -d pwrtstioctls.dll command line on default execution.
There are no command line parameters for this test.
Verifying the Test
When the test completes running, verify that "PASS" appears in the test log for all sub-tests.
Troubleshooting the Test
Failure of the tests is most commonly due to bugs in the implementation of Power IOCTLs:
*IOCTL_POWER_CAPABILITIES
*IOCTL_POWER_GET
*IOCTL_POWER_SET
Check the relevant driver in which the test failed for these IOCTLs.
This test will toggle the power states of all the power manageable devices on the system. This may temporarily affect the state of the system. The test will attempt to restore the original power state of each device after the test completes. The device may need to be reset after the test if a device does not respond properly.
For additional platform specific issues, consult the CTK articles on the TechNet wiki.