LED Service Hw Test
LED tests help verify that the LEDs on the switch are working correctly. Our LED tests trigger different sequences of LED blinking / color changes based on the test, config, and BSP mapping.
Steps to Run LED Tests
Compile the
led_service_hw_testbinary by following instructions on the build page.Copy the binary onto the switch.
Create a file named
/tmp/led.confon your switch, with your platform name (PLATFORM_NAME) as follows:{
"defaultCommandLineArgs": {
"mode": "PLATFORM_NAME"
},
"ledControlledThroughService": false
}Run the LED color change test:
./led_service_hw_test --gtest_filter=LedServiceTest.checkLedColorChange --led-config /tmp/led.conf --visual_delay_sec 1This test is successful if the following sequence occurs:
- Both LEDs turn on.
- Both LEDs turn off.
- Second LED turns on, then turns blue, then turns yellow.
Run the LED blinking test:
./led_service_hw_test --gtest_filter=LedServiceTest.checkLedBlinking --led-config /tmp/led.conf --visual_delay_sec 1This test is successful if the LEDs are blinking blue and yellow.
Expected Tests to Pass
| Test Name | Basic Link Tests |
|---|---|
| LedServiceTest.checkLedColorChange | Checks that LEDs can turn on/off, change color between blue and yellow. |
| LedServiceTest.checkLedBlinking | Checks that LEDs can blink between different colors. |