-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #269 from rdkcentral/feature/issue268_CompositeIn_…
…L3_videomodeCBSupport gh #268 CompositeIn L3 testcase for new API
- Loading branch information
Showing
6 changed files
with
276 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
123 changes: 123 additions & 0 deletions
123
host/tests/L3_TestCases/dsCompositeIn/dsCompositeIn_test5_VerifyVideoMode_Callback.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
#!/usr/bin/env python3 | ||
#** ***************************************************************************** | ||
# * | ||
# * 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 os | ||
import sys | ||
from enum import Enum, auto | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
sys.path.append(os.path.join(dir_path, "../../")) | ||
|
||
from dsCompositeInHelperClass import dsCompositeInHelperClass | ||
from raft.framework.core.logModule import logModule | ||
|
||
class dsCompositeIn_test5_VerifyVideoMode_Callback(dsCompositeInHelperClass): | ||
""" | ||
Test class to verify the videomode change callback of CompositeIn device | ||
This class uses the `dscompositeInClass` to interact with the device's compositeIn ports, | ||
downloading necessary test assets, selecting | ||
CompositeIn ports, and performing verification of compositeIn output. | ||
""" | ||
|
||
def __init__(self, log:logModule=None): | ||
""" | ||
Initializes the test5_VerifyVideoMode_Callback test . | ||
Args: | ||
None. | ||
""" | ||
self.testName = "test5_VerifyVideoMode_Callback" | ||
self.qcID = '5' | ||
super().__init__(self.testName, self.qcID, log) | ||
|
||
#TODO: Current version supports only manual verification. | ||
def CheckDeviceStatus(self, manual=False, connect=False, port_type:str=0): | ||
""" | ||
Verifies whether Composite Source Device connected or not | ||
Args: | ||
port_type (str) : CompositeIn port | ||
manual (bool, optional): Manual verification (True: manual, False: other verification methods). | ||
Defaults to other verification methods | ||
Returns: | ||
bool | ||
""" | ||
if manual: | ||
message = ( | ||
f"Check if CompositeIn source is connected to {port_type} and press Y:" | ||
if connect | ||
else f"Change the resolution of the video played from CompositeIn source device connected to {port_type} and press Y:" | ||
) | ||
return self.testUserResponse.getUserYN(message) | ||
else : | ||
#TODO: Add automation verification methods | ||
return False | ||
|
||
def testFunction(self): | ||
""" | ||
The main test function that verifies videomode change status of CompositeIn device. | ||
This function: | ||
- Verifies CompositeIn videomode change status through callbacks. | ||
Returns: | ||
bool: Final result of the test. | ||
""" | ||
|
||
# Initialize the dsCompositeIn module | ||
self.testdsCompositeIn.initialise() | ||
|
||
# Loop through the supported CompositeIn ports | ||
for port in self.testdsCompositeIn.getSupportedPorts(): | ||
|
||
# Check the CompositeIn device connected to is active | ||
portstr = f"dsCOMPOSITE_IN_PORT_{port}" | ||
self.log.stepStart(f'Select {port} Port') | ||
connect = True | ||
result = self.CheckDeviceStatus(True, connect, portstr) | ||
self.log.stepResult(result,f'CompositeIn Device connected {result} on {portstr}') | ||
|
||
self.testdsCompositeIn.selectPort(portstr) | ||
self.log.stepStart(f'Port Selcted {portstr}') | ||
|
||
connect = False | ||
result = self.CheckDeviceStatus(True, connect, portstr) | ||
|
||
status = self.testdsCompositeIn.getVideoModeChangeCallbackStatus() | ||
if status != None and portstr == status[0]: | ||
self.log.stepResult(True,f'Videoresolution {status[1]} and VideoFramerate {status[2]} found in Callback') | ||
else: | ||
self.log.stepResult(False,f'Videomode change not found in Callback') | ||
|
||
# Terminate testdsCompositeIn Module | ||
self.testdsCompositeIn.terminate() | ||
|
||
return result | ||
|
||
if __name__ == '__main__': | ||
summerLogName = os.path.splitext(os.path.basename(__file__))[0] + "_summery" | ||
summeryLog = logModule(summerLogName, level=logModule.INFO) | ||
test = dsCompositeIn_test5_VerifyVideoMode_Callback(summeryLog) | ||
test.run(False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters