message to request the audio status if HAL Api values are passed negative")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# store the expected output response
+Utils.initialize_flask_with_HalApiNegativeValues()
+expected_output_response = '{"jsonrpc":"2.0","id":42,"error":{"code":1,"message":"ERROR_GENERAL"}}'
+
+
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.sendGetAudioStatusMessage)
+if curl_response:
+ Utils.info_log("curl command to send audio status message is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+time.sleep(3)
+
+#ToDo - send message emulation for report audio status message event[reportAudioStatusEvent Triggered when CEC message of device is received.]
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportShortAudioDes)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the reportShortAudioDes")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the reportShortAudioDes")
+time.sleep(3)
+print("")
+
+time.sleep(3)
+
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportAudioMode)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the reportAudioMode")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the reportAudioMode")
+time.sleep(3)
+print("")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The send audio status message and report audio sytatus event ' \
+ 'is obtained in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID045_HdmiCecSink_getAudioStatusMessageNegative'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initialize_flask()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSink/TCID_046_HDMICECSINK_HALNegativeReturn.py b/Tests/L2HALMockTests/TestCases/HdmiCecSink/TCID_046_HDMICECSINK_HALNegativeReturn.py
new file mode 100644
index 00000000..f2aecd44
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSink/TCID_046_HDMICECSINK_HALNegativeReturn.py
@@ -0,0 +1,43 @@
+# Testcase ID : TCID046_HalNegative
+# Testcase Description : Returns HDMI-CEC driver enabled status
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSink import HdmiCecSinkApis
+
+print("TC Description - Returns whether HDMI-CEC is enabled on platform or not.")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# store the expected output response
+Utils.initialize_hal_apis_with_negative_values()
+expected_output_response = '{"jsonrpc":"2.0","id":42,"error":{"code":1,"message":"ERROR_GENERAL"}}'
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.get_enabled)
+if curl_response:
+ Utils.info_log("curl command to get enabled is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The default driver status ' \
+ 'is obtained in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID046_HdmiCecSink_HAL_ReturnsNegative_and_string'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initialize_flask()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSink/TCID_047_HDMICECSINK_SetApisWithoutParamsNegative.py b/Tests/L2HALMockTests/TestCases/HdmiCecSink/TCID_047_HDMICECSINK_SetApisWithoutParamsNegative.py
new file mode 100644
index 00000000..30f94566
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSink/TCID_047_HDMICECSINK_SetApisWithoutParamsNegative.py
@@ -0,0 +1,144 @@
+# Testcase ID : TCID047_setApisWithoutParams
+# Testcase Description : send all set apis with default HAL values and without params in json rpc request
+import time
+from Utilities import Utils, ReportGenerator
+from HdmiCecSink import HdmiCecSinkApis
+
+print("TC Description - send all set apis with default HAL values and without params in json rpc request")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# store the expected output response
+Utils.initialize_flask()
+
+def wait():
+ time.sleep(2)
+
+expected_output_response = '{"jsonrpc":"2.0","id":42,"error":{"code":1,"message":"ERROR_GENERAL"}}'
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.sendKeyPress_withoutParams)
+if curl_response:
+ Utils.info_log("curl command to send key press without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.senduserContolledPress_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to send usercontrol key press without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.sendusercontrolledReleased_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to send user key release without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.setActivepath_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to set active path without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.setEnabled_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to set enable the driver without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.setMenuLanguage_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to set menu language without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.setMenuLanguage_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to set menu language without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.setOSDName_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to set OSD name without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.setRoutingChange_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to set routing change without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.setupARCRouting_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to setup ARC routing without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.setvendorID_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to set vendor id without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.setMenuLanguage_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to set menu language without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+wait()
+
+curl_response = Utils.send_curl_command(HdmiCecSinkApis.setLatencyInfo_withoutParams )
+if curl_response:
+ Utils.info_log("curl command to set latency info without params is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. error value ' \
+ 'is obtained in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID047_HdmiCecSink_setApis_withoutParams_Negative'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+#Reset the state of the mock system to original
+Utils.initialize_flask()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSink/TCID_Emulate.py b/Tests/L2HALMockTests/TestCases/HdmiCecSink/TCID_Emulate.py
new file mode 100644
index 00000000..aa1c14b6
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSink/TCID_Emulate.py
@@ -0,0 +1,205 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID005
+# Testcase Description : Verify that default vendor id is obtained in output response
+import time
+import json
+import Config
+import requests
+from Utilities import Utils, ReportGenerator
+from HdmiCecSink import HdmiCecSinkApis
+from HdmiCecSource import HdmiCecSourceApis
+
+print("TC Description - Verify that default vendor id is obtained in output response")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# store the expected output response
+Utils.initialize_flask()
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"success":true}}'
+
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportPhysicalAdd)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for reporting the physical address")
+else:
+ Utils.error_log("sendMessage emulation failed for reporting the physical address")
+time.sleep(3)
+print("")
+
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.DeviceVendorID)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for reporting the DeviceVendorID")
+else:
+ Utils.error_log("sendMessage emulation failed for reporting the DeviceVendorID")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.imageViewON)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the imageViewON")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the imageViewON")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.textViewON)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the textViewON")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the textViewON")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.routing_change)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the routing_change")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the routing_change")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.ignore_set_menu_language)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the ignore_set_menu_language")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the ignore_set_menu_language")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.set_osd_string)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the set_osd_string")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the set_osd_string")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.get_menu_language_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the get_menu_language_hisense")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the get_menu_language_hisense")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.feature_abort)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the feature_abort")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the feature_abort")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.abort_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the abort_hisense")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the abort_hisense")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.initiateArc)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the initiateArc")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the initiateArc")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.terminateArc)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the terminateArc")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the terminateArc")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportShortAudioDes)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the reportShortAudioDes")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the reportShortAudioDes")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.setSystemAudioMode)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the setSystemAudioMode")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the setSystemAudioMode")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportAudioMode)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the reportAudioMode")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the reportAudioMode")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.givefeatures)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the givefeatures")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the givefeatures")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.requestcurrentlatency)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the requestcurrentlatency")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the requestcurrentlatency")
+time.sleep(3)
+print("")
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/CecUtils.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/CecUtils.py
new file mode 100644
index 00000000..f6a2322f
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/CecUtils.py
@@ -0,0 +1,117 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# This file contains all the common functions required for test framework
+
+import requests
+import json
+import time
+import Config
+from Utilities import Utils
+from HdmiCecSource import HdmiCecSourceApis
+
+
+def cec_update_api_overrides(data):
+ '''This function is used to update the api overrides data. After updating the data we will
+ deactivate and then reactivate the HdmiCecSource plugin to reflect pushed changes'''
+ try:
+ # Change the values of api overrides for hdmi-cec plugin using updateAPIConfig API
+ api_overrides_response = requests.get("http://{}/Hdmicec.updateAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(data)))
+ print("Inside CecUtils.py : " + api_overrides_response.text + " : " + str(data))
+ time.sleep(3)
+
+ # Deactivate the plugin using curl command
+ Utils.send_curl_command(HdmiCecSourceApis.deactivate_command)
+
+ # Activate the plugin using curl command
+ Utils.send_curl_command(HdmiCecSourceApis.activate_command)
+ except:
+ print("Inside CecUtils.py : Exception in cec_update_api_overrides function")
+
+
+def cec_sink_tx_fail(data):
+ '''This function is used to update the api overrides data. After updating the data we will
+ deactivate and then reactivate the HdmiCecSource plugin to reflect pushed changes'''
+ try:
+ # Change the values of api overrides for hdmi-cec plugin using updateAPIConfig API
+ api_overrides_response = requests.get("http://{}/Hdmicec.updateAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(data)))
+ print("Inside CecUtils.py : " + api_overrides_response.text + " : " + str(data))
+ time.sleep(3)
+
+ # Deactivate the plugin using curl command
+ Utils.send_curl_command(HdmiCecSourceApis.deactivate_command)
+
+ # Activate the plugin using curl command
+ Utils.send_curl_command(HdmiCecSourceApis.activate_command)
+ time.sleep(5)
+ except:
+ print("Inside CecUtils.py : Exception in cec_update_api_overrides function")
+
+
+
+def cec_post_condition_for_negative_scenarios():
+ '''This function is used to update the api overrides data back to default. After updating the data
+ we will restart WPEFramework & Websocket services and then activate the HdmiCecSource plugin
+ again to reflect pushed changes'''
+ try:
+ # Change the values of api overrides data for hdmi-cec plugin back to default 0
+ api_overrides_response = requests.get("http://{}/Hdmicec.updateAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data)))
+ print("Inside CecUtils.py : Post-condition : " + api_overrides_response.text + " : " + str(Config.api_data))
+ # time.sleep(3)
+
+ # Restart the WPEFramework & Websocket services
+ Utils.restart_services()
+ # time.sleep(3)
+
+ # Store the expected output response for activate command
+ expected_output_response = '{"jsonrpc":"2.0","id":3,"result":null}'
+
+ # Send the controller activate curl command and fetch the output json response
+ curl_response = Utils.send_curl_command(HdmiCecSourceApis.activate_command)
+
+ # Compare both expected and received output responses
+ if str(curl_response) == str(expected_output_response):
+ print("Inside CecUtils.py : Post-condition : Successfully restarted the WPEFramework & "
+ "Websocket server services. Successfully activated the HdmiCecSource plugin")
+ else:
+ print("Inside CecUtils.py : Post-condition : Failed to restart the WPEFramework & "
+ "Websocket server services. Failed to activate the HdmiCecSource plugin")
+ except:
+ print("Inside CecUtils.py : Post-condition : Exception in cec_post_condition_for_negative_scenarios function")
+
+
+def activate_cec():
+ '''This function is used to activate the HdmiCecSource plugin'''
+ try:
+ # send the controller activate curl command and fetch the output json response
+ curl_response = Utils.send_curl_command(HdmiCecSourceApis.activate_command)
+
+ # compare both expected and received output responses
+ if str(curl_response) == str(HdmiCecSourceApis.expected_output_response):
+ print("Inside CecUtils.py : Successfully activated the HdmiCecSource plugin")
+ else:
+ print("Inside CecUtils.py : Failed to activate the HdmiCecSource plugin")
+ except:
+ print("Inside CecUtils.py : Exception in activate_cec function")
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/HdmiCecSourceApis.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/HdmiCecSourceApis.py
new file mode 100644
index 00000000..0c51dd6a
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/HdmiCecSourceApis.py
@@ -0,0 +1,129 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Curl command for activating HdmiCecSource plugin
+activate_command = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc":"2.0","id":"3"
+,"method": "Controller.1.activate", "params":{"callsign":"org.rdk.HdmiCecSource"}}' http://127.0.0.1:55555/jsonrpc'''
+
+# Curl command for deactivating HdmiCecSource plugin
+deactivate_command = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc":"2.0","id":"3"
+,"method": "Controller.1.deactivate", "params":{"callsign":"org.rdk.HdmiCecSource"}}' http://127.0.0.1:55555/jsonrpc'''
+
+# Store the expected output response for activate & deactivate curl command
+expected_output_response = '{"jsonrpc":"2.0","id":3,"result":null}'
+
+######################################################################################
+
+# HdmiCecSource Methods :
+
+get_device_list = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.getDeviceList"}' http://127.0.0.1:55555/jsonrpc'''
+
+send_standby_message = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0",
+"id": 42,"method":"org.rdk.HdmiCecSource.sendStandbyMessage"}' http://127.0.0.1:55555/jsonrpc'''
+
+get_vendor_id = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.getVendorId"}' http://127.0.0.1:55555/jsonrpc'''
+
+set_vendor_id = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42,
+"method":"org.rdk.HdmiCecSource.setVendorId","params": {"vendorid": "0x4455"}}' http://127.0.0.1:55555/jsonrpc'''
+
+get_osd_name = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.getOSDName"}' http://127.0.0.1:55555/jsonrpc'''
+
+set_osd_name = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42,
+"method":"org.rdk.HdmiCecSource.setOSDName","params": {"name": "CUSTOM8 TV"}}' http://127.0.0.1:55555/jsonrpc'''
+
+get_enabled = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.getEnabled"}' http://127.0.0.1:55555/jsonrpc'''
+
+set_enabled_false = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42,
+"method":"org.rdk.HdmiCecSource.setEnabled","params": {"enabled": false}}' http://127.0.0.1:55555/jsonrpc'''
+
+set_enabled_true = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42,
+"method":"org.rdk.HdmiCecSource.setEnabled","params": {"enabled": true}}' http://127.0.0.1:55555/jsonrpc'''
+
+get_active_source_status = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0",
+"id": 42,"method":"org.rdk.HdmiCecSource.getActiveSourceStatus","params": {"status": true}}' http://127.0.0.1:55555/jsonrpc'''
+
+get_otp_enabled = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.getOTPEnabled"}' http://127.0.0.1:55555/jsonrpc'''
+
+set_otp_enabled_false = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42,
+"method":"org.rdk.HdmiCecSource.setOTPEnabled","params": {"enabled": false}}' http://127.0.0.1:55555/jsonrpc'''
+
+set_otp_enabled_true = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42,
+"method":"org.rdk.HdmiCecSource.setOTPEnabled","params": {"enabled": true}}' http://127.0.0.1:55555/jsonrpc'''
+
+send_keypress_VOLUME_UP = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 65}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_VOLUME_DOWN = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 66}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_MUTE = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 67}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_UP = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 1}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_DOWN = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 2}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_LEFT = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 3}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_RIGHT = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 4}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_SELECT = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 0}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_HOME = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 9}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_BACK = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 13}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_NUMBER_0 = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 32}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_NUMBER_1 = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 33}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_NUMBER_2 = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 34}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_NUMBER_3 = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 35}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_NUMBER_4 = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 36}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_NUMBER_5 = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 37}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_NUMBER_6 = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 38}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_NUMBER_7 = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 39}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_NUMBER_8 = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 40}}' http://127.0.0.1:55555/jsonrpc'''
+send_keypress_NUMBER_9 = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id": 42,
+"method":"org.rdk.HdmiCecSource.sendKeyPressEvent", "params": {"logicalAddress": 0,"keyCode": 41}}' http://127.0.0.1:55555/jsonrpc'''
+
+perform_otp_action = '''curl --silent --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0", "id":42,
+"method":"org.rdk.HdmiCecSource.performOTPAction"}' http://127.0.0.1:55555/jsonrpc'''
+
+set_otp_enabled_invalid = '''curl --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0","id": 42,"method": "org.rdk.HdmiCecSource.setOTPEnabled","params": {"ennable": true}}' http://127.0.0.1:55555/jsonrpc'''
+
+set_osd_name_invalid = '''curl --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0","id": 42,"method": "org.rdk.HdmiCecSource.setOSDName","params": {"nnamme": "LG TV"}}' http://127.0.0.1:55555/jsonrpc'''
+
+set_vendor_id_invalid_1 = '''curl --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0","id": 42,"method": "org.rdk.HdmiCecSource.setVendorId","params": {"vendorid": "]]"}}' http://127.0.0.1:55555/jsonrpc'''
+
+set_vendor_id_invalid_2 = '''curl --header "Content-Type: application/json" --request POST -d '{"jsonrpc": "2.0","id": 42,"method": "org.rdk.HdmiCecSource.setVendorId","params": {"vllendorid": "]]"}}' http://127.0.0.1:55555/jsonrpc'''
+
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID001.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID001.py
new file mode 100644
index 00000000..c7dab53d
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID001.py
@@ -0,0 +1,146 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID001
+# Testcase Description : To verify that standby message is successfully triggered
+# and got proper logs in thunder. Hit the curl command for sendStandbyMessage and send the corresponding
+# messages to hal. Verify the output response. Also, wake up the devices by sending cec message as post condition
+import subprocess
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"success":true}}'
+
+print("TC Description - To verify that standby message is successfully triggered and get proper logs in thunder. Hit the curl command for sendStandbyMessage and send the corresponding messages to hal. Verify the output response. Also, wake up the devices by sending cec message as post condition")
+#send messages required for getting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+Utils.initiliaze_flask_for_HdmiCecSource()
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the powerstatus of TV")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the powerstatus of TV")
+time.sleep(3)
+print("")
+
+#send messages required for reporting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportPowerStatusMessage)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for reporting the powerstatus of TV")
+else:
+ Utils.error_log("sendMessage emulation failed for reporting the powerstatus of TV")
+time.sleep(3)
+print("")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.send_standby_message)
+if curl_response:
+ Utils.warning_log("send_standby_message curl command sent from the test runner")
+else:
+ Utils.error_log("send_standby_message curl command failed")
+
+# send messages required for getting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the powerstatus of TV")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the powerstatus of TV")
+time.sleep(3)
+print("")
+
+#send messages required for reporting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportPowerStatusMessage)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for reporting the powerstatus of TV")
+else:
+ Utils.error_log("sendMessage emulation failed for reporting the powerstatus of TV")
+time.sleep(3)
+print("")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. We are expecting opcode : 36 in thunder logs'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID001_sendStandbyMessage'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
+# wake up the device from standby as post condition by sending message
+print("---------------------------------------------------------------------------------------------------------------------------")
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.performOTPActionMessage)))
+Utils.warning_log("Reset the device state to ON from standby")
+time.sleep(3)
+
+# send messages required for getting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the powerstatus of TV")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the powerstatus of TV")
+time.sleep(3)
+print("")
+
+#send messages required for reporting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportPowerStatusMessage)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for reporting the powerstatus of TV")
+else:
+ Utils.error_log("sendMessage emulation failed for reporting the powerstatus of TV")
+time.sleep(3)
+print("")
+Utils.initiliaze_flask_for_HdmiCecSource()
+
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID002.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID002.py
new file mode 100644
index 00000000..12c601f4
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID002.py
@@ -0,0 +1,66 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID002
+# Testcase Description : Verify that default vendor id is obtained in output response
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+print("TC Description - Verify that default vendor id is obtained in output response")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# store the expected output response
+Utils.initiliaze_flask_for_HdmiCecSource()
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"vendorid":"019fb","success":true}}'
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_vendor_id)
+if curl_response:
+ Utils.info_log("curl command to get vendorID is sent from the test runner")
+else:
+ Utils.error_log("curl command invoke failed")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The default vendor id ' \
+ 'is obtained in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID002_getVendorId'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID003.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID003.py
new file mode 100644
index 00000000..f4a8c13c
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID003.py
@@ -0,0 +1,75 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID003
+# Testcase Description : Set the vendor id to new one using curl command and verify that new
+# vendor id set by the test user is obtained in output response
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+print("TC Description - Set the vendor id to new one using curl command and verify that new vendor id set by the test user is obtained in output response")
+# send the curl command to set the new vendor id
+print("---------------------------------------------------------------------------------------------------------------------------")
+Utils.initiliaze_flask_for_HdmiCecSource()
+set_response = Utils.send_curl_command(HdmiCecSourceApis.set_vendor_id)
+if set_response:
+ Utils.info_log("curl command sent for setting the vendorID")
+else:
+ Utils.error_log("set vendor_id failed")
+print("")
+
+# store the expected output response of testcase
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"vendorid":"04455","success":true}}'
+
+# send the curl command to get vendor id and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_vendor_id)
+if curl_response:
+ Utils.info_log("curl command send for getting the vendor id")
+else:
+ Utils.error_log("curl command send failed for getting the vendor id")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The new vendor id ' \
+ 'given by user is obtained in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID003_setVendorId_set_a_vendorID'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID004.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID004.py
new file mode 100644
index 00000000..de327e6f
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID004.py
@@ -0,0 +1,65 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID004
+# Testcase Description : Verify that default OSD Name is obtained in output response
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"name":"TV Box","success":true}}'
+Utils.initiliaze_flask_for_HdmiCecSource()
+print("TC Description - Verify that default OSD Name is obtained in output response")
+# send the curl command and fetch the output json response
+print("---------------------------------------------------------------------------------------------------------------------------")
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_osd_name)
+if curl_response:
+ Utils.info_log("curl command send for get_osd_name")
+else:
+ Utils.error_log("curl command send for get_osd_name failed")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The default OSD Name is obtained ' \
+ 'in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID004_getOSDName_default'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+Utils.initiliaze_flask_for_HdmiCecSource()
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID005.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID005.py
new file mode 100644
index 00000000..590a4238
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID005.py
@@ -0,0 +1,74 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID005
+# Testcase Description : Set the OSD Name to new one using curl command and verify that new
+# OSD Name set by the test user is obtained in output response
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+print("TC Description - Set the OSD Name to new one using curl command and verify that new OSD Name set by the test user is obtained in output response")
+Utils.initiliaze_flask_for_HdmiCecSource()
+print("---------------------------------------------------------------------------------------------------------------------------")
+# send the curl command to set the new OSD Name
+set_response = Utils.send_curl_command(HdmiCecSourceApis.set_osd_name)
+if set_response:
+ Utils.info_log(" sent the curl command to set the new OSD Name")
+else:
+ Utils.error_log("curl command sent to get the new OSD name failed")
+print("")
+# store the expected output response of testcase
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"name":"CUSTOM8 TV","success":true}}'
+
+# send the curl command to get OSD Name and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_osd_name)
+if curl_response:
+ Utils.warning_log("send the curl command to get_osd_name")
+else:
+ Utils.warning_log("curl command send failed to get_osd_name")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The new OSD Name given by user ' \
+ 'is obtained in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+Utils.initiliaze_flask_for_HdmiCecSource()
+# generate logs in terminal
+tc_id = 'TCID005_setOSDName_to_new'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID006.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID006.py
new file mode 100644
index 00000000..8eae87b8
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID006.py
@@ -0,0 +1,65 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID006
+# Testcase Description : Verify that cec enable status is true in output response
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"enabled":true,"success":true}}'
+
+print("TC Description - Verify that cec enable status is true in output response")
+print("---------------------------------------------------------------------------------------------------------------------------")
+Utils.initiliaze_flask_for_HdmiCecSource()
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_enabled)
+if curl_response:
+ Utils.info_log("curl command send for get_enabled")
+else:
+ Utils.error_log("curl command send failed for get_enabled")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The cec enable status is true'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID006_getEnabled_CEC_enabled'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID007.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID007.py
new file mode 100644
index 00000000..83e9b8d0
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID007.py
@@ -0,0 +1,77 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID007
+# Testcase Description : Set the cec enable status to false and verify that cec enable
+# status is false in output response
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+print(" TC Description - Set the cec enable status to false and verify that cec enable status is false in output response")
+# send the curl command to set the cec enable status to false
+Utils.initiliaze_flask_for_HdmiCecSource()
+print("---------------------------------------------------------------------------------------------------------------------------")
+set_response = Utils.send_curl_command(HdmiCecSourceApis.set_enabled_false)
+if set_response:
+ Utils.warning_log("send the curl command to set the cec enable status to false is success")
+else:
+ Utils.error_log("send the curl command to set the cec enable status to false failed")
+print("")
+# store the expected output response of testcase
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"enabled":false,"success":true}}'
+
+# send the curl command to get enable status of cec and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_enabled)
+if curl_response:
+ Utils.info_log("send the curl command to get enable status of cec and fetch the output json response is success")
+else:
+ Utils.error_log("send the curl command to get enable status of cec and fetch the output json response is failed")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The cec enabled status is obtained ' \
+ 'as false in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# set the cec enable status to true as a post condition
+Utils.send_curl_command(HdmiCecSourceApis.set_enabled_true)
+Utils.info_log("Reset the set enabled to TRUE")
+
+# generate logs in terminal
+tc_id = 'TCID007_setEnabled_CEC_False'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID008.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID008.py
new file mode 100644
index 00000000..5b7925f1
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID008.py
@@ -0,0 +1,67 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID008
+# Testcase Description : Hit the curl command for getActiveSourceStatus method and
+# verify that status is obtained as false in output response
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"status":false,"success":true}}'
+
+print("TC Description - Hit the curl command for getActiveSourceStatus method and verify that status is obtained as false in output response")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# send the curl command and fetch the output json response
+Utils.initiliaze_flask_for_HdmiCecSource()
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_active_source_status)
+if curl_response:
+ Utils.info_log("curl command send for get_active_source")
+else:
+ Utils.error_log("curl command send failed for get_active_source")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID008_getActiveSourceStatus_false'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID009.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID009.py
new file mode 100644
index 00000000..62ef669e
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID009.py
@@ -0,0 +1,67 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID009
+# Testcase Description : Verify that otp enabled status is true in output response
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"enabled":true,"success":true}}'
+
+print("TC Description - Verify that otp enabled status is true in output response")
+Utils.initiliaze_flask_for_HdmiCecSource()
+print("---------------------------------------------------------------------------------------------------------------------------")
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_otp_enabled)
+if curl_response:
+ Utils.info_log("curl command send for get_otp_enabled")
+else:
+ Utils.error_log("curl command send for get_otp_enabled failed")
+print("")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The otp enabled status is true'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID009_getOTPEnabled_true'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID010.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID010.py
new file mode 100644
index 00000000..65e19906
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID010.py
@@ -0,0 +1,76 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID010
+# Testcase Description : Set the OTP enabled status to false and verify that otp enabled
+# status is false in output response. Change the OTP enabled status back to true as post condition
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+print("TC Description - Set the OTP enabled status to false and verify that otp enabled status is false in output response. Change the OTP enabled status back to true as post condition")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# send the curl command to set the otp enabled status to false
+set_response = Utils.send_curl_command(HdmiCecSourceApis.set_otp_enabled_false)
+if set_response:
+ Utils.warning_log("send the curl command to set the otp enabled status to false is success")
+else:
+ Utils.error_log("send the curl command to set the otp enabled status to false is failed")
+print("")
+# store the expected output response of testcase
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"enabled":false,"success":true}}'
+
+# send the curl command to get enabled status of otp and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_otp_enabled)
+if curl_response:
+ Utils.info_log("curl command send for get_otp_enabled")
+else:
+ Utils.error_log("curl command send for get_otp_enabled failed")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The otp enabled status is obtained ' \
+ 'as false in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+print("")
+# set the otp enable status to true as a post condition
+Utils.send_curl_command(HdmiCecSourceApis.set_otp_enabled_true)
+Utils.info_log("Reset OTP to its initial state")
+
+# generate logs in terminal
+tc_id = 'TCID010_setOTPEnabled_false'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID011.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID011.py
new file mode 100644
index 00000000..c2ffa8bd
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID011.py
@@ -0,0 +1,75 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID011
+# Testcase Description : Hit the curl command for sendKeyPressEvent and
+# verify that output response is correct
+
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"success":true}}'
+Utils.initiliaze_flask_for_HdmiCecSource()
+
+keypress = [HdmiCecSourceApis.send_keypress_VOLUME_UP, HdmiCecSourceApis.send_keypress_VOLUME_DOWN, HdmiCecSourceApis.send_keypress_MUTE,
+ HdmiCecSourceApis.send_keypress_UP, HdmiCecSourceApis.send_keypress_DOWN, HdmiCecSourceApis.send_keypress_LEFT,
+ HdmiCecSourceApis.send_keypress_RIGHT, HdmiCecSourceApis.send_keypress_SELECT, HdmiCecSourceApis.send_keypress_HOME,
+ HdmiCecSourceApis.send_keypress_BACK, HdmiCecSourceApis.send_keypress_NUMBER_0, HdmiCecSourceApis.send_keypress_NUMBER_1,
+ HdmiCecSourceApis.send_keypress_NUMBER_2, HdmiCecSourceApis.send_keypress_NUMBER_3, HdmiCecSourceApis.send_keypress_NUMBER_4,
+ HdmiCecSourceApis.send_keypress_NUMBER_5, HdmiCecSourceApis.send_keypress_NUMBER_6, HdmiCecSourceApis.send_keypress_NUMBER_7,
+ HdmiCecSourceApis.send_keypress_NUMBER_8, HdmiCecSourceApis.send_keypress_NUMBER_9]
+print("TC Description - Hit the curl command for sendKeyPressEvent and verify that output response is correct")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# send the curl command and fetch the output json response
+for command in keypress:
+ curl_response = Utils.send_curl_command(command)
+
+if curl_response:
+ Utils.info_log("curl command send for send_keypress_event")
+else:
+ Utils.error_log("curl command send failed")
+print("")
+# compare both expected and received output responses
+print("---------------------------------------------------------------------------------------------------------------------------")
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID011_sendKeyPressEvent'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID012.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID012.py
new file mode 100644
index 00000000..c51729f2
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID012.py
@@ -0,0 +1,150 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID012
+# Testcase Description : Set the devices to standby mode and wake up the remote device using otp feature
+# Hit the curl command for sendStandbyMessage and send corresponding cec messages using sendMessage API
+# to hal. Then hit the curl command for perform OTP Action and send corresponding cec messages to hal.
+# Then hit the curl command for getActiveSourceStatus and verify that status is true in output response.
+# Deactivate and reactivate the HdmiCecSource plugin. Then hit the curl command for getActiveSourceStatus
+# and verify that status is back to default(false) in output response.Verify the thunder logs for more info.
+
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# Utils.restart_services()
+print(" TC Description - Set the devices to standby mode and wake up the remote device using otp feature.Hit the curl command for sendStandbyMessage and send corresponding cec messages using sendMessage API to hal. Then hit the curl command for perform OTP Action and send corresponding cec messages to hal.Then hit the curl command for getActiveSourceStatus and verify that status is true in output response.Deactivate and reactivate the HdmiCecSource plugin. Then hit the curl command for getActiveSourceStatus and verify that status is back to default(false) in output response.Verify the thunder logs for more info. send the curl command to send the standby messages to devices")
+Utils.initiliaze_flask_for_HdmiCecSource()
+print("---------------------------------------------------------------------------------------------------------------------------")
+set_response = Utils.send_curl_command(HdmiCecSourceApis.send_standby_message)
+if set_response:
+ Utils.info_log("curl command send for standby_message")
+else:
+ Utils.error_log("curl command send failed for sending standby_message")
+print("")
+
+# send messages required for getting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message2_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message2_response):
+ Utils.info_log("send the emulated message for get power status success")
+else:
+ Utils.error_log("emulated message for get power status is failed")
+print("")
+
+# send messages required for reporting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message2_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message2_response):
+ Utils.info_log("send the emulated message for report power status success")
+else:
+ Utils.error_log("emulated message for report power status is failed")
+print("")
+
+# send the curl command to perform OTP action
+print("---------------------------------------------------------------------------------------------------------------------------")
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.perform_otp_action)
+if curl_response:
+ Utils.warning_log("curl command send for perform_otp_action")
+else:
+ Utils.error_log("curl command send failed for perform_otp_action")
+print("")
+
+# send messages required for getting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message4_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message4_response):
+ Utils.info_log("send emulated message for get power status success")
+else:
+ Utils.error_log("send emulated message for get power status failed")
+print("")
+
+# send messages required for reporting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message4_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message2_response):
+ Utils.info_log("send the emulated message for report power status success")
+else:
+ Utils.error_log("emulated message for report power status is failed")
+print("")
+
+# store the expected output response of testcase before deactivating plugin
+expected_output_response1 = '{"jsonrpc":"2.0","id":42,"result":{"status":true,"success":true}}'
+
+# store the expected output response of testcase after deactivating and reactivating plugin
+expected_output_response2 = '{"jsonrpc":"2.0","id":42,"result":{"status":false,"success":true}}'
+
+# send the curl command for getActiveSourceStatus before deactivating plugin
+curl_response1 = Utils.send_curl_command(HdmiCecSourceApis.get_active_source_status)
+
+if curl_response1:
+ Utils.info_log("send the curl command for getActiveSourceStatus before deactivating plugin success")
+else:
+ Utils.error_log("send the curl command for getActiveSourceStatus before deactivating plugin failed")
+print("")
+
+Utils.warning_log("deactivate and activate the plugin")
+Utils.send_curl_command(HdmiCecSourceApis.deactivate_command)
+Utils.send_curl_command(HdmiCecSourceApis.activate_command)
+
+# send the curl command for getActiveSourceStatus after deactivating and reactivating plugin
+curl_response2 = Utils.send_curl_command(HdmiCecSourceApis.get_active_source_status)
+if curl_response2:
+ Utils.info_log("send the curl command for getActiveSourceStatus after deactivating and reactivating plugin success")
+else:
+ Utils.error_log("send the curl command for getActiveSourceStatus after deactivating and reactivating plugin failed")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response1) == str(expected_output_response1) and str(curl_response2) == str(expected_output_response2):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The active source status is switching properly'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID012_sendStandbyMessage_performOTPAction_getActiveSourceStatus'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response1)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response1, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID013.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID013.py
new file mode 100644
index 00000000..da0e4006
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID013.py
@@ -0,0 +1,69 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID013
+# Testcase Description : To verify all remote devices given by test user during hal initialization
+# is present in output response with device details
+
+import time
+from HdmiCecSource import HdmiCecSourceApis
+from Utilities import Utils, ReportGenerator
+
+# Utils.restart_services()
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"numberofdevices":3,"deviceList":[{"logicalAddress":0,"osdName":"TV Box","vendorID":"04567"},{"logicalAddress":5,"osdName":"","vendorID":"4567"},{"logicalAddress":9,"osdName":"Streaming One","vendorID":"4567"}],"success":true}}'
+
+# send the curl command and fetch the output json response
+# Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+# time.sleep(10)
+# Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+# time.sleep(10)
+Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+time.sleep(3)
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID013_getDeviceList_verify_all_remote_devices'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
+
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID014.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID014.py
new file mode 100644
index 00000000..12ae2462
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID014.py
@@ -0,0 +1,76 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID014
+# Testcase Description : Add a new device to cec network and verify that new device data is listing
+# in output response
+
+import requests
+import json
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# Utils.restart_services()
+# add afs device to network
+add_device_response = requests.get("http://{}/Database.updateDeviceConfig/addDevice/{}".format(
+ Config.flask_server_ip, json.dumps(Config.hisense_device_data)))
+print("Inside TCID014 : " + add_device_response.text + " : " + str(Config.hisense_device_data))
+time.sleep(3)
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"numberofdevices":4,"deviceList":[{"logicalAddress":0,"osdName":"TV Box","vendorID":"04567"},{"logicalAddress":5,"osdName":"","vendorID":"4567"},{"logicalAddress":6,"osdName":"TV Box","vendorID":"04567"},{"logicalAddress":9,"osdName":"Streaming One","vendorID":"4567"}],"success":true}}'
+
+# send the curl command and fetch the output json response
+# Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+# time.sleep(10)
+# Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+# time.sleep(10)
+Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+time.sleep(3)
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The newly added HiSense device is ' \
+ 'listed in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID014_getDeviceList_Add_new_device'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID015.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID015.py
new file mode 100644
index 00000000..5e4933c4
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID015.py
@@ -0,0 +1,83 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID015
+# Testcase Description : Add a new invalid device to cec network and verify that invalid device data
+# is ignored in output response
+
+import requests
+import json
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+from HdmiCecSource import CecUtils
+
+# store the expected output response before adding invalid device data
+expected_output_response = Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+
+# add an invalid device to network
+add_device_response = requests.get("http://{}/Database.updateDeviceConfig/addDevice/{}".format(
+ Config.flask_server_ip, json.dumps(Config.invalid_device_data)))
+print("Inside TCID015 : " + add_device_response.text + " : " + str(Config.invalid_device_data))
+time.sleep(3)
+
+# send the curl command after adding invalid device data and fetch the output json response
+# Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+# time.sleep(10)
+# Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+# time.sleep(10)
+Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+time.sleep(3)
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response) and len(curl_response) > 5:
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The newly added invalid device ' \
+ 'is not listed in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID015_getDeviceList_Add_an_invalid_device'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
+# post condition - restart thunder & websocket - then activate plugin again
+# time.sleep(15)
+# Utils.restart_services()
+# time.sleep(15)
+# CecUtils.activate_cec()
+# time.sleep(15)
+print("")
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID016.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID016.py
new file mode 100644
index 00000000..ac5114ef
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID016.py
@@ -0,0 +1,91 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID016
+# Testcase Description : Verify that cec enable status is true initially. Then we change the return value
+# of HdmiCecOpen as -1 using updateAPIConfig. Deactivate and reactivate the HdmiCecSource plugin.
+# After that hit the curl command and verify that cec enable status changed to false. Perform the post-condition
+# to revert the changes back to default state
+
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import CecUtils
+from HdmiCecSource import HdmiCecSourceApis
+
+print("Testcase Description - Verify that cec enable status is true initially. Then we change the return value of HdmiCecOpen as -1 using updateAPIConfig. Deactivate and reactivate the HdmiCecSource plugin. After that hit the curl command and verify that cec enable status changed to false. Perform the post-condition to revert the changes back to default state store the expected output response with HdmiCecOpen return value as 0")
+print("---------------------------------------------------------------------------------------------------------------------------")
+expected_output_response1 = '{"jsonrpc":"2.0","id":42,"result":{"enabled":true,"success":true}}'
+
+# store the expected output response with HdmiCecOpen return value as -1
+expected_output_response2 = '{"jsonrpc":"2.0","id":42,"result":{"enabled":false,"success":true}}'
+Utils.initiliaze_flask_for_HdmiCecSource()
+# send the curl command and fetch the output json response with HdmiCecOpen return value as 0
+curl_response1 = Utils.send_curl_command(HdmiCecSourceApis.get_enabled)
+if curl_response1:
+ Utils.info_log("send the curl command for get_enabled")
+else:
+ Utils.error_log("send curl command for get_enabled failed")
+print("")
+# change the return value of HdmiCecOpen hal API to -1 using updateAPIConfig API
+update_api=CecUtils.cec_update_api_overrides(Config.cec_minus_one)
+if update_api:
+ Utils.info_log("configuring the return value of HdmiCecOpen as -1 using flask api")
+else:
+ Utils.error_log("failed to configure the return value of HdmiCecOpen as -1")
+print("")
+# send the curl command and fetch the output json response with HdmiCecOpen return value as -1
+curl_response2 = Utils.send_curl_command(HdmiCecSourceApis.get_enabled)
+if curl_response2:
+ Utils.info_log("curl command send for get_enabled")
+else:
+ Utils.error_log("curl command send for get_enabled failed")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response1) == str(expected_output_response1) and str(curl_response2) == str(expected_output_response2):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The cec enable status is true initially and ' \
+ 'after changing the return value, cec enable status changed to false'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID016_getEnabled_False_HAL_value'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response2)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response2, status, message)
+
+# post condition : change the return value of HdmiCecOpen hal API back to 0
+# post = CecUtils.cec_post_condition_for_negative_scenarios()
+print("")
+Utils.initiliaze_flask_for_HdmiCecSource()
+Utils.warning_log("Reset - changed the return value of HdmiCecOpen hal API back to 0")
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID017.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID017.py
new file mode 100644
index 00000000..1b350a1c
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID017.py
@@ -0,0 +1,79 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID017
+# Testcase Description : To verify that standby message is throwing error when return value for
+# HdmiCecOpen is changed to -1. Change the return value of HdmiCecOpen as -1 using updateAPIConfig.
+# Deactivate and reactivate the HdmiCecSource plugin. After that hit the curl command and verify
+# that output is having error message. Perform the post-condition to revert the changes back to default state
+
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import CecUtils
+from HdmiCecSource import HdmiCecSourceApis
+
+post = CecUtils.cec_post_condition_for_negative_scenarios()
+print("TC Description - To verify that standby message is throwing error when return value for HdmiCecOpen is changed to -1. Change the return value of HdmiCecOpen as -1 using updateAPIConfig. Deactivate and reactivate the HdmiCecSource plugin. After that hit the curl command and verify that output is having error message. Perform the post-condition to revert the changes back to default state change the return value of HdmiCecOpen hal API to -1 using updateAPIConfig API")
+print("---------------------------------------------------------------------------------------------------------------------------")
+Utils.initiliaze_flask_for_HdmiCecSource()
+CecUtils.cec_update_api_overrides(Config.cec_minus_one)
+Utils.info_log("Updating HdmiCecOpen HAL API return value to -1")
+print("")
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"error":{"code":1,"message":"ERROR_GENERAL"}}'
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.send_standby_message)
+if curl_response:
+ Utils.info_log("curl command sent with return value -1 on HdmiCecOpen HAL api")
+else:
+ Utils.error_log("curl command sent failed with return value -1 on HdmiCecOpen HAL api")
+print("")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. We are getting error in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID017_sendStandbyMessage_HAL_False'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+Utils.initiliaze_flask_for_HdmiCecSource()
+
+# post condition : change the return value of HdmiCecOpen hal API back to 0
+# CecUtils.cec_post_condition_for_negative_scenarios()
+Utils.warning_log("Reset - change the return value of HdmiCecOpen hal API back to 0")
+print("")
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID018.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID018.py
new file mode 100644
index 00000000..5d4ccd38
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID018.py
@@ -0,0 +1,77 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID018
+# Testcase Description : To verify that perform OTP Action is throwing error when return value for
+# HdmiCecOpen is changed to -1. Change the return value of HdmiCecOpen as -1 using updateAPIConfig.
+# Deactivate and reactivate the HdmiCecSource plugin. After that hit the curl command and verify
+# that output is having error message. Perform the post-condition to revert the changes back to default state
+
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import CecUtils
+from HdmiCecSource import HdmiCecSourceApis
+
+post = CecUtils.cec_post_condition_for_negative_scenarios()
+print("TC Description - To verify that perform OTP Action is throwing error when return value for HdmiCecOpen is changed to -1. Change the return value of HdmiCecOpen as -1 using updateAPIConfig. Deactivate and reactivate the HdmiCecSource plugin. After that hit the curl command and verify that output is having error message. Perform the post-condition to revert the changes back to default state change the return value of HdmiCecOpen hal API to -1 using updateAPIConfig API")
+print("---------------------------------------------------------------------------------------------------------------------------")
+Utils.initiliaze_flask_for_HdmiCecSource()
+CecUtils.cec_update_api_overrides(Config.cec_minus_one)
+Utils.info_log("Updated HdmiCecOpen HAL API return values to -1")
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"error":{"code":1,"message":"ERROR_GENERAL"}}'
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.perform_otp_action)
+if curl_response:
+ Utils.info_log("sending the curl command for perform_otp_action")
+else:
+ Utils.error_log("curl command send failed for perform_otp_action")
+print("")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. We are getting error in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID018_performOTPAction_HAL_False'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# post condition : change the return value of HdmiCecOpen hal API back to 0
+# CecUtils.cec_post_condition_for_negative_scenarios()
+Utils.warning_log("Reset- change the return value of HAL APIs back to 0")
+print("")
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID019.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID019.py
new file mode 100644
index 00000000..306dc5d4
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID019.py
@@ -0,0 +1,84 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID019
+# Testcase Description : To verify the device list is empty and number of devices is 0 in output response
+# for getDeviceList curl command when return value of HdmiCecOpen is changed to -1. Change the return
+# value of HdmiCecOpen as -1 using updateAPIConfig. Deactivate and reactivate the HdmiCecSource plugin.
+# After that hit the curl command and verify that the device list is empty. Perform the post-condition
+# to revert the changes back to default state
+
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import CecUtils
+from HdmiCecSource import HdmiCecSourceApis
+
+post = CecUtils.cec_post_condition_for_negative_scenarios()
+# change the return value of HdmiCecOpen hal API to -1 using updateAPIConfig API
+print("TC Description - To verify the device list is empty and number of devices is 0 in output response for getDeviceList curl command when return value of HdmiCecOpen is changed to -1. Change the return value of HdmiCecOpen as -1 using updateAPIConfig. Deactivate and reactivate the HdmiCecSource plugin. After that hit the curl command and verify that the device list is empty. Perform the post-condition to revert the changes back to default state")
+Utils.initiliaze_flask_for_HdmiCecSource()
+CecUtils.cec_update_api_overrides(Config.cec_minus_one)
+Utils.info_log("change the return value of HdmiCecOpen hal API to -1 using updateAPIConfig API")
+print("")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"numberofdevices":0,"deviceList":[],"success":true}}'
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_device_list)
+if curl_response:
+ Utils.info_log("curl command send for get_device_list")
+else:
+ Utils.error_log("curl command send failed for get_device_list")
+print("")
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. The device list is empty and number of devices' \
+ 'is 0 in output response'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID019_getDeviceList_HAL_False'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
+# post condition : change the return value of HdmiCecOpen hal API back to 0
+CecUtils.cec_post_condition_for_negative_scenarios()
+Utils.initiliaze_flask_for_HdmiCecSource()
+Utils.warning_log("Reset - change the return values of HAL APIs back to 0")
+print("")
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID020.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID020.py
new file mode 100644
index 00000000..19ffe8e6
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID020.py
@@ -0,0 +1,95 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID020
+# Testcase Description : getVendorId - Invalid data
+
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"vendorid":"019fb","success":true}}'
+
+print("TC Description - getVendorId - Invalid data")
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_vendor_id)
+if curl_response:
+ Utils.warning_log("set vendor id curl command sent from the test runner")
+else:
+ Utils.error_log("set vendor id curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_vendor_id)
+if curl_response:
+ Utils.warning_log("get vendor id curl command sent from the test runner")
+else:
+ Utils.error_log("get vendor id curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_vendor_id_invalid_1)
+if curl_response:
+ Utils.warning_log("set vendor id invalid curl command sent from the test runner")
+else:
+ Utils.error_log("set vendor id invalid curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_vendor_id)
+if curl_response:
+ Utils.warning_log("get vendor id curl command sent from the test runner")
+else:
+ Utils.error_log("get vendor id curl command failed")
+
+post_condition = Utils.send_curl_command(HdmiCecSourceApis.set_vendor_id)
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one.'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one.'
+
+# generate logs in terminal
+tc_id = 'TCID020_getVendorId - Invalid data'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+Utils.initiliaze_flask_for_HdmiCecSource()
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID021.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID021.py
new file mode 100644
index 00000000..2f48bfc6
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID021.py
@@ -0,0 +1,107 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID021
+# Testcase Description : Coverage enhancements
+
+import subprocess
+import os
+import signal
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+
+process_name_cec ="CecDaemonMain"
+output = subprocess.check_output(["ps", "aux"])
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":3,"result":null}'
+
+print("TC Description - To verify coverage enhancements")
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.deactivate_command)
+if curl_response:
+ Utils.warning_log("Deactivate curl command sent from the test runner")
+else:
+ Utils.error_log("Deactivate curl command failed")
+
+try:
+ pids = []
+ # Parse the output to find the PID
+ for line in output.decode().splitlines():
+ if process_name_cec in line:
+ pid = int(line.split()[1])
+ pids.append(pid)
+ print("killing CEC Daemon")
+ else:
+ pass
+
+ if pids is not None:
+ for each_pid in pids:
+ try:
+ os.system("kill -9 %s" % (each_pid, ))
+ except:
+ print("process already killed")
+ else:
+ print("They are no services up wrt HAL Mock setup")
+except:
+ pass
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.activate_command)
+if curl_response:
+ Utils.warning_log("activate curl command sent from the test runner")
+else:
+ Utils.error_log("activate curl command failed")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one. We are expecting opcode : 36 in thunder logs'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID021_coverage enhancements'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID022.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID022.py
new file mode 100644
index 00000000..6e93d8b5
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID022.py
@@ -0,0 +1,230 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID022
+# Testcase Description : To verify the emulation of the processes which are triggered when 3 devices are connected.
+# Initially, when all the devices are on,one device will be an inactive source and another will be an active source.
+# After that, the devices go into standby and the user sets the the other device into active source. The devices are then woken up using the one-touch play feature.
+# After waking up, one device will be an active source, while the other will be an inactive source.
+# As the device enters the active state, it may trigger the text view on and image view on processes also as a result.
+import subprocess
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"success":true}}'
+
+print("TC Description - To verify the emulation of the processes which are triggered when 3 devices are connected. Send the corresponding messages for HAL. Hit the curlcommand for sendStandbyMessage and performOTPAction. Send the corresponding messages to hal. Verify the output response. One source will be active and the other inactive and vice-versa. Verify that the text view on and the image view on processes are also triggered.")
+
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+#send messages required for getting inactive source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.inactive_source_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the inactive source")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the inactive source")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.request_active_source_firestick1)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the active source")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the active source")
+time.sleep(3)
+print("")
+
+#send messages required for getting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.active_source_firestick1)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the active source")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the active source")
+time.sleep(3)
+print("")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.send_standby_message)
+if curl_response:
+ Utils.warning_log("send_standby_message curl command sent from the test runner")
+else:
+ Utils.error_log("send_standby_message curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.perform_otp_action)
+if curl_response:
+ Utils.warning_log("perform_otp_action curl command sent from the test runner")
+else:
+ Utils.error_log("perform_otp_action curl command failed")
+
+#send messages required for getting inactive source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.inactive_source_firestick1)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the inactive source")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the inactive source")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.request_active_source_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the active source")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the active source")
+time.sleep(3)
+print("")
+
+#send messages required for set stream path
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.set_stream_path_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for set stream path to hisense")
+else:
+ Utils.error_log("sendMessage emulation failed for set stream path to hisense")
+time.sleep(3)
+print("")
+
+#send messages required for routing change
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.routing_change)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for routing change to hisense")
+else:
+ Utils.error_log("sendMessage emulation failed for routing change to hisense")
+time.sleep(3)
+print("")
+
+#send messages required for routing information
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.routing_information_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying routing information from hisense")
+else:
+ Utils.error_log("sendMessage emulation failed for querying routing information from hisense")
+time.sleep(3)
+print("")
+
+#send messages required for getting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.active_source_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the active source")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the active source")
+time.sleep(3)
+print("")
+
+#send messages required for image view on
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.image_view_on)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the image view on")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the image view on")
+time.sleep(3)
+print("")
+
+#send messages required for getting text view on
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.text_view_on)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the text view on")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the text view on")
+time.sleep(3)
+print("")
+
+#send messages required for getting osd string
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.set_osd_string)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for getting the osd string")
+else:
+ Utils.error_log("sendMessage emulation failed for getting the osd string")
+time.sleep(3)
+print("")
+
+
+#send messages required for getting device power status
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.give_device_power_status_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the power status")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the power status")
+time.sleep(3)
+print("")
+
+#send messages required for getting osd name
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.give_osd_name_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the osd name")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the osd name")
+time.sleep(3)
+print("")
+
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one.'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one.'
+
+# generate logs in terminal
+tc_id = 'TCID022_process emulation'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+Utils.initiliaze_flask_for_HdmiCecSource()
+op=Utils.netstat_output()
+print(op)
+
+
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID023.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID023.py
new file mode 100644
index 00000000..7ff13589
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID023.py
@@ -0,0 +1,135 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID023
+# Testcase Description : To verify the emulation of the processes which are triggered when 3 devices are connected.
+# Initially, when all the devices are on,one device will be querying the menu language of another device. The device will be setting the menu language. Also the cec version will be queried.
+import subprocess
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":3,"result":null}'
+
+print("TC Description - To verify the emulation of the processes which are triggered when 3 devices are connected. Send the corresponding messages for HAL. Hit the curlcommand for plugin activation. Verify the output response. The menu language and the cec version will be queried and the messages which are given will be returned.")
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.activate_command)
+if curl_response:
+ Utils.warning_log("activate curl command sent from the test runner")
+else:
+ Utils.error_log("activate curl command failed")
+
+#send messages required for getting physical address
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.give_physical_address_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the physical address")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the physical address")
+time.sleep(3)
+print("")
+
+#send messages required for getting menu language
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.get_menu_language_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the menu language")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the menu language")
+time.sleep(3)
+print("")
+
+#send messages required for setting menu language
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.set_menu_language)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for setting the menu language")
+else:
+ Utils.error_log("sendMessage emulation failed for setting the menu language")
+time.sleep(3)
+print("")
+
+#send messages required for ignoring a menu language of another device
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.ignore_set_menu_language)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for ignoring the menu language")
+else:
+ Utils.error_log("sendMessage emulation failed for ignoring the menu language")
+time.sleep(3)
+print("")
+
+#send messages required for getting cec version
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.get_cec_version)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the cec version")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the cec version")
+time.sleep(3)
+print("")
+
+#send messages required for returning the cec version
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.cec_version)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for giving the cec version")
+else:
+ Utils.error_log("sendMessage emulation failed for giving the cec version")
+time.sleep(3)
+print("")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one.'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one.'
+
+# generate logs in terminal
+tc_id = 'TCID023_process emulation'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+Utils.initiliaze_flask_for_HdmiCecSource()
+op=Utils.netstat_output()
+print(op)
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID024.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID024.py
new file mode 100644
index 00000000..814ce87a
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID024.py
@@ -0,0 +1,95 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID024
+# Testcase Description : To verify the emulation processes - abort and feature abort
+import subprocess
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":3,"result":null}'
+
+print("TC Description - To verify the emulation of the processes - abort and feature abort.")
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.activate_command)
+if curl_response:
+ Utils.warning_log("activate curl command sent from the test runner")
+else:
+ Utils.error_log("activate curl command failed")
+
+#send messages required for abort
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.abort_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for abort")
+else:
+ Utils.error_log("sendMessage emulation failed for abort")
+time.sleep(3)
+print("")
+
+#send messages required for feature abort
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.feature_abort_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the abort reason")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the abort reason")
+time.sleep(3)
+print("")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one.'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one.'
+
+# generate logs in terminal
+tc_id = 'TCID024_process emulation'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+Utils.initiliaze_flask_for_HdmiCecSource()
+op=Utils.netstat_output()
+print(op)
+
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID025.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID025.py
new file mode 100644
index 00000000..9bb0e616
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID025.py
@@ -0,0 +1,86 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID025
+# Testcase Description : To verify the emulation of sending of events
+
+import subprocess
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+import time
+
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":3,"result":null}'
+
+print("TC Description - To verify the emulation of sending of events.")
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.activate_command)
+time.sleep(1)
+if curl_response:
+ Utils.warning_log("activate curl command sent from the test runner")
+else:
+ Utils.error_log("activate curl command failed")
+
+#Define the script to be executed
+execute_script = '../../../../../sendEvents.sh'
+
+
+#Execute the script
+try:
+ result = subprocess.run(['/bin/bash', execute_script], check=True, capture_output=True, text=True)
+ print("sendEvents.sh executed successfully.")
+ print("Output:\n", result.stdout)
+
+except subprocess.CalledProcessError as e:
+ print("Error occured while executing the shell script.")
+ print("Error message:\n", e.stderr)
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one.'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one.'
+
+# generate logs in terminal
+tc_id = 'TCID025_sending events'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID026.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID026.py
new file mode 100644
index 00000000..9831b492
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID026.py
@@ -0,0 +1,161 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+#TCID026 - standby scenario. Device already set on standby and again set to standby.
+
+import subprocess
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+print(" TC Description - Set the devices to standby mode and hit the sendStandbyMessage curl command again. Then wake up the remote device using otp feature.First, set the device to standby mode via emulation. Next, hit the curl command for sendStandbyMessage and send corresponding cec messages using sendMessage API to hal. Then hit the curl command for perform OTP Action and send corresponding cec messages to hal.Verify the thunder logs for more info.")
+
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+# send messages required for getting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"success":true}}'
+
+message2_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.sendStandbyMessage)))
+time.sleep(3)
+if "200" in str(message2_response):
+ Utils.info_log("send the emulated message for standby success")
+else:
+ Utils.error_log("emulated message for standby failed")
+print("")
+
+
+
+# send messages required for getting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message2_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message2_response):
+ Utils.info_log("send the emulated message for get power status success")
+else:
+ Utils.error_log("emulated message for get power status is failed")
+print("")
+
+# send messages required for reporting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message2_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message2_response):
+ Utils.info_log("send the emulated message for report power status success")
+else:
+ Utils.error_log("emulated message for report power status is failed")
+print("")
+
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+#curl command for send standby message
+set_response = Utils.send_curl_command(HdmiCecSourceApis.send_standby_message)
+if set_response:
+ Utils.info_log("curl command send for standby_message")
+else:
+ Utils.error_log("curl command send failed for sending standby_message")
+print("")
+
+# send messages required for getting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message2_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message2_response):
+ Utils.info_log("send the emulated message for get power status success")
+else:
+ Utils.error_log("emulated message for get power status is failed")
+print("")
+
+# send messages required for reporting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message2_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message2_response):
+ Utils.info_log("send the emulated message for report power status success")
+else:
+ Utils.error_log("emulated message for report power status is failed")
+print("")
+
+# send the curl command to perform OTP action
+print("---------------------------------------------------------------------------------------------------------------------------")
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.perform_otp_action)
+if curl_response:
+ Utils.warning_log("curl command send for perform_otp_action")
+else:
+ Utils.error_log("curl command send failed for perform_otp_action")
+print("")
+
+# send messages required for getting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message4_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.getPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message4_response):
+ Utils.info_log("send emulated message for get power status success")
+else:
+ Utils.error_log("send emulated message for get power status failed")
+print("")
+
+# send messages required for reporting power status of device
+print("---------------------------------------------------------------------------------------------------------------------------")
+message4_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.reportPowerStatusMessage)))
+time.sleep(3)
+if "200" in str(message2_response):
+ Utils.info_log("send the emulated message for report power status success")
+else:
+ Utils.error_log("emulated message for report power status is failed")
+print("")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID026_sendStandbyMessage_performOTPAction_fromStandby'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID027.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID027.py
new file mode 100644
index 00000000..c5827751
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID027.py
@@ -0,0 +1,156 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID027
+# Testcase Description : To verify that the getActiveourceStatus scenario is true after set stream path and routing change.
+# Initially, the getActiveSourceStatus curl command will return a false status. When all the devices are on,one device will be an inactive source and another will be an active source.
+# After that, the stream path and routing is changed. The device which was inactive becomes active and vice-versa. The devices are then woken up using the one-touch play feature.
+# After waking up, the getActiveSourceStatus curl command will return a true status.
+
+import subprocess
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"status":true,"success":true}}'
+
+print("TC Description - To verify that the getActiveSourceStatus curl command returns a true status after set stream path and routing change.")
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_active_source_status)
+if curl_response:
+ Utils.info_log("curl command send for get_active_source")
+else:
+ Utils.error_log("curl command send failed for get_active_source")
+
+#send messages required for getting inactive source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.inactive_source_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the inactive source")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the inactive source")
+time.sleep(3)
+print("")
+
+#send messages required for requesting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.request_active_source_firestick1)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for requesting the active source")
+else:
+ Utils.error_log("sendMessage emulation failed for requesting the active source")
+time.sleep(3)
+print("")
+#send messages required for getting active source
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.active_source_firestick1)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the active source")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the active source")
+time.sleep(3)
+print("")
+
+#send messages required for set stream path
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.set_stream_path_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for set stream path to hisense")
+else:
+ Utils.error_log("sendMessage emulation failed for set stream path to hisense")
+time.sleep(3)
+print("")
+
+#send messages required for routing change
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.routing_change)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for routing change to hisense")
+else:
+ Utils.error_log("sendMessage emulation failed for routing change to hisense")
+time.sleep(3)
+print("")
+
+#send messages required for routing information
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.routing_information_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying routing information from hisense")
+else:
+ Utils.error_log("sendMessage emulation failed for querying routing information from hisense")
+time.sleep(3)
+print("")
+
+
+message1_response = requests.get("http://{}/Hdmicec.sendMessage/{}".format(
+ Config.flask_server_ip, json.dumps(Config.active_source_hisense)))
+if "200" in str(message1_response):
+ Utils.info_log("sendMessage emulation success for querying the active source")
+else:
+ Utils.error_log("sendMessage emulation failed for querying the active source")
+time.sleep(3)
+print("")
+
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.perform_otp_action)
+if curl_response:
+ Utils.info_log("curl command send for perform_otp_action")
+else:
+ Utils.error_log("curl command send failed for perform_otp_action")
+
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_active_source_status)
+if curl_response:
+ Utils.info_log("curl command send for get_active_source")
+else:
+ Utils.error_log("curl command send failed for get_active_source")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one'
+
+# generate logs in terminal
+tc_id = 'TCID027_getActiveSourceStatus_True'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID028.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID028.py
new file mode 100644
index 00000000..a1cf7ce9
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID028.py
@@ -0,0 +1,95 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID028
+# Testcase Description : Invalid curl command - getVendorId
+
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"vendorid":"04455","success":true}}'
+
+print("Invalid curl command - getVendorId")
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_vendor_id)
+if curl_response:
+ Utils.warning_log("set vendor id curl command sent from the test runner")
+else:
+ Utils.error_log("set vendor id curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_vendor_id)
+if curl_response:
+ Utils.warning_log("get vendor id curl command sent from the test runner")
+else:
+ Utils.error_log("get vendor id curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_vendor_id_invalid_2)
+if curl_response:
+ Utils.warning_log("set vendor id invalid curl command sent from the test runner")
+else:
+ Utils.error_log("set vendor id invalid curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_vendor_id)
+if curl_response:
+ Utils.warning_log("get vendor id curl command sent from the test runner")
+else:
+ Utils.error_log("get vendor id curl command failed")
+
+post_condition = Utils.send_curl_command(HdmiCecSourceApis.set_vendor_id)
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one.'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one.'
+
+# generate logs in terminal
+tc_id = 'TCID028_getVendorId - Invalid curl command'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID029.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID029.py
new file mode 100644
index 00000000..5dfe8eae
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID029.py
@@ -0,0 +1,95 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID029
+# Testcase Description : getEnabled - CEC Already Disabled
+
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"enabled":false,"success":true}}'
+
+print("getEnabled - CEC Already Disabled")
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_enabled_false)
+if curl_response:
+ Utils.warning_log("set enabled curl command sent from the test runner")
+else:
+ Utils.error_log("set enabled curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_enabled)
+if curl_response:
+ Utils.warning_log("get enabled curl command sent from the test runner")
+else:
+ Utils.error_log("get enabled curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_enabled_false)
+if curl_response:
+ Utils.warning_log("set enabled curl command sent from the test runner")
+else:
+ Utils.error_log("set enabled curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_enabled)
+if curl_response:
+ Utils.warning_log("get enabled curl command sent from the test runner")
+else:
+ Utils.error_log("get enabled curl command failed")
+
+post_condition = Utils.send_curl_command(HdmiCecSourceApis.set_enabled_true)
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one.'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one.'
+
+# generate logs in terminal
+tc_id = 'TCID029_getEnabled - CEC Already Disabled'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID030.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID030.py
new file mode 100644
index 00000000..8be9a58b
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID030.py
@@ -0,0 +1,93 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID030
+# Testcase Description : getEnabled - CEC Already Enabled
+
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"enabled":true,"success":true}}'
+Utils.initiliaze_flask_for_HdmiCecSource()
+time.sleep(3)
+print("getEnabled - CEC Already Enabled")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_enabled_true)
+if curl_response:
+ Utils.warning_log("set enabled curl command sent from the test runner")
+else:
+ Utils.error_log("set enabled curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_enabled)
+if curl_response:
+ Utils.warning_log("get enabled curl command sent from the test runner")
+else:
+ Utils.error_log("get enabled curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_enabled_true)
+if curl_response:
+ Utils.warning_log("set enabled curl command sent from the test runner")
+else:
+ Utils.error_log("set enabled curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_enabled)
+if curl_response:
+ Utils.warning_log("get enabled curl command sent from the test runner")
+else:
+ Utils.error_log("get enabled curl command failed")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one.'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one.'
+
+# generate logs in terminal
+tc_id = 'TCID030_getEnabled - CEC Already Enabled'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID031.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID031.py
new file mode 100644
index 00000000..7109c6fd
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID031.py
@@ -0,0 +1,92 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID031
+# Testcase Description : getOTPEnabled - Invalid curl command
+
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"enabled":true,"success":true}}'
+
+print("getOTPEnabled - Invalid curl command")
+Utils.initiliaze_flask_for_HdmiCecSource()
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_otp_enabled_true)
+if curl_response:
+ Utils.warning_log("set otp enabled curl command sent from the test runner")
+else:
+ Utils.error_log("set otp enabled curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_otp_enabled)
+if curl_response:
+ Utils.warning_log("get otp enabled curl command sent from the test runner")
+else:
+ Utils.error_log("get otp enabled curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_otp_enabled_invalid)
+if curl_response:
+ Utils.warning_log("set otp enabled curl command sent from the test runner")
+else:
+ Utils.error_log("set otp enabled curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_otp_enabled)
+if curl_response:
+ Utils.warning_log("get otp enabled curl command sent from the test runner")
+else:
+ Utils.error_log("get otp enabled curl command failed")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one.'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one.'
+
+# generate logs in terminal
+tc_id = 'TCID031_getOTPEnabled - Invalid curl command'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
+
diff --git a/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID032.py b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID032.py
new file mode 100644
index 00000000..484ff71b
--- /dev/null
+++ b/Tests/L2HALMockTests/TestCases/HdmiCecSource/TCID032.py
@@ -0,0 +1,93 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# Testcase ID : TCID032
+# Testcase Description : getOSDName - Invalid curl command
+
+import json
+import requests
+import time
+import Config
+from Utilities import Utils, ReportGenerator
+from HdmiCecSource import HdmiCecSourceApis
+
+# store the expected output response
+expected_output_response = '{"jsonrpc":"2.0","id":42,"result":{"name":"CUSTOM8 TV","success":true}}'
+Utils.initiliaze_flask_for_HdmiCecSource()
+print("getOSDName - Invalid curl command")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_osd_name)
+if curl_response:
+ Utils.warning_log("set osd name curl command sent from the test runner")
+else:
+ Utils.error_log("set osd name curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_osd_name)
+if curl_response:
+ Utils.warning_log("get osd name curl command sent from the test runner")
+else:
+ Utils.error_log("get osd name curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.set_osd_name_invalid)
+if curl_response:
+ Utils.warning_log("set osd name invalid curl command sent from the test runner")
+else:
+ Utils.error_log("set osd name invalid curl command failed")
+
+# send the curl command and fetch the output json response
+curl_response = Utils.send_curl_command(HdmiCecSourceApis.get_osd_name)
+if curl_response:
+ Utils.warning_log("get osd name curl command sent from the test runner")
+else:
+ Utils.error_log("get osd name curl command failed")
+
+print("---------------------------------------------------------------------------------------------------------------------------")
+
+# compare both expected and received output responses
+if str(curl_response) == str(expected_output_response):
+ status = 'Pass'
+ message = 'Output response is matching with expected one.'
+else:
+ status = 'Fail'
+ message = 'Output response is different from expected one.'
+
+# generate logs in terminal
+tc_id = 'TCID032_getOSDName - Invalid curl command'
+print("Testcase ID : " + tc_id)
+print("Testcase Output Response : " + curl_response)
+print("Testcase Status : " + status)
+print("Testcase Message : " + message)
+print("")
+
+if status == 'Pass':
+ ReportGenerator.passed_tc_list.append(tc_id)
+else:
+ ReportGenerator.failed_tc_list.append(tc_id)
+Utils.initiliaze_flask_for_HdmiCecSource()
+post_condition = Utils.send_curl_command(HdmiCecSourceApis.set_osd_name)
+# push the testcase execution details to report file
+ReportGenerator.append_test_results_to_csv(tc_id, curl_response, status, message)
+
+
diff --git a/Tests/L2HALMockTests/Test_Framework/Config.py b/Tests/L2HALMockTests/Test_Framework/Config.py
new file mode 100644
index 00000000..026990e4
--- /dev/null
+++ b/Tests/L2HALMockTests/Test_Framework/Config.py
@@ -0,0 +1,2105 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# This config file contains all the configurable parameters required for Test Framework
+import os
+
+# IP & port details of Flask server
+flask_server_ip = "127.0.0.1:8000"
+
+# Define the paths of Websocket server & WPEFramework
+# Define the paths of Websocket server & WPEFramework
+WPEFramework_restart = os.getcwd()
+os.chdir("../Flask")
+
+directory_websocket = os.getcwd()
+os.chdir("../../../../install/etc/WPEFramework")
+
+directory_thunder = os.getcwd()
+os.chdir(WPEFramework_restart)
+
+# Define the path where WPEFramework logs needs to be stored
+file_name = 'log_file.txt'
+WPEFramework_logs_path = os.path.abspath(file_name)
+
+# Data required for setDeviceConfig api
+config_data = {
+ "apiName": "setDeviceConfig",
+ "arguments": {
+ "devices": [
+ {
+ "device": [
+ {"name": "xione_uk"},
+ {"islocal": 1},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "19"},
+ {"logicalAddress": "3"},
+ {"vendorId": "4567"},
+ {"osdName": "404753747265616D696E672054776F"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "Audio Device"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "5"},
+ {"vendorId": "4567"},
+ {"osdName": "0053616d73756e67"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "amazon fire stick"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 1},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "9"},
+ {"vendorId": "4567"},
+ {"osdName": "53747265616D696E67204F6E65"},
+ {"osdString": "48656C6C6F"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "hisense"},
+ {"islocal": 0},
+ {"type": "sink"},
+ {"powerState": 0},
+ {"physicalAddress": "0"},
+ {"logicalAddress": "0"},
+ {"vendorId": "0x4567"},
+ {"osdName": "545620426F78"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+
+ ]
+ }
+ ]
+ }
+}
+
+config_data_no_audio = {
+ "apiName": "setDeviceConfig",
+ "arguments": {
+ "devices": [
+ {
+ "device": [
+ {"name": "xione_uk"},
+ {"islocal": 1},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "301"},
+ {"logicalAddress": "3"},
+ {"vendorId": "4567"},
+ {"osdName": "404753747265616D696E672054776F"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "amazon fire stick"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 1},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "9"},
+ {"vendorId": "4567"},
+ {"osdName": "53747265616D696E67204F6E65"},
+ {"osdString": "48656C6C6F"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "hisense"},
+ {"islocal": 0},
+ {"type": "sink"},
+ {"powerState": 0},
+ {"physicalAddress": "0"},
+ {"logicalAddress": "0"},
+ {"vendorId": "0x4567"},
+ {"osdName": "545620426F78"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+
+ ]
+ }
+ ]
+ }
+}
+
+
+# Data required for setAPIConfig api
+api_data = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecOpen": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": 0},
+ {"outParams": [{"logicalAddress": "0x3"}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": 0},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+#Hal Api Data for error scenarios
+api_data_negative = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecOpen": [
+ {"return": -1},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": -1},
+ {"outParams": [{"logicalAddress": "0x3"}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": -1},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+
+abort_data_1 = {
+ "apiName": "setDeviceConfig",
+ "arguments": {
+ "devices": [
+ {
+ "device": [
+ {"name": "xione_uk"},
+ {"islocal": 1},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "301"},
+ {"logicalAddress": "3"},
+ {"vendorId": "4567"},
+ {"osdName": "404753747265616D696E672054776F"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "159"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "Audio Device"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "5"},
+ {"vendorId": "4567"},
+ {"osdName": "0053616d73756e67"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "159"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "amazon fire stick"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 1},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "9"},
+ {"vendorId": "4567"},
+ {"osdName": "53747265616D696E67204F6E65"},
+ {"osdString": "48656C6C6F"},
+ {"cecVersion": "04"},
+ {"abortReason": "159"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "hisense"},
+ {"islocal": 0},
+ {"type": "sink"},
+ {"powerState": 0},
+ {"physicalAddress": "0"},
+ {"logicalAddress": "0"},
+ {"vendorId": "0x4567"},
+ {"osdName": "545620426F78"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "159"}
+
+ ]
+ }
+ ]
+ }
+}
+
+abort_data_2 = {
+ "apiName": "setDeviceConfig",
+ "arguments": {
+ "devices": [
+ {
+ "device": [
+ {"name": "xione_uk"},
+ {"islocal": 1},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "301"},
+ {"logicalAddress": "3"},
+ {"vendorId": "4567"},
+ {"osdName": "404753747265616D696E672054776F"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "140"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "Audio Device"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "5"},
+ {"vendorId": "4567"},
+ {"osdName": "0053616d73756e67"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "140"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "amazon fire stick"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 1},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "9"},
+ {"vendorId": "4567"},
+ {"osdName": "53747265616D696E67204F6E65"},
+ {"osdString": "48656C6C6F"},
+ {"cecVersion": "04"},
+ {"abortReason": "140"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "hisense"},
+ {"islocal": 0},
+ {"type": "sink"},
+ {"powerState": 0},
+ {"physicalAddress": "0"},
+ {"logicalAddress": "0"},
+ {"vendorId": "0x4567"},
+ {"osdName": "545620426F78"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "140"}
+
+ ]
+ }
+ ]
+ }
+}
+
+abort_data_3 = {
+ "apiName": "setDeviceConfig",
+ "arguments": {
+ "devices": [
+ {
+ "device": [
+ {"name": "xione_uk"},
+ {"islocal": 1},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "301"},
+ {"logicalAddress": "3"},
+ {"vendorId": "4567"},
+ {"osdName": "404753747265616D696E672054776F"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "70"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "Audio Device"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "5"},
+ {"vendorId": "4567"},
+ {"osdName": "0053616d73756e67"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "70"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "amazon fire stick"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 1},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "9"},
+ {"vendorId": "4567"},
+ {"osdName": "53747265616D696E67204F6E65"},
+ {"osdString": "48656C6C6F"},
+ {"cecVersion": "04"},
+ {"abortReason": "70"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "hisense"},
+ {"islocal": 0},
+ {"type": "sink"},
+ {"powerState": 0},
+ {"physicalAddress": "0"},
+ {"logicalAddress": "0"},
+ {"vendorId": "0x4567"},
+ {"osdName": "545620426F78"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "70"}
+
+ ]
+ }
+ ]
+ }
+}
+
+abort_data_4 = {
+ "apiName": "setDeviceConfig",
+ "arguments": {
+ "devices": [
+ {
+ "device": [
+ {"name": "xione_uk"},
+ {"islocal": 1},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "301"},
+ {"logicalAddress": "3"},
+ {"vendorId": "4567"},
+ {"osdName": "404753747265616D696E672054776F"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "143"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "Audio Device"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "5"},
+ {"vendorId": "4567"},
+ {"osdName": "0053616d73756e67"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "143"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "amazon fire stick"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 1},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "9"},
+ {"vendorId": "4567"},
+ {"osdName": "53747265616D696E67204F6E65"},
+ {"osdString": "48656C6C6F"},
+ {"cecVersion": "04"},
+ {"abortReason": "143"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "hisense"},
+ {"islocal": 0},
+ {"type": "sink"},
+ {"powerState": 0},
+ {"physicalAddress": "0"},
+ {"logicalAddress": "0"},
+ {"vendorId": "0x4567"},
+ {"osdName": "545620426F78"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "143"}
+
+ ]
+ }
+ ]
+ }
+}
+
+abort_data_5 = {
+ "apiName": "setDeviceConfig",
+ "arguments": {
+ "devices": [
+ {
+ "device": [
+ {"name": "xione_uk"},
+ {"islocal": 1},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "301"},
+ {"logicalAddress": "3"},
+ {"vendorId": "4567"},
+ {"osdName": "404753747265616D696E672054776F"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "164"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "Audio Device"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "5"},
+ {"vendorId": "4567"},
+ {"osdName": "0053616d73756e67"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "164"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "amazon fire stick"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 1},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "9"},
+ {"vendorId": "4567"},
+ {"osdName": "53747265616D696E67204F6E65"},
+ {"osdString": "48656C6C6F"},
+ {"cecVersion": "04"},
+ {"abortReason": "164"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "hisense"},
+ {"islocal": 0},
+ {"type": "sink"},
+ {"powerState": 0},
+ {"physicalAddress": "0"},
+ {"logicalAddress": "0"},
+ {"vendorId": "0x4567"},
+ {"osdName": "545620426F78"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "164"}
+
+ ]
+ }
+ ]
+ }
+}
+
+
+# Device data for HiSense TV
+hisense_device_data = {
+ "device": [
+ {"name": "hisense"},
+ {"islocal": 0},
+ {"type": "sink"},
+ {"powerState": 0},
+ {"physicalAddress": "0"},
+ {"logicalAddress": "6"},
+ {"vendorId": "0x4567"},
+ {"osdName": "545620426F78"},
+ # {"optionalProperty1": "value1"},
+ # {"optionalProperty2": "value2"}
+ ]
+}
+
+api_data_sink = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecTx": [
+ {"return": -1},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecOpen": [
+ {"return": -1},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": -1},
+ {"outParams": [{"logicalAddress": "0x3"}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": -1},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+
+
+# Invalid device data for Xione US
+invalid_device_data = {
+ "device": [
+ {"name": "xione_us"},
+ {"islocal": 0},
+ {"type": "sink"},
+ {"powerState": 0},
+ {"physicalAddress": "333"},
+ {"logicalAddress": "77"},
+ {"vendorId": "4444"},
+ {"osdName": "3333"},
+ # {"optionalProperty1": "value1"},
+ # {"optionalProperty2": "value2"}
+ ]
+}
+
+# Send message data for sendStandbyMessage
+sendStandbyMessage = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x36"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+# message send to know the current power status of device
+getPowerStatusMessage = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x03",
+ "0x8F"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+# message send to know the current power status of device
+reportPowerStatusMessage = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x90"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+# message for perform OTP Action
+performOTPActionMessage = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x04"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+# api overrides data in which return value for HdmiCecOpen is set to -1
+cec_minus_one = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecOpen": [
+ {"return": -1},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": 0},
+ {"outParams": [{"logicalAddress": "0x3"}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": 0},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+# messages for active source
+active_source_firestick1 = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "amazon fire stick",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x34",
+ "0x82"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+active_source_hisense = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x82"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+active_source_xione_uk = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0xF3",
+ "0x82"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+# messages for inactive source
+inactive_source_firestick1 = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "amazon fire stick",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x34",
+ "0x9D"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+inactive_source_hisense = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x9D"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+# messages for request active source
+request_active_source_firestick1 = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "amazon fire stick",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x34",
+ "0x85"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+request_active_source_hisense = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x85"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+image_view_on = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x04"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+text_view_on = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x0D"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+routing_change = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "amazon fire stick",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x80"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+set_stream_path_hisense = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x86"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+routing_information_hisense = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x81"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+give_device_power_status_hisense = {
+
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x8F"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+set_menu_language = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x32"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+ignore_set_menu_language = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x34",
+ "0x32"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+get_menu_language_hisense = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x91"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+get_cec_version = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x9F"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+cec_version = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x9E"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+give_physical_address_hisense = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x83"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+give_osd_name_hisense = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x46"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+set_osd_string = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x64"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+feature_abort = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x00"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+abort_hisense = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0xFF"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+feature_abort_hisense = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x00"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+polling = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x200"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+sinkActiveSource = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x50",
+ "0x04"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+sinkActiveSource = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x50",
+ "0x04"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+imageViewON = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x50",
+ "0x04"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+textViewON = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x30",
+ "0x0D"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+reportPhysicalAdd = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0xF0",
+ "0x84"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+DeviceVendorID = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0xF0",
+ "0x87"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+initiateArc = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x05",
+ "0xC0"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+terminateArc = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x05",
+ "0xC5"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+reportShortAudioDes = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x05",
+ "0xA3"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+setSystemAudioMode = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x50",
+ "0x72"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+reportAudioMode = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x50",
+ "0x7A"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+givefeatures = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x50",
+ "0xA5"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+requestcurrentlatency = {
+ "apiName": "sendMessage",
+ "arguments": {
+ "remoteDevices": [
+ {
+ "device": {
+ "name": "hisense",
+ "messages": [
+ {
+ "message1": {
+ "buf": [
+ "0x50",
+ "0xA7"
+ ],
+ "len": 2,
+ "repeat": 2,
+ "delay": 1
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+
+
+api_data_sink_1 = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecTx": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecOpen": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": 0},
+ {"outParams": [{"logicalAddress": "0x3"},{"result":0}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": -1},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+
+api_data_sink_2 = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecTx": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecOpen": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": 0},
+ {"outParams": [{"logicalAddress": "0x3"},{"result":1}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": 0},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+
+api_data_sink_3 = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecTx": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecOpen": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": 0},
+ {"outParams": [{"logicalAddress": "0x3"},{"result":2}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": 0},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+
+api_data_sink_4 = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecTx": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecOpen": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": 0},
+ {"outParams": [{"logicalAddress": "0x3"},{"result":3}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": 0},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+
+api_data_sink_5 = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecTx": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecOpen": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": 0},
+ {"outParams": [{"logicalAddress": "0x3"},{"result":4}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": 0},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+
+api_data_sink_6 = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecTx": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecOpen": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": 0},
+ {"outParams": [{"logicalAddress": "0x3"},{"result":5}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": 0},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+
+api_data_sink_7 = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecTx": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecOpen": [
+ {"return": 0},
+ {"outParams": [{"handle": 2345678}]}
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ {"return": 0},
+ {"outParams": [{"logicalAddress": "0x3"},{"result":6}]}
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ {"return": 0},
+ {"outParams": [{"physicalAddress": "0x304"}]}
+ ]
+ }
+ ]
+ }
+}
+
+
+# Data required for setDeviceConfig api HdmiCecSource
+config_data_hdmicecsource = {
+ "apiName": "setDeviceConfig",
+ "arguments": {
+ "devices": [
+ {
+ "device": [
+ {"name": "xione_uk"},
+ {"islocal": 1},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "301"},
+ {"logicalAddress": "3"},
+ {"vendorId": "4567"},
+ {"osdName": "404753747265616D696E672054776F"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "amazon fire stick"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 0},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "4"},
+ {"vendorId": "4567"},
+ {"osdName": "53747265616D696E67204F6E65"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "amazon fire stick"},
+ {"islocal": 0},
+ {"type": "source"},
+ {"powerState": 1},
+ {"physicalAddress": "304"},
+ {"logicalAddress": "9"},
+ {"vendorId": "4567"},
+ {"osdName": "53747265616D696E67204F6E65"},
+ {"osdString": "48656C6C6F"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+ ]
+ },
+ {
+ "device": [
+ {"name": "hisense"},
+ {"islocal": 0},
+ {"type": "sink"},
+ {"powerState": 0},
+ {"physicalAddress": "0"},
+ {"logicalAddress": "0"},
+ {"vendorId": "0x4567"},
+ {"osdName": "545620426F78"},
+ {"menuLanguage": "454E47"},
+ {"osdString": "484953454E5345"},
+ {"cecVersion": "04"},
+ {"abortReason": "04"}
+
+ ]
+ }
+ ]
+ }
+ }
+
+# Data required for setAPIConfig api HdmiCecSource
+api_data_hdmicecsource = {
+ "apiName": "setAPIConfig",
+ "arguments": {
+ "apiOverrides": [
+ {
+ "HdmiCecOpen": [
+ { "return": 0 },
+ { "outParams": [{"handle": 2345678}] }
+ ]
+ },
+ {
+ "HdmiCecGetLogicalAddress": [
+ { "return": 0 },
+ { "outParams": [{"logicalAddress": "0x3"}] }
+ ]
+ },
+ {
+ "HdmiCecGetPhysicalAddress": [
+ { "return": 0 },
+ { "outParams": [{"physicalAddress": "0x304"}] }
+ ]
+ }
+ ]
+ }
+ }
diff --git a/Tests/L2HALMockTests/Test_Framework/Test Execution Reports/TestReport_23Q4-HAL-MOCK-TEST_05-02-2024_16h10m12s.html b/Tests/L2HALMockTests/Test_Framework/Test Execution Reports/TestReport_23Q4-HAL-MOCK-TEST_05-02-2024_16h10m12s.html
new file mode 100644
index 00000000..725cb331
--- /dev/null
+++ b/Tests/L2HALMockTests/Test_Framework/Test Execution Reports/TestReport_23Q4-HAL-MOCK-TEST_05-02-2024_16h10m12s.html
@@ -0,0 +1,63 @@
+
+ Build Name: 23Q4-HAL-MOCK-TEST
+
+
+ Date of Execution: 05/02/2024
+
+
+ Time of Execution: 16:10:12
+
+
+ Number of Testcases Passed: 2
+
+
+ Number of Testcases Failed: 0
+
+
+
+
+
+ TC ID
+ |
+
+ Output Response
+ |
+
+ TC Status
+ |
+
+ TC Message
+ |
+
+
+
+
+
+ TCID004
+ |
+
+ {"jsonrpc":"2.0","id":42,"result":{"success":true}}
+ |
+
+ Pass
+ |
+
+ Output response is matching with expected one. We are expecting opcode : 36 in thunder logs
+ |
+
+
+
+ TCID016
+ |
+
+ {"jsonrpc":"2.0","id":42,"result":{"enabled":false,"success":true}}
+ |
+
+ Pass
+ |
+
+ Output response is matching with expected one. The cec enable status is true initially and after changing the return value, cec enable status changed to false
+ |
+
+
+
\ No newline at end of file
diff --git a/Tests/L2HALMockTests/Test_Framework/TestManager.py b/Tests/L2HALMockTests/Test_Framework/TestManager.py
new file mode 100644
index 00000000..f24d6b6b
--- /dev/null
+++ b/Tests/L2HALMockTests/Test_Framework/TestManager.py
@@ -0,0 +1,750 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+import sys
+import datetime
+import time
+sys.path.append("../TestCases")
+from HdmiCecSource import CecUtils
+from FrontPanel import FPUtils
+from HDCPProfile import HdcpUtils
+from Utilities import Utils, ReportGenerator
+
+sys.path.append("Utilities")
+sys.path.append("../TestCases/HdmiCecSource")
+sys.path.append("../TestCases/HdmiCecSink")
+sys.path.append("../TestCases/FrontPanel")
+sys.path.append("../TestCases/HDCPProfile")
+
+# Define the build name of current build being tested
+build_name = "23Q4-HAL-MOCK-TEST"
+
+# Get the date and time of execution
+now = datetime.datetime.now()
+
+# clear the previous test results
+ReportGenerator.passed_tc_list.clear()
+ReportGenerator.failed_tc_list.clear()
+
+print("")
+print("Inside TestManager.py : Initializing Python Test Framework......................!")
+print("")
+argument = sys.argv[1:3]
+result = ' '.join(argument)
+if len(sys.argv) >= 2:
+ second_argument = sys.argv[1]
+ print(f"Two plugins are given: {second_argument}")
+elif len(sys.argv) >= 3:
+ third_argument = sys.argv[2]
+ print(f"three plugins are given: {third_argument}")
+elif len(sys.argv) >= 4:
+ forth_argument = sys.argv[3]
+ print(f"4 plugins are given: {argument}")
+else:
+ print("No second argument provided.")
+
+print("GIVEN PLUGIN NAMES/TC NAME {}" .format(argument))
+# Pushing the initial configuration (cec network data &
+# Pushing the initial configuration (cec network data & api override data) to Flask
+#Utils.initialize_flask()
+print("")
+
+# Activating the HdmiCecSource plugin using controller1.activate curl command
+#CecUtils.activate_cec()
+#time.sleep(5)
+
+print("")
+print("***** Test Execution Starts *****")
+print("")
+
+tc_name = result
+flag = 0
+track = 0
+
+list_of_plugins = ['HdmiCecSource','HdmiCecSink','FrontPanel','HdcpProfile']
+
+plugin_name = []
+
+for each in list_of_plugins:
+ if each in argument or each in result:
+ plugin_name.append(each)
+ track = track + 1
+
+if track == 2 or track > 2:
+ Utils.info_log("Executing Testcases for the given plugins")
+ if "HdmiCecSource" in plugin_name or "HdmiCecSink" in plugin_name:
+ Utils.initialize_flask()
+ print("")
+
+# Activating the HdmiCecSource plugin using controller1.activate curl command
+ CecUtils.activate_cec()
+ time.sleep(5)
+ else:
+ print("Plugins changed does not require FLASK HTTP Server for execution and build")
+
+ if "HdmiCecSource" in plugin_name:
+ # Execute the testcases
+ import TCID013
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID014
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID015
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID022
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID023
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID024
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID001
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID002
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID003
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID004
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID005
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID006
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID007
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID008
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID009
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID010
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID011
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID012
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID016
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID017
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID018
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID019
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID020
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID026
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID027
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID032
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID031
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID030
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID029
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID028
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID025
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID021
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ else:
+ print("Skipping HdmiCecSource as no changes are added")
+
+ if "HdmiCecSink" in plugin_name:
+ import TCID_031_HDMICECSINK_getEnabled_HAL_False
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_Emulate
+ import TCID_035_Arc_start_stop
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_028_HDMICECSINK_abortCombinationsEmulation
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_036_HDMICECSINK_OSDStringMenuLanguageEmulation
+ import TCID_037_HDMICECSINK_sendEvents
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_032_HDMICECSINK_EmulateTextViewONStandbyBy
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_001_HDMICECSINK_getEnabled
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_002_HDMICECSINK_setEnabled
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_003_HDMICECSINK_getOSDName
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_005_HDMICECSINK_getVendorID
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_004_HDMICECSINK_setOSDName
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_006_HDMICECSINK_setVendorID
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_008_HDMICECSINK_getActiveSource
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_007_HDMICECSINK_getActiveRoute
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_009_HDMICECSINK_getAudioDeviceConnectedStatus
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_010_HDMICECSINK_getDeviceList
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_011_HDMICECSINK_requestActiveSource
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_012_HDMICECSINK_requestShortAudioDescriptor
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_013_HDMICECSINK_sendAudioDevicePowerOnMessage
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_014_HDMICECSINK_getAudioStatusMessage
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_015_HDMICECSINK_sendKeyPressEvent
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_016_HDMICECSINK_sendUserControlPressed
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_017_HDMICECSINK_sendUserControlReleased
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_018_HDMICECSINK_sendStandbyMessage
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_019_HDMICECSINK_setActivePath
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_020_HDMICECSINK_setActiveSource
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_021_HDMICECSINK_setmenuLanguage
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_022_HDMICECSINK_setLatencyInfo
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_023_HDMICECSINK_setRoutingChange
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_024_HDMICECSINK_setupArcRouting
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_025_HDMICECSINK_printDeviceList
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_026_HDMICECSINK_requestAudioDevicePowerStatus
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_029_HDMICECSINK_getActiveSourcewithroutingChange
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_030_HDMICECSINK_sendGetAudioStatusMessage
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_033_HDMICECSINK_setRoutingChangeNegative
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_034_HDMICECSINK_active_source
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ else:
+ print("Skipping HDMICECSINK as no changes are added")
+
+
+ if "FrontPanel" in plugin_name:
+ #Utils.initialize_flask()
+ print("Executing Test Framework without HTTP server and Websocket")
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_001_DS_FrontPanel_getBrightness
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_011_DS_FrontPanel_setPreferences #commented as its descoped in source code
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_002_DS_FrontPanel_getPreferences
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_003_DS_FrontPanel_is24HourClock
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_014_DS_FrontPanel_setClockBrightness #commented as its descoped in source code
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_004_DS_FrontPanel_getClockBrightness #commented as its descoped in source code
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_005_DS_FrontPanel_powerLedOff
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_006_DS_FrontPanel_powerLedOn
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_007_DS_FrontPanel_set24HourClock
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_008_DS_FrontPanel_setBlink
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_009_DS_FrontPanel_setClockTestPattern
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_010_DS_FrontPanel_setLED
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_013_DS_FrontPanel_setBrightness
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_015_DS_FrontPanel_getSetbrightnesscombination
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_012_DS_FrontPanel_getFrontPanelLights
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_017_DS_FrontPanel_sendEventsSimulation
+ import TCID_016_DS_FrontPanel_Deactivate
+ else:
+ print("Skipping FrontPanel as no changes are added")
+
+ if "HdcpProfile" in plugin_name:
+ print("Detected change in HdcpProfile")
+ import TCID_001_HDCPProfile_getHDCPStatus
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_002_HDCPProfile_getSettopHDCPSupport #commented as its descoped in source code
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_004_HDCPProfile_Events
+ time.sleep(2)
+ import TCID_003_HDCPProfile_ActivateDeactivateSimulation
+
+ else:
+ print("skipping HdcpProfile as no changes are required")
+else:
+ track = 1
+if "HdmiCecSource" in argument or "HdmiCecSource" in result:
+ if track < 2:
+ flag = 1
+ if flag == 1 or flag == 15:
+ Utils.initialize_flask()
+ print("")
+
+# Activating the HdmiCecSource plugin using controller1.activate curl command
+ CecUtils.activate_cec()
+ time.sleep(5)
+
+ # Execute the testcases for HdmiCecSource
+ Utils.info_log("Executing Testcases for HdmiCecSource")
+ # Execute the testcases
+ import TCID013
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID014
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID015
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID022
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID023
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID024
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID001
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID002
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID003
+ import TCID004
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID005
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID006
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID007
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID008
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID009
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID010
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID011
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID012
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID016
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID017
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID018
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID019
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID020
+ import TCID020
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID026
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID027
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID032
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID031
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID030
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID029
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID028
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID025
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID021
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ else:
+ print("Executed HdmiCecSource TestCases")
+if "HdmiCecSink" in argument or "HdmiCecSink" in result:
+ if track < 2:
+ flag = 2
+ Utils.info_log("Executing HdmiCecSink Test suite")
+ Utils.initialize_flask()
+ print("")
+
+# Activating the HdmiCecSource plugin using controller1.activate curl command
+ CecUtils.activate_cec()
+ time.sleep(5)
+
+ import TCID_031_HDMICECSINK_getEnabled_HAL_False
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_Emulate
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_035_Arc_start_stop
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_028_HDMICECSINK_abortCombinationsEmulation
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_036_HDMICECSINK_OSDStringMenuLanguageEmulation
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_037_HDMICECSINK_sendEvents
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_032_HDMICECSINK_EmulateTextViewONStandbyBy
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_001_HDMICECSINK_getEnabled
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_002_HDMICECSINK_setEnabled
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_003_HDMICECSINK_getOSDName
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_005_HDMICECSINK_getVendorID
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_004_HDMICECSINK_setOSDName
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_006_HDMICECSINK_setVendorID
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_008_HDMICECSINK_getActiveSource
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_007_HDMICECSINK_getActiveRoute
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_009_HDMICECSINK_getAudioDeviceConnectedStatus
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_010_HDMICECSINK_getDeviceList
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_011_HDMICECSINK_requestActiveSource
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_012_HDMICECSINK_requestShortAudioDescriptor
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_013_HDMICECSINK_sendAudioDevicePowerOnMessage
+ import TCID_014_HDMICECSINK_getAudioStatusMessage
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_015_HDMICECSINK_sendKeyPressEvent
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_016_HDMICECSINK_sendUserControlPressed
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_017_HDMICECSINK_sendUserControlReleased
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_018_HDMICECSINK_sendStandbyMessage
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_019_HDMICECSINK_setActivePath
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_020_HDMICECSINK_setActiveSource
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_021_HDMICECSINK_setmenuLanguage
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_022_HDMICECSINK_setLatencyInfo
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_023_HDMICECSINK_setRoutingChange
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_024_HDMICECSINK_setupArcRouting
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_025_HDMICECSINK_printDeviceList
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_026_HDMICECSINK_requestAudioDevicePowerStatus
+
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_029_HDMICECSINK_getActiveSourcewithroutingChange
+ import TCID_030_HDMICECSINK_sendGetAudioStatusMessage
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_033_HDMICECSINK_setRoutingChangeNegative
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_034_HDMICECSINK_active_source
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ else:
+ print("Executed HdmiCecSink TestCases")
+if "FrontPanel" in argument or "FrontPanel" in result:
+ if track < 2:
+ flag = 3
+ Utils.info_log("Executing FrontPanel Test suite")
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+
+ #Utils.initialize_flask()
+ print("Executing Test Framework without HTTP server and Websocket")
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_001_DS_FrontPanel_getBrightness
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_011_DS_FrontPanel_setPreferences #commented as its descoped in source code
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_002_DS_FrontPanel_getPreferences
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_003_DS_FrontPanel_is24HourClock
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_014_DS_FrontPanel_setClockBrightness #commented as its descoped in source code
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_004_DS_FrontPanel_getClockBrightness #commented as its descoped in source code
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_005_DS_FrontPanel_powerLedOff
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_006_DS_FrontPanel_powerLedOn
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_007_DS_FrontPanel_set24HourClock
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_008_DS_FrontPanel_setBlink
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_009_DS_FrontPanel_setClockTestPattern
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_010_DS_FrontPanel_setLED
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_013_DS_FrontPanel_setBrightness
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_015_DS_FrontPanel_getSetbrightnesscombination
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_012_DS_FrontPanel_getFrontPanelLights
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_017_DS_FrontPanel_sendEventsSimulation
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_018_DS_FrontPanel_negative
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_020_DS_FrontPanel_powerLed_invalid
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_021_DS_FrontPanel_LEDBrightnessNegative
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_022_DS_FrontPanel_24HrClock_invalid
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_016_DS_FrontPanel_Deactivate
+
+# Activating the HdmiCecSource plugin using controller1.activate curl command
+ #CecUtils.activate_cec()
+ #time.sleep(5)
+if "HdcpProfile" in argument or "HdcpProfile" in result:
+ if track < 2:
+ flag = 4
+ Utils.info_log("Executing HDCPProfile Test suite")
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ time.sleep(30)
+ #Utils.initialize_flask()
+ print("Executing Test Framework without HTTP server and Websocket")
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_001_HDCPProfile_getHDCPStatus
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_002_HDCPProfile_getSettopHDCPSupport #commented as its descoped in source code
+ print("\033[32m------########################################################################################################################---------.\033[0m")
+ import TCID_004_HDCPProfile_Events
+ time.sleep(28)
+ import TCID_003_HDCPProfile_ActivateDeactivateSimulation
+ #import TCID_003_HDCPProfile_ActivateDeactivateSimulation
+
+if argument == "DeviceSettings":
+ flag = 3
+ Utils.highlight_log("Executing DeviceSettings Test suite")
+if argument == "Bluetooth":
+ flag = 4
+ Utils.highlight_log("Executing Bluetooth Test Suite")
+if argument == "Wifi":
+ flag = 5
+ Utils.highlight_log("Executing Wifi Test Suite")
+if argument == "HdmiInput":
+ flag = 6
+if argument == "all":
+ flag = 15
+ Utils.highlight_log("Executing Complete Test Suite for all plugins")
+if "TCID" in result:
+ flag = 0
+ print(
+ "\033[32m------########################################################################################################################---------.\033[0m")
+ print("Execution of testcase {}".format(argument))
+ __import__(tc_name)
+
+if argument != "HdmiCecSource" or argument != "HdmiCecSink" or argument != "all":
+ print("Execution of testcase {}" .format(argument))
+if flag == 2 or flag == 15:
+ Utils.info_log("Executed HdmiCecSinkTestcases")
+if flag == 15:
+ Utils.info_log("Executed Complete Test suite")
+else:
+ print("Executed TestManager")
+
+print("***** Test Execution Ends *****")
+
+# Generate a html report file with all testcase execution details
+ReportGenerator.generate_html_report(build_name, now)
diff --git a/Tests/L2HALMockTests/Test_Framework/Utilities/ReportGenerator.py b/Tests/L2HALMockTests/Test_Framework/Utilities/ReportGenerator.py
new file mode 100644
index 00000000..4739fb0f
--- /dev/null
+++ b/Tests/L2HALMockTests/Test_Framework/Utilities/ReportGenerator.py
@@ -0,0 +1,186 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+import csv
+import os
+import pandas as pd
+from bs4 import BeautifulSoup
+
+passed_tc_list = []
+failed_tc_list = []
+
+
+def append_test_results_to_csv(tc_id, output, status, message):
+
+ # Assign the headers for report file
+ headers = ["Curl API/TC Name", "Output Response", " TC Status ", " Remarks "]
+
+ # Open the report file in append mode
+ with open("TestReport.csv", "a", newline="") as csvfile:
+ writer = csv.writer(csvfile)
+
+ # Write headers if the headers in report file is empty
+ if csvfile.tell() == 0:
+ writer.writerow(headers)
+
+ # Write the testcase details to a new row
+ writer.writerow([tc_id, output, status, message])
+
+
+
+# Report Generation in .html file format
+def generate_html_report(build_name, now):
+
+ # To read csv file named "TestReport"
+ a = pd.read_csv("TestReport.csv")
+
+ # Format the date and time as strings to generate the test report file
+ date = now.strftime("%d-%m-%Y")
+ time = now.strftime("%Hh%Mm%Ss")
+
+ # To save as html file with build name, execution data and time
+ a.to_html("TestReport_{}_{}_{}.html".format(build_name, date, time), index=False)
+ # To remove the TestReport.csv file
+ #os.remove("TestReport.csv")
+
+ # Add custom CSS style for a black background
+ # Read the HTML file
+ with open("TestReport_{}_{}_{}.html".format(build_name, date, time), "r") as f:
+ html = f.read()
+
+ styled_html = f"""
+
+ {html}
+ """
+
+ # Parse the HTML using BeautifulSoup
+ soup = BeautifulSoup(html, "html.parser")
+
+ # Find the table element
+ table = soup.find("table")
+
+ # Create a list of elements with the data
+
+ # Calculate the length of the failed_tc_list string
+ failed_tc_length = str(len(failed_tc_list))
+ passed_tc_length = str(len(passed_tc_list))
+
+ # Create a formatted string with the length in red
+ #formatted_length_failed = f"\033[91m{failed_tc_length}\033[0m"
+ #formatted_length_passed = f"\033[92m{passed_tc_length}\033[0m"
+ formatted_length_failed = failed_tc_length
+ formatted_length_passed = passed_tc_length
+
+ current_date = now.strftime("%d/%m/%Y")
+ current_time = now.strftime("%H:%M:%S")
+ data = [soup.new_tag("p")]
+ # Now you can use the formatted_length wherever you need it
+ ##data[-1].string = f"Number of Testcases Failed: {str(formatted_length_failed)}"
+ #data[-1].string = f"Number of Testcases Failed: {str(len(failed_tc_list))}"
+ ##data.append(soup.new_tag("p"))
+ #data[-1].string = f"Number of Testcases Passed: {str(len(passed_tc_list))}"
+ ##data[-1].string = f"Number of Testcases Passed: {str(formatted_length_passed)}"
+ ##data.append(soup.new_tag("p"))
+ ##data[-1].string = f"Time of Execution: {current_time}"
+ ##data.append(soup.new_tag("p"))
+ ##data[-1].string = f"Date of Execution: {current_date}"
+ ##data.append(soup.new_tag("p"))
+ ##data[-1].string = f"Build Name: {build_name}"
+
+ styled_html = f"""
+
+
+
+
+
+ L2 Test Execution Report
+ {html}
+ Execution Summary
+ Number of Testcases Failed: {str(formatted_length_failed)}
+ Number of Testcases Passed: {str(formatted_length_passed)}
+ Time of Execution: {current_time}
+ Date of Execution: {current_date}
+ Build Name: {build_name}
+
+
+ """
+
+
+ # Insert the data elements before the table element
+ for element in reversed(data):
+ table.insert_before(element)
+
+
+ # Replace the old html file with new one
+ with open("TestReport_{}_{}_{}.html".format(build_name, date, time), "w") as f:
+ f.write(str(soup))
+
+ # Read the html file
+ with open("TestReport_{}_{}_{}.html".format(build_name, date, time)) as html_file:
+ soup = BeautifulSoup(html_file, "html.parser")
+
+ # Find all the elements
+ headers = soup.find_all("th")
+
+ # Add the style attribute to each | element
+ for header in headers:
+ header["style"] = "text-align: center"
+
+
+ # Write the modified html to a same report file
+ with open("TestReport_{}_{}_{}.html".format(build_name, date, time), "w") as html_file:
+ #html_file.write(soup.prettify())
+ html_file.write(styled_html)
+ # Move the html file to the 'Test Execution Reports' Directory
+ os.rename("TestReport_{}_{}_{}.html".format(build_name, date, time),
+ "Test Execution Reports/TestReport_{}_{}_{}.html".format(
+ build_name, date, time))
diff --git a/Tests/L2HALMockTests/Test_Framework/Utilities/Utils.py b/Tests/L2HALMockTests/Test_Framework/Utilities/Utils.py
new file mode 100644
index 00000000..462c5af2
--- /dev/null
+++ b/Tests/L2HALMockTests/Test_Framework/Utilities/Utils.py
@@ -0,0 +1,261 @@
+#** *****************************************************************************
+# *
+# * If not stated otherwise in this file or this component's LICENSE file the
+# * following copyright and licenses apply:
+# *
+# * Copyright 2024 RDK Management
+# *
+# * Licensed under the Apache License, Version 2.0 (the "License");
+# * you may not use this file except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# *
+# http://www.apache.org/licenses/LICENSE-2.0
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *
+#* ******************************************************************************
+
+# This file contains all the common functions required for test framework
+
+import subprocess
+import os
+import json
+import requests
+import Config
+from os import path
+import logging
+from colorama import Fore, Style
+import time
+
+
+def error_log(message):
+ print(Fore.RED + f"ERROR: {message}" + Style.RESET_ALL)
+
+def warning_log(message):
+ print(Fore.YELLOW + f"LOGGER: {message}" + Style.RESET_ALL)
+
+def info_log(message):
+ print(Fore.CYAN + f"INFO: {message}" + Style.RESET_ALL)
+
+def initiliaze_flask_for_HdmiCecSource():
+ '''This function is used to push the initial data towards the Flask server'''
+ try:
+ # Push the initial cec network data to Flask using http get requests - setDeviceConfig API
+ create_device_response = requests.get("http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.config_data_hdmicecsource)))
+ print("Inside Utils.py : " + create_device_response.text + " : " + str(Config.config_data_hdmicecsource))
+ print("configured device data using - http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.config_data_hdmicecsource)))
+ print("")
+
+ # Push the api overrides data to Flask using http get requests - setAPIConfig API
+ create_api_overrides_response = requests.get("http://{}/Hdmicec.setAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data_hdmicecsource)))
+ print("Inside Utils.py : " + create_api_overrides_response.text + " : " + str(Config.api_data_hdmicecsource))
+ print("configured hal api data using - http://{}/Hdmicec.setAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data_hdmicecsource)))
+ print("")
+
+ # Compare the obtained response with actual response
+ if "Success" in str(create_device_response.text) and "Success" in str(create_api_overrides_response.text):
+ print("Inside Utils.py : Successfully pushed the initial data (setDeviceConfig & setAPIConfig) to Flask")
+ else:
+ print("Inside Utils.py : Failed to push the initial data (setDeviceConfig & setAPIConfig) to Flask")
+
+ except:
+ print("Inside Utils.py : Exception in initialize_flask function")
+
+def initialize_flask():
+ '''This function is used to push the initial data towards the Flask server'''
+ try:
+ # Push the initial cec network data to Flask using http get requests - setDeviceConfig API
+ create_device_response = requests.get("http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.config_data)))
+ print("Inside Utils.py : " + create_device_response.text + " : " + str(Config.config_data))
+ print("configured device data using - http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.config_data)))
+ print("")
+
+ # Push the api overrides data to Flask using http get requests - setAPIConfig API
+ create_api_overrides_response = requests.get("http://{}/Hdmicec.setAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data)))
+ print("Inside Utils.py : " + create_api_overrides_response.text + " : " + str(Config.api_data))
+ print("configured hal api data using - http://{}/Hdmicec.setAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data)))
+ print("")
+
+ # Compare the obtained response with actual response
+ if "Success" in str(create_device_response.text) and "Success" in str(create_api_overrides_response.text):
+ print("Inside Utils.py : Successfully pushed the initial data (setDeviceConfig & setAPIConfig) to Flask")
+ else:
+ print("Inside Utils.py : Failed to push the initial data (setDeviceConfig & setAPIConfig) to Flask")
+
+ except:
+ print("Inside Utils.py : Exception in initialize_flask function")
+
+def initialize_hal_apis_with_negative_values():
+ '''This function is used to push the initial data towards the Flask server'''
+ try:
+ # Push the initial cec network data to Flask using http get requests - setDeviceConfig API
+ create_device_response = requests.get("http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.config_data)))
+ print("Inside Utils.py : " + create_device_response.text + " : " + str(Config.config_data))
+ print("configured device data using - http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.config_data)))
+ print("")
+
+ # Push the api overrides data to Flask using http get requests - setAPIConfig API
+ create_api_overrides_response = requests.get("http://{}/Hdmicec.setAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data_crash_instance)))
+ print("Inside Utils.py : " + create_api_overrides_response.text + " : " + str(Config.api_data_crash_instance))
+ print("configured hal api data using - http://{}/Hdmicec.setAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data_crash_instance)))
+ print("")
+
+ # Compare the obtained response with actual response
+ if "Success" in str(create_device_response.text) and "Success" in str(create_api_overrides_response.text):
+ print("Inside Utils.py : Successfully pushed the initial data (setDeviceConfig & setAPIConfig) to Flask")
+ else:
+ print("Inside Utils.py : Failed to push the initial data (setDeviceConfig & setAPIConfig) to Flask")
+
+ except:
+ print("Inside Utils.py : Exception in initialize_flask function")
+
+def send_curl_command(curl_command):
+ '''This function is used to send the curl commands to get the output response using os module'''
+ output_response = ""
+ try:
+ # Send the curl command using os.system module
+ response = os.popen(curl_command)
+
+ # Find the line that is a valid JSON for extracting only the json response
+ for line in response.readlines():
+ try:
+ # Try to parse the current line as JSON
+ json.loads(line)
+ output_response = line
+ # Exit the loop as we found the JSON line
+ break
+ except json.JSONDecodeError:
+ # If current line is not a valid JSON, just pass and continue with the next line
+ pass
+
+ # Check the output response and add a message if the obtained output response is null
+ if len(output_response) < 5:
+ output_response = "< No response from WPEFramework >"
+ except:
+ print("Inside Utils.py : Exception in send_curl_command function")
+ finally:
+ # Return the output json response of given curl command as a string
+ return output_response
+
+#abort Device config with 5 different device configurations.
+def abort_data(data):
+ print("Sending abort configurations")
+ create_device_response = requests.get("http://{}/Database.setDeviceConfig/{}".format(Config.flask_server_ip, json.dumps(data)))
+ print("Inside Utils.py : " + create_device_response.text + " : " + str(data))
+ print("configured device data using - http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(data)))
+ print("")
+
+def initialize_flask_without_audio_device():
+ '''This function is used to push the initial data towards the Flask server'''
+ try:
+ # Push the initial cec network data to Flask using http get requests - setDeviceConfig API
+ create_device_response = requests.get("http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.config_data_no_audio)))
+ print("Inside Utils.py : " + create_device_response.text + " : " + str(Config.config_data))
+ print("configured device data using - http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.config_data_no_audio)))
+ print("")
+
+ # Push the api overrides data to Flask using http get requests - setAPIConfig API
+ create_api_overrides_response = requests.get("http://{}/Hdmicec.setAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data)))
+ print("Inside Utils.py : " + create_api_overrides_response.text + " : " + str(Config.api_data))
+ print("configured hal api data using - http://{}/Hdmicec.setAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data)))
+ print("")
+
+ # Compare the obtained response with actual response
+ if "Success" in str(create_device_response.text) and "Success" in str(create_api_overrides_response.text):
+ print(
+ "Inside Utils.py : Successfully pushed the initial data (setDeviceConfig & setAPIConfig) to Flask")
+ else:
+ print("Inside Utils.py : Failed to push the initial data (setDeviceConfig & setAPIConfig) to Flask")
+
+ except:
+ print("Inside Utils.py : Exception in initialize_flask function")
+
+def restart_services():
+ '''This function is used to kill the WPEFramework & Websocket services and to restart those'''
+ try:
+ # Kill the port WPEFramework with -QUIT to generate .gcda filek
+ os.system("killall -QUIT WPEFramework")
+
+ # Kill the port 55555 which runs the WPEFramework
+ os.system("fuser -k 55555/tcp")
+
+ # Kill the port 9000 which runs the Websocket server
+ os.system("fuser -k 9000/tcp")
+
+ # Start the websocket server using python subprocess module
+ subprocess.Popen(["python3", "websocket_server.py"], cwd=Config.directory_websocket)
+ time.sleep(5)
+ subprocess.run(["chmod", "+x", "restart.sh"], check=True)
+ subprocess.Popen(["./restart.sh"], cwd=Config.WPEFramework_restart)
+ time.sleep(5)
+ # file_path = path.relpath(Config.WPEFramework_logs_path)
+
+ # Open a file for writing the output and error of WPEFramework process
+ # with open(file_path, "w") as logfile:
+
+ # Run the command to start the WPEFramework and redirect the output and error to the file
+ # subprocess.Popen(["WPEFramework", "-f", "-c", "config.json"],
+ # cwd=Config.directory_thunder, stdout=logfile, stderr=logfile)
+ # subprocess.Popen(["./restart.sh"], cwd=Config.WPEFramework_restart, stdout=logfile, stderr=logfile)
+ except:
+ print("Inside Utils.py : Exception in restart_services function")
+
+def netstat_output():
+
+ #Run the netstat -ntlp command
+
+ output = subprocess.run(['netstat','-ntlp'],capture_output=True,text=True)
+
+ #Return the output as a string
+
+ return output.stdout
+
+def initialize_flask_with_HalApiNegativeValues():
+ '''This function is used to push the initial data towards the Flask server'''
+ try:
+ # Push the initial cec network data to Flask using http get requests - setDeviceConfig API
+ create_device_response = requests.get("http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.config_data)))
+ print("Inside Utils.py : " + create_device_response.text + " : " + str(Config.config_data))
+ print("configured device data using - http://{}/Database.setDeviceConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.config_data)))
+ print("")
+
+ # Push the api overrides data to Flask using http get requests - setAPIConfig API
+ create_api_overrides_response = requests.get("http://{}/Hdmicec.setAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data_negative)))
+ print("Inside Utils.py : " + create_api_overrides_response.text + " : " + str(Config.api_data_negative))
+ print("configured hal api data using - http://{}/Hdmicec.setAPIConfig/{}".format(
+ Config.flask_server_ip, json.dumps(Config.api_data_negative)))
+ print("")
+
+ # Compare the obtained response with actual response
+ if "Success" in str(create_device_response.text) and "Success" in str(create_api_overrides_response.text):
+ print("Inside Utils.py : Successfully pushed the initial data (setDeviceConfig & setAPIConfig) to Flask")
+ else:
+ print("Inside Utils.py : Failed to push the initial data (setDeviceConfig & setAPIConfig) to Flask")
+
+ except:
+ print("Inside Utils.py : Exception in initialize_flask function")
diff --git a/Tests/L2HALMockTests/Test_Framework/lcovrc_halmock b/Tests/L2HALMockTests/Test_Framework/lcovrc_halmock
new file mode 100644
index 00000000..879fe2ce
--- /dev/null
+++ b/Tests/L2HALMockTests/Test_Framework/lcovrc_halmock
@@ -0,0 +1,181 @@
+#
+# /etc/lcovrc - system-wide defaults for LCOV
+#
+# To change settings for a single user, place a customized copy of this file
+# at location ~/.lcovrc
+#
+
+# Specify an external style sheet file (same as --css-file option of genhtml)
+#genhtml_css_file = gcov.css
+
+# Specify coverage rate limits (in %) for classifying file entries
+# HI: hi_limit <= rate <= 100 graph color: green
+# MED: med_limit <= rate < hi_limit graph color: orange
+# LO: 0 <= rate < med_limit graph color: red
+genhtml_hi_limit = 75
+genhtml_med_limit = 50
+
+# Width of line coverage field in source code view
+genhtml_line_field_width = 12
+
+# Width of branch coverage field in source code view
+genhtml_branch_field_width = 16
+
+# Width of overview image (used by --frames option of genhtml)
+genhtml_overview_width = 80
+
+# Resolution of overview navigation: this number specifies the maximum
+# difference in lines between the position a user selected from the overview
+# and the position the source code window is scrolled to (used by --frames
+# option of genhtml)
+genhtml_nav_resolution = 4
+
+# Clicking a line in the overview image should show the source code view at
+# a position a bit further up so that the requested line is not the first
+# line in the window. This number specifies that offset in lines (used by
+# --frames option of genhtml)
+genhtml_nav_offset = 10
+
+# Do not remove unused test descriptions if non-zero (same as
+# --keep-descriptions option of genhtml)
+genhtml_keep_descriptions = 0
+
+# Do not remove prefix from directory names if non-zero (same as --no-prefix
+# option of genhtml)
+genhtml_no_prefix = 0
+
+# Do not create source code view if non-zero (same as --no-source option of
+# genhtml)
+genhtml_no_source = 0
+
+# Replace tabs with number of spaces in source view (same as --num-spaces
+# option of genhtml)
+genhtml_num_spaces = 8
+
+# Highlight lines with converted-only data if non-zero (same as --highlight
+# option of genhtml)
+genhtml_highlight = 0
+
+# Include color legend in HTML output if non-zero (same as --legend option of
+# genhtml)
+genhtml_legend = 0
+
+# Use FILE as HTML prolog for generated pages (same as --html-prolog option of
+# genhtml)
+#genhtml_html_prolog = FILE
+
+# Use FILE as HTML epilog for generated pages (same as --html-epilog option of
+# genhtml)
+#genhtml_html_epilog = FILE
+
+# Use custom filename extension for pages (same as --html-extension option of
+# genhtml)
+#genhtml_html_extension = html
+
+# Compress all generated html files with gzip.
+#genhtml_html_gzip = 1
+
+# Include sorted overview pages (can be disabled by the --no-sort option of
+# genhtml)
+genhtml_sort = 1
+
+# Include function coverage data display (can be disabled by the
+# --no-func-coverage option of genhtml)
+#genhtml_function_coverage = 1
+
+# Include branch coverage data display (can be disabled by the
+# --no-branch-coverage option of genhtml)
+#genhtml_branch_coverage = 1
+
+# Specify the character set of all generated HTML pages
+genhtml_charset=UTF-8
+
+# Allow HTML markup in test case description text if non-zero
+genhtml_desc_html=0
+
+# Specify the precision for coverage rates
+#genhtml_precision=1
+
+# Show missed counts instead of hit counts
+#genhtml_missed=1
+
+# Demangle C++ symbols
+#genhtml_demangle_cpp=1
+
+# Name of the tool used for demangling C++ function names
+#genhtml_demangle_cpp_tool = c++filt
+
+# Specify extra parameters to be passed to the demangling tool
+#genhtml_demangle_cpp_params = ""
+
+# Location of the gcov tool (same as --gcov-info option of geninfo)
+#geninfo_gcov_tool = gcov
+
+# Adjust test names to include operating system information if non-zero
+#geninfo_adjust_testname = 0
+
+# Calculate checksum for each source code line if non-zero (same as --checksum
+# option of geninfo if non-zero, same as --no-checksum if zero)
+#geninfo_checksum = 1
+
+# Specify whether to capture coverage data for external source files (can
+# be overridden by the --external and --no-external options of geninfo/lcov)
+#geninfo_external = 1
+
+# Enable libtool compatibility mode if non-zero (same as --compat-libtool option
+# of geninfo if non-zero, same as --no-compat-libtool if zero)
+#geninfo_compat_libtool = 0
+
+# Use gcov's --all-blocks option if non-zero
+#geninfo_gcov_all_blocks = 1
+
+# Specify compatiblity modes (same as --compat option of geninfo).
+#geninfo_compat = libtool=on, hammer=auto, split_crc=auto
+
+# Adjust path to source files by removing or changing path components that
+# match the specified pattern (Perl regular expression format)
+#geninfo_adjust_src_path = /tmp/build => /usr/src
+
+# Specify if geninfo should try to automatically determine the base-directory
+# when collecting coverage data.
+geninfo_auto_base = 1
+
+# Use gcov intermediate format? Valid values are 0, 1, auto
+geninfo_intermediate = auto
+
+# Specify if exception branches should be excluded from branch coverage.
+geninfo_no_exception_branch = 0
+
+# Directory containing gcov kernel files
+# lcov_gcov_dir = /proc/gcov
+
+# Location of the insmod tool
+lcov_insmod_tool = /sbin/insmod
+
+# Location of the modprobe tool
+lcov_modprobe_tool = /sbin/modprobe
+
+# Location of the rmmod tool
+lcov_rmmod_tool = /sbin/rmmod
+
+# Location for temporary directories
+lcov_tmp_dir = /tmp
+
+# Show full paths during list operation if non-zero (same as --list-full-path
+# option of lcov)
+lcov_list_full_path = 0
+
+# Specify the maximum width for list output. This value is ignored when
+# lcov_list_full_path is non-zero.
+lcov_list_width = 80
+
+# Specify the maximum percentage of file names which may be truncated when
+# choosing a directory prefix in list output. This value is ignored when
+# lcov_list_full_path is non-zero.
+lcov_list_truncate_max = 20
+
+# Specify if function coverage data should be collected and processed.
+lcov_function_coverage = 1
+
+# Specify if branch coverage data should be collected and processed.
+lcov_branch_coverage = 0
diff --git a/Tests/L2HALMockTests/Test_Framework/restart.sh b/Tests/L2HALMockTests/Test_Framework/restart.sh
new file mode 100755
index 00000000..42b1ef67
--- /dev/null
+++ b/Tests/L2HALMockTests/Test_Framework/restart.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+SCRIPT=$(readlink -f "$0")
+SCRIPTS_DIR=`dirname "$SCRIPT"`
+WORKSPACE=$SCRIPTS_DIR/../../../..
+
+echo -e "${GREEN}========================================Run rdkservices===============================================${NC}"
+cd $WORKSPACE
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH/usr/local/lib/:$WORKSPACE/deps/rdk/hdmicec/install/lib:$WORKSPACE/deps/rdk/hdmicec/ccec/drivers/test:$WORKSPACE/deps/rdk/iarmbus/install/:$WORKSPACE/install/usr/lib:$WORKSPACE/deps/rdk/devicesettings/install/lib
+$WORKSPACE/install/usr/bin/WPEFramework -f -c $WORKSPACE/install/etc/WPEFramework/config.json &
\ No newline at end of file
|