Compartir a través de


Notification LED Tests (Compact 2013)

3/26/2014

The Notification LED Tests suite exercises specific attributes of a notification LED (NLED) driver.

Test Prerequisites

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

The following table shows the hardware requirement for the Notification LED Test Suite.

Requirement

Description

Device with notification LED

Device under test must have NLED Driver

The following table shows the software requirements for the Notification LED Test Suite.

Requirement

Description

Tux.exe

Test harness, required for testing

Kato.dll

Logging engine, required for logging test results

Nledtest.dll

Test library

Other Prerequisites:

5012- NLED grouping test: At least 2 NLEDs need to be present in a NLED group before executing this test. The NLEDs having a similar group ID are termed to be in the same group. If this condition is not met, then this test is passed automatically.

6000 - 6012 - NLED Service tests: Configure the NLED device registry with NLED service events before executing the NLED service tests. If there are no events configured then all the NLED service tests are skipped automatically.

6005, 6006 - NLED service grouping test, NLED Service priority order test: At least 2 NLEDs need to be present in a NLED group before executing this test. The NLEDs having a similar group ID are termed to be in the same group. And at least 2 NLED service events need to be configured for these NLEDs before executing these tests, and if this condition is not met then the tests are skipped automatically.

7000 - 7006 - NLED blink control library tests: Make sure that there are at least 2 NLEDs to run 7002, 7004,7006 and at least 1 NLED to run 7000, 7001, 7005, which have the SWBlinkCtrl flag set to 1 before executing the blink control library tests. If this condition is not met, then the tests are skipped automatically.

Subtests

The table below lists the subtests included in this test.

SubTest ID

Description

1001

Get NLED Count Information Test:

Calls NLedGetDeviceInfo(NLED_COUNT_INFO_ID, pOutput), where pOutput is a pointer to a NLED_COUNT_INFO structure, and verifies that the return code is TRUE.

1002

Get NLED Supports Information Test:

Calls NLedGetDeviceInfo(NLED_SUPPORTS_INFO_ID, pOutput) for each NLED, where pOutput is a pointer to a NLED_SUPPORTS_INFO structure containing the correct NLED number, and it outputs the reported support information for each NLED and verifies that the return code is TRUE.

1003

Get NLED Settings Information Test:

Calls NLedGetDeviceInfo(NLED_SETTINGS_INFO_ID, pOutput) for each NLED, where pOutput is a pointer to a NLED_ SETTINGS_INFO structure with the correct NLED number, and it outputs the reported settings information for each NLED and verifies that the return code is TRUE.

1103

Set NLED Settings Information Test:

Calls NLedSetDevice(NLED_SETTINGS_INFO_ID, pOutput) for each NLED, where pOutput is a pointer to a NLED_SETTINGS_INFO structure with the correct NLED number, and it verifies that the return code is TRUE.

2000

Get Invalid Parameters Test:

Calls NLedGetDeviceInfo a series of times with various combinations of invalid parameters, and it verifies that the return code is FALSE in each case.

2001

Get NLED_INFO Invalid NLED Number:

Calls NLedGetDeviceInfo for both settings and supports information using an out of range NLED number, and it verifies that the return code is FALSE in each case.

2100

Set NLED_INFO Invalid Parameters:

Calls NLedSetDevice a series of times with different combinations of invalid parameters each time, and it verifies that the return code is FALSE in each case.

2101

Set NLED_INFO Invalid NLED Number:

Calls NLedSetDevice using an out of range NLED number and verifies that the return code is FALSE.

2102

Set NLED_INFO Invalid Blink Setting:

Calls NLedSetDevice for each of the settings in NLED_SETTINGS_INFO and verifies that it returns FALSE, and this is repeated for each of the NLEDs on the device.

3001

Verify Get NLED Count:

Calls NLedGetDeviceInfo(NLED_COUNT_INFO_ID, pOutput), where pOutput is a pointer to a NLED_COUNT_INFO structure. It verifies that the minimum number of NLEDs is returned. If user interaction has been enabled by including -i in the command line, then the user is prompted to confirm that the NLED count is correct.

3002

Verify Get NLED Supports:

Calls NLedGetDeviceInfo(NLED_SUPPORTS_INFO_ID, pOutput) for each NLED, where pOutput is a pointer to an NLED_SUPPORTS_INFO structure. And it displays the supports information, and it also verifies that no unsupportable combination of blinking option flags is set. And if user interaction has been enabled by including -i in the command line, then the user is prompted to verify the support info for each NLED.

3003

Verify and Validate Get NLED Settings:

Calls NLedGetDeviceInfo to get the NLED supports and settings info for each NLED. And it validates the settings information and verifies that it is consistent with the support information.

3103

Verify Set NLED Settings and Get NLED Settings:

Stores settings information in an NLED_SETTINGS_INFO structure, and passes the structure to NLedSetDevice. And it then calls NLedGetDeviceInfo(NLED_SETTINGS_INFO_ID, pOutput), where pOutput is a pointer to another NLED_SETTINGS_INFO structure. And it verifies that both structures contain identical information and that it is consistent with the supports information for the same NLED.

4100

LED Off/On/Off Test:

Uses NLedSetDevice to toggle each NLED from OFF to ON and back to the OFF state. And if interactive mode has been enabled, the user is prompted to observe each NLED and verify that it is in the expected state. This test also restores back the original settings when the test is finished, and if a state cannot be restored then that NLED is turned OFF.

4101

LED Off/Blink/Off Test:

Uses NLedSetDevice to toggle each NLED from OFF to BLINK and back to the OFF state. And if interactive mode has been enabled, the user is prompted to observe each NLED and verify that it is in the expected state. This test also restores back the original settings when the test is finished, and if a state cannot be restored then that NLED is turned OFF.

4102

LED Blink Cycle Time Test:

Uses NLedSetDevice to adjust the blinking rate of each NLED. And if interactive mode is enabled, the user is prompted to observe the NLED to verify that it responded as expected.

4103

LED Metacycle Blink Test:

Uses NLedSetDevice to adjust the number of ON and OFF blink cycles for each NLED. And if the interactive mode is enabled, then the user is prompted to observe the NLED to verify that it responded as expected.

5000

Verify NLED Blinking:

Verifies the NLED blinking functionality.

5001

Set NLED_SETTINGS Invalid Params Test:

Tests the LED driver's ability to behave gracefully when invalid parameters are passed.

5003

Verify Nled Index:

This test checks that the NLED index in the registry starts from 0 and is sequential.

5005

Verify Get NLED_SUPPORTS_INFO:

Calls NLedSetDevice multiple times with different setting combinations and checks that it returns true every time, and it also calls the NledGetDeviceInfo function each time to get the support information. And it then verifies that NledGetDeviceInfo function returns true for only the combinations that are supported.

5006

Verify Get NLED_SUPPORTS for (MetaCycle[On][Off]):

Calls NledGetDeviceInfo for each NLED and it verifies that only the supported combinations of MetaCycle [ON][OFF] are returned.

5007

Verify Get NLED_SUPPORTS for([TotalCycle][On][Off]Time):

Calls NledGetDeviceInfo for each NLED and it verifies that only the supported combinations of TotalCycleTime, OnTime and OffTime are returned.

5008

Verify Suspend Resume for Driver and BlinkCtrl Library:

Tests the NLED driver's ability to restore the NLED state after a device is suspended and then resumed.

5009

Verify NLED Registry Count:

This test verifies whether the number of NLEDs returned by NledGetDeviceInfo function is equal to the number of NLEDs configured in the registry.

5010

NLED Driver Registry Robustness Tests:

This test verifies that the NLED driver behaves gracefully when some or all of the NLED registry keys have invalid values.

5011

Verify Nled Registry Settings:

This test verifies that the NLED registry settings are correctly configured.

5012

NLED Grouping Test:

This test turns ON all the NLEDs present in any NLED group and verifies that only one NLED is in active state at a given time; thus, it verifies the NLED grouping functionality.

5013

Verify NLED GetTypeInfo:

This test verifies the NLED type for a LED and a Vibrator.

5014

Check System Behavior Test:

Calls NLedSetDevice multiple times by passing different parameters for one/all the NLEDs simultaneously over a period of time, and it checks whether the NLED driver is able to handle this condition gracefully or not.

6000

NLED Service Event Path Mapping Test:

This test verifies that Event -> LED path mapping works by setting the event and corresponding NLED number in the registry [HKEY_LOCAL_MACHINE\Services\NLEDSRV\Config\...] and it also verifies that the NLED is activated when the corresponding event occurs.

6001

NLED Service Blinking Test:

This test updates the registry for each NLED to either ON/OFF/BLINK and verifies that the NLED behaves as expected when the trigger event occurs. It also verifies that if an NLED is configured to blink but no blink parameters are set, then the NLED will blink with default parameters.

6002

NLED Service Blink Settings Test:

This test updates the blink setting values in the registry for an NLED that is capable of blinking and it then verifies that the NLED blinks with those settings.

6003

Nled Service Event Delay Test:

This test verifies whether the delay between firing an event and the resultant NLED state change is within a specified limit or not. And this test is done for the first NLED that has at least one event configured.

6004

Nled Service Validation Test:

This test sets an NLED to blink using NLED service and at the same time it turns the same NLED off by invoking NledSetDevice, and then it verifies if the NLED service is stable or not.

6005

NLED Service Grouping Test:

This test verifies that only one NLED event (i.e. The highest priority one) is in the ON state at any given time in a Group.

6006

NLED Service Priority Test:

This test checks if proper priority order is followed or not when all the events are triggered one by one for a NLED. And it also checks that when all the other high priority events are cleared the lower priority event is still executing.

6007

NLED Service Blink Off Test:

  1. This test raises the event of an NLED to turn it ON/OFF/BLINK through NLED Service and checks if the state of the NLED is changing accordingly or not. And it then invokes the Core DLL NLED APIs to change the state of the same NLED. And it then checks that NLED service and NLED driver handle this scenario gracefully.

6008

NLED Service Same Priority Test:

Checks that NLED service gracefully handles the error scenario of two or more events of an NLED having the same priority within a Group.

6009

NLED Service without Priority Test:

Checks that NLED service gracefully handles the error scenario of one or more NLED service events of an NLED having no priority field.

6010

NLED Service Suspend Resume Test:

Checks that NLED Service successfully restores the NLED state after a device suspend resumes.

6011

Nled Continuous state changes for each LED:

Checks that NLED service behaves gracefully when the corresponding events of all the NLEDs are continuously changing the states of those NLEDs.

6012

NLED Service Robustness Tests:

Checks that NLED Service behaves gracefully when some or all of the NLED service registry keys have invalid values.

7000

NLED Blink Control Library SetLed() Test:

Checks that BlinkCtrl Library succeeds in blinking an NLED.

7001

NLED Blink Control Library Verify Registry Settings Test:

Checks that if the "SWBlinkCtrl" flag is present for any NLED then it has valid values (i.e. '0' or '1'). And it also checks that for any NLED if "SWBlinkCtrl" flag is set to '1' then "BLINKABLE" flag should be set to '0'.

7002

NLED CPU Utilization Test:

Checks that the increase in CPU utilization when all the NLEDs are blinking does not exceed a predefined limit.

7004

NLED Blink Control Library Blink OFF Blink Test:

Sets all NLEDs to BLINK state, and then turns the NLEDs to OFF one by one and lets only one of the NLEDs in the blinking state. And it then verifies if the last NLED still continues to Blink or not.

7005

NLED Blink Control Library Verify Blink Time Test:

Checks if the NLED being blinked by the Blink Ctrl library is blinking with correct timing or not.

7006

NLED Blink Control Library Check System behavior Test:

This test continuously changes the values of the members of struct NLED_SETTINGS_INFO and makes the NLED/NLEDs to Blink/ON/OFF and checks whether the BlinkCtrl Library handles this scenario gracefully or not.

8001

NLED Driver Memory Utilization Test:

Checks that the increase in memory utilization does not exceed a predefined limit when the states of all the NLEDs are continuously changing .

8002

NLED BlinkCtrl Lib Memory Utilization Test:

Checks that the increase in memory utilization does not exceed a predefined limit when all the NLEDs having blink control library configured are blinking .

Setting Up the Test

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

Running the Test

Command line parameters for the Notification LED Test Suite :

Run the Notification LED Test Suite by executing the command line s tux -o -d nledtest in a command window.

The Notification LED Test Suite can have one or more optional command line parameters to modify test behavior. To specify command line options, use the -c command line option for Tux. For more information about command line parameters for Tux.exe, see Tux Command-Line Parameters.

The following table shows the command line parameters for the Notification LED Driver Test.

Command line parameter

Description

-?

Displays all command line options along with their description.

-i

Runs in interactive mode; default is to run in non-interactive mode. This parameter affects test cases 3001-3003, 4100-4103, 5005, 5013, 7005.

-n #

Specifies the minimum number of NLEDs required; default is 0. This parameter affects test case 3001.

-v

Vibrator required; default is no vibrator required. This parameter affects test case 3002.

-gen

Only enables basic NLED driver related tests

-ser

Only enables NLED service and basic tests(1001-4103)

-auto

Only enables automatic tests

-pqd

Enables robustness and performance tests in addition to basic tests(1001-4103)

-cpt #

Specifies the max allowed % CPU utilization increase during test run. Default value is 1. This option affects test case 7002

-mt #

Specifies the max allowed % memory utilization increase during test run. Default value is 1. This option affects test case 8001, 8002

-td #

Specifies the max allowed time delay between an event being fired and the corresponding NLED state change to happen. This option affects test case 6003.

Verifying the Test

When the test completes running, verify that "PASS" appears in the test log for all subtests

Troubleshooting the Test

The following table shows troubleshooting suggestions for test cases in the Notification LED Test Suite.

Test case

Suggestion

3001

Use -i parameter to run in interactive mode. Use -n parameter to specify minimum number of NLEDs required.

3002

Use -i parameter to run in interactive mode. Use -v parameter to specify that a vibrator is required.

3003, 4100-4103,5005, 5013, 7005

Use -i parameter to run in interactive mode

5000

This test may skip if there is no NLED on the device that has the Blinkable registry key set to 1

5010

This test is automatically passed if all the notification devices are vibrators

5008,6010

These tests may not be run thru CTK as the tests attempt to suspend-resume the device. This causes the CTK to disconnect from device. The test may be run via Platform Builder.

6000-6010

These tests are skipped if NLED service events are not configured in the registry

6003

Use -td parameter to specify the max allowed time delay value

7000-7006

These tests are skipped if there is no NLED that has the "SWBlinkCtrl" registry flag set to 1

7002

This test may fail if the % CPU utilization increases the specified maximum value (1 by default). Use -cpt parameter to specify the max allowed CPU utilization value

8001, 8002

This test may fail if the % memory utilization increases the specified maximum value (1 by default). Use -mt parameter to specify the max allowed memory utilization value

See Also

Other Resources

NLED Test