Skip to content

RDKEMW-11734: Adding vDevice Tests#412

Open
Araviiiiiii wants to merge 1 commit into
developfrom
topic/11734_vdeviceTests
Open

RDKEMW-11734: Adding vDevice Tests#412
Araviiiiiii wants to merge 1 commit into
developfrom
topic/11734_vdeviceTests

Conversation

@Araviiiiiii

Copy link
Copy Markdown
Contributor

Adding the vDevice end to end testcases that can be run inside qEmu.

Copilot AI review requested due to automatic review settings May 22, 2026 10:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new Tests/vDeviceTests Python-based vDevice end-to-end test suite intended to run inside QEMU, including an HDMI CEC Source suite and an LED Indicator suite, plus a simple suite runner and supporting docs/API command definitions.

Changes:

  • Added suiteManager.py to load and execute suite test modules and print a consolidated summary.
  • Added multiple HDMI CEC Source testcases (TCID001TCID024) plus shared logging/curl utilities and API curl command definitions.
  • Added LED Indicator testcases plus LED JSON-RPC curl command definitions and a design document.

Reviewed changes

Copilot reviewed 33 out of 62 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
Tests/vDeviceTests/utils.py Shared logging helpers and curl-command execution helper.
Tests/vDeviceTests/HdmiCecSourceApis.py Curl command strings for HDMI CEC Source JSON-RPC methods.
Tests/vDeviceTests/TCID001.py HDMI CEC Source testcase: sendStandbyMessage.
Tests/vDeviceTests/TCID002.py HDMI CEC Source testcase: getDeviceList expected/actual comparison.
Tests/vDeviceTests/TCID003.py HDMI CEC Source testcase: getEnabled.
Tests/vDeviceTests/TCID004.py HDMI CEC Source testcase: getOTPEnabled.
Tests/vDeviceTests/TCID005.py HDMI CEC Source testcase: getVendorId.
Tests/vDeviceTests/TCID006.py HDMI CEC Source testcase: performOTPAction.
Tests/vDeviceTests/TCID007.py HDMI CEC Source testcase: sendKeyPressEvent.
Tests/vDeviceTests/TCID008.py HDMI CEC Source testcase: setEnabled(false) with reset in finally.
Tests/vDeviceTests/TCID009.py HDMI CEC Source testcase: setEnabled(true).
Tests/vDeviceTests/TCID010.py HDMI CEC Source testcase: setOSDName.
Tests/vDeviceTests/TCID011.py HDMI CEC Source testcase: setOTPEnabled(false).
Tests/vDeviceTests/TCID012.py HDMI CEC Source testcase: setOTPEnabled(true).
Tests/vDeviceTests/TCID013.py HDMI CEC Source testcase: setVendorId.
Tests/vDeviceTests/TCID014.py HDMI CEC Source testcase: getVendorId (variant).
Tests/vDeviceTests/TCID015.py HDMI CEC Source testcase: getOSDName.
Tests/vDeviceTests/TCID016.py HDMI CEC Source testcase combining vComponent commands + performOTPAction.
Tests/vDeviceTests/TCID018.py HDMI CEC Source testcase: vComponent add/remove device + getDeviceList checks.
Tests/vDeviceTests/TCID019.py HDMI CEC Source negative scenario around setEnabled/open-fail injection.
Tests/vDeviceTests/TCID020.py HDMI CEC Source negative scenario around getEnabled/getDeviceList and HAL overrides.
Tests/vDeviceTests/TCID021.py HDMI CEC Source scenario mixing vComponent commands + standby/OTP flow.
Tests/vDeviceTests/TCID022.py HDMI CEC Source scenario: menu language/CEC version + device list/remove flows.
Tests/vDeviceTests/TCID023.py HDMI CEC Source scenario: active/inactive source + routing change + view-on flows.
Tests/vDeviceTests/TCID024.py HDMI CEC Source scenario: standby + power status + OTP + power status.
Tests/vDeviceTests/suiteManager.py Test suite runner that imports and executes selected suite modules.
Tests/vDeviceTests/README.txt.txt Execution instructions for running suites in QEMU.
Tests/vDeviceTests/hdmiCec_vcomponent_design.md Design document for HDMI CEC vComponent behavior and YAML control plane.
Tests/vDeviceTests/ledIndicator/ledIndicatorApis.py Curl command strings for LEDControl JSON-RPC methods.
Tests/vDeviceTests/ledIndicator/TCID001_indicator.py LED Indicator testcase: getLEDState.
Tests/vDeviceTests/ledIndicator/TCID002_indicator.py LED Indicator testcase: getSupportedLEDStates.
Tests/vDeviceTests/ledIndicator/TCID003_indicator.py LED Indicator testcase: setLEDState.
Tests/vDeviceTests/ledIndicator/TCID004_indicator.py LED Indicator testcase: vComponent state emulation + setLEDState.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +47 to +48
HdmiCecSourceApis.set_enabled_true
)
return False
except json.JSONDecodeError:
log_error("Invalid JSON response")
log_error("TCID001 Failed ❌")
Comment on lines +7 to +19
cd entservices-inputoutput/vDeviceTests

python3 suiteManager.py Hdmicecsource # to execute hdmicecsource testcases


python3 suiteManager.py ledindicator


errors incase if any:-

hdmicec_post_command.sh not found -
here in the testcases add the path where hdmicec_post_command.sh script is present inside the qemu
for eg tmp/vDeviceTests/vHdmiCec/vComponent_configurations/hdmicec_post_command.sh No newline at end of file
Comment on lines +13 to +49
expected_output_response = {
"jsonrpc": "2.0",
"id": 42,
"result": {
"numberofdevices": 5,
"deviceList": [
{
"logicalAddress": 1,
"vendorID": "0099",
"osdName": "CECAdapter"
},
{
"logicalAddress": 4,
"vendorID": "0e036",
"osdName": "PIONEER"
},
{
"logicalAddress": 5,
"vendorID": "0a0de",
"osdName": "YAMAHA"
},
{
"logicalAddress": 6,
"vendorID": "01a11",
"osdName": "GOOGLE"
},
{
"logicalAddress": 7,
"vendorID": "00a1",
"osdName": "IPSTB"
},
{
"logicalAddress": 8,
"vendorID": "000",
"osdName": "Kishore"
}
],
Comment on lines +58 to +62
module_dir = str(suite_config["module_dir"])

if module_dir not in sys.path:
sys.path.insert(0, module_dir)

log_success("All commands executed successfully")
if not curl_response and count == 1: #here count is a flag to check the first scenario of wpeframework crash by negative scenario
log_success("No logs as WPEFramework has been crashed with erroneous HAL API Value configured by vComponent , so passing the testcase")
return True No newline at end of file
Comment on lines +64 to +68
if json.loads(curl_response) == expected_output_response:
log_success("TCID003 Passed ✅")
return True
else:
log_error("TCID003 Failed ❌")
Comment on lines +33 to +35
# Send the curl command using os.system module
response = os.popen(curl_command)

Comment on lines +51 to +52
except:
print("Inside Utils.py : Exception in send_curl_command function")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants