Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh #44 Initial L3 C-Test Code generation. #45

Open
wants to merge 31 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
18df7b4
gh #44 Initial L3 Low level desig document for the hdmi cec sink device
srinivasgtl Jul 19, 2024
178e1bf
gh#44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 22, 2024
8c06c4c
gh #44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 22, 2024
e3240dd
gh #44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 22, 2024
5eb801b
gh #44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 23, 2024
c68bf77
gh #44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 24, 2024
ab6c14b
gh #44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 24, 2024
967267a
gh #44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 24, 2024
a96f61a
gh #44 Initial Test data profile
srinivasgtl Jul 24, 2024
aa82cb5
gh #44 updating the yaml file
srinivasgtl Jul 24, 2024
b844a14
gh#44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 25, 2024
fa9b966
gh #44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 25, 2024
eb5c542
gh #44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 25, 2024
a77a0b6
gh #44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 25, 2024
b4197d2
gh #44 Update hdmi-cec-sink-L3-Low-Level_TestSpec.md
srinivasgtl Jul 25, 2024
69271b6
gh #44 Initial version of L3 Test interfaces
srinivasgtl Aug 6, 2024
a7ad136
gh #44 - Updated the documentation part.
srinivasgtl Aug 6, 2024
44f08d7
gh #44 Updated with proper logging
srinivasgtl Aug 22, 2024
da92d35
gh #44 updated with assert and other logging mechanism changes
srinivasgtl Sep 18, 2024
a839f6c
gh #44 Updates to hdmicec to fix compilation issues
srinivasgtl Nov 21, 2024
797aca3
gh #44 adding cec commands and responses
srinivasgtl Nov 24, 2024
329c86f
gh #44 Updated test cases to use cec adaptor
srinivasgtl Dec 5, 2024
e65b306
gh #44 Updated test cases to use cec adaptor
bhanucbp Dec 9, 2024
079741e
gh #44 L3 test case development
bhanucbp Dec 11, 2024
3e943a3
gh #44 L3 test case development
bhanucbp Dec 12, 2024
9b498c5
gh #44 L3 test case development
bhanucbp Dec 12, 2024
2ce8ce1
gh #44 L3 test case development
bhanucbp Dec 17, 2024
e3800ce
gh #44 L3 test case development
Dec 17, 2024
429ac71
gh #44 L3 test case development
bhanucbp Dec 19, 2024
10f60e8
gh #44 L3 test case development
bhanucbp Dec 20, 2024
b637432
gh #44 L3 test case development
bhanucbp Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"args": [ "--config", "example_rack_config.yml",
"--deviceConfig", "deviceConfig.yml"],
"console": "integratedTerminal"
},
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"stopAtEntry": false,
"externalConsole": false,
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/bin/hal_test",
"environment": [ {"name": "LD_LIBRARY_PATH", "value":"${workspaceFolder}/bin/"} ],
"args": [ "-l", "${workspaceFolder}/logs/", "-p", "${workspaceFolder}/profiles/sink/Sink_AudioSettings.yaml" ],
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ export HAL_LIB_DIR
build: $(SETUP_SKELETON_LIBS)
echo "SETUP_SKELETON_LIBS $(SETUP_SKELETON_LIBS)"
@echo UT [$@]
make -C ./ut-core framework
make -C ./ut-core test

make -C ./ut-core TARGET=${TARGET}
rm -rf $(BIN_DIR)/lib$(HAL_LIB).so
rm -rf $(ROOT_DIR)/libs/lib$(HAL_LIB).so
#Build against the real library leads to the SOC library dependency also.SOC lib dependency cannot be specified in the ut Makefile, since it is supposed to be common across may platforms. So in order to over come this situation, creating a template skelton library with empty templates so that the template library wont have any other Soc dependency. And in the real platform mount copy bind with the actual library will work fine.
skeleton:
echo $(CC)
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ NC="\e[39m"
# When the major version changes in the ut-core, what that signals is that the testings will have to be upgraded to support that version
# Therefore in that case it warns you but doesnt' chnage to that version, which could cause your tests to break.
# Change this to upgrade your UT-Core Major versions. Non ABI Changes 1.x.x are supported, between major revisions
UT_PROJECT_MAJOR_VERSION="3."
UT_PROJECT_MAJOR_VERSION="4."

# Clone the Unit Test Requirements
[email protected]:rdkcentral/ut-core.git
Expand Down
193 changes: 193 additions & 0 deletions docs/pages/hdmi-cec-L3_TestProcedure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
# dsAudio HAL L3 Python Test Procedure

## Table of Contents

- [Acronyms, Terms and Abbreviations](#acronyms-terms-and-abbreviations)
- [Setting Up Test Environment](#setting-up-test-environment)
- [Streams Required](#streams-required)
- [Test Cases](#test-cases)
- [dsAudio_L3_Runall_Sink.py](#dsaudio_l3_runall_sinkpy)
- [dsAudio_L3_Runall_Source.py](#dsaudio_l3_runall_sourcepy)
- [dsaudio_test01_enabledisableandverifyaudioportstatus.py](#dsaudio_test01_enabledisableandverifyaudioportstatuspy)

## Acronyms, Terms and Abbreviations

- `HAL` - Hardware Abstraction Layer
- `L3` - Level 3 Testing
- `DUT` - Device Under Test
- `RAFT` - Rapid Automation Framework for Testing
- `YAML` - YAML Ain't Markup Language
- `HDMI` - High Definition Multimedia Interface
- `API` - Application Program Interface
- `SoC` - System on Chip
- `DUT` - Device Under Test
- `LA` - Logical Address
- `PA` - Physical Address

## Setting Up Test Environment

To execute `HAL` `L3` Python test cases, need a Python environment. Follow these steps mentioned in [HPK Public Documentation](https://github.com/rdkcentral/rdk-hpk-documentation/blob/main/README.md)

### Update Configuration Files

#### Rack Configuration File

Example Rack configuration File: [example_rack_config.yml](../../../ut/host/tests/configs/example_rack_config.yml)

For more details refer [RAFT](https://github.com/rdkcentral/python_raft/blob/1.0.0/README.md) and [example_rack_config.yml](https://github.com/rdkcentral/python_raft/blob/1.0.0/examples/configs/example_rack_config.yml)

In this file, update the configuration to define the console sessions for the `DUT` and the outbound settings:

|Console Session|Description|
|---------------|-----------|
|default|Downloads the streams required for test cases|
|ssh_hal_test|Executes the `HAL` binary for the test case|

```yaml
rackConfig:
- dut:
ip: "XXX.XXX.XXX.XXX" # IP Address of the device
description: "stb device under test"
platform: "stb"
consoles:
- default:
type: "ssh"
port: 10022
username: "root"
ip: "XXX.XXX.XXX" # IP address of the device
password: ' '
- ssh_hal_test:
type: "ssh"
port: 10022
username: "root"
ip: "XXX.XXX.XXX" # IP address of the device
password: ' '
outbound:
download_url: "http://localhost:8000/" # download location for the CPE device
httpProxy: # Local Proxy if required
workspaceDirectory: './logs/workspace' # Local working directory
```

#### Device Configuration File

Example Device configuration File: [deviceConfig.yml](../../../ut/host/tests/configs/deviceConfig.yml)

For more details refer [RAFT](https://github.com/rdkcentral/python_raft/blob/1.0.0/README.md) and [example_device_config.yml](https://github.com/rdkcentral/python_raft/blob/1.0.0/examples/configs/example_device_config.yml)

Update below fileds in the device configuration file:

- Set the path for `target_directory` where `HAL` binaries will be copied onto the device.
- Specify the device profile path in `test/profile`
- Ensure the `platform` should match with the `DUT` `platform` in [Rack Configuration](#rack-configuration-file)

```yaml
deviceConfig:
cpe1:
platform: "tv"
model: "uk"
soc_vendor: "soc"
target_directory: "/tmp/" # Target Directory on device
prompt: ""
test:
profile: "../../../profiles/sink/sink_hdmiCEC.yml"
```

#### Test Configuration

Example Test Setup configuration File: [hdmiCEC_testConfig.yml](../../../ut/host/tests/classes/hdmiCEC_testConfig.yml)

Execute command to run te HAL binary was provided in this file.

```yaml
hdmicec:
description: "hdmi CEC testing profile / menu system for UT"
test:
artifacts:
#List of artifacts folders, test class copies the content of folder to the target device workspace
- "../../../bin/"
# exectute command, this will appended with the target device workspace path
execute: "run.sh"
type: UT-C # C (UT-C Cunit) / C++ (UT-G (g++ ut-core gtest backend))
```

## Run Test Cases

Once the environment is set up, you can execute the test cases with the following command

```bash
python <TestCaseName.py> --config </PATH>/ut/host/tests/configs/example_rack_config.yml --deviceConfig </PATH>/ut/host/tests/configs/deviceConfig.yml
```

## Test Cases

### dsAudio_L3_Runall_Sink.py

This python file runs all the tests supported by `sink` devices

```bash
python dsAudio_L3_Runall_Sink.py --config </PATH>/ut/host/tests/configs/example_rack_config.yml --deviceConfig </PATH>/ut/host/tests/configs/deviceConfig.yml
```

### dsAudio_L3_Runall_Source.py

This python file runs all the tests supported by `source` devices

```bash
python dsAudio_L3_Runall_Source.py --config </PATH>/ut/host/tests/configs/example_rack_config.yml --deviceConfig </PATH>/ut/host/tests/configs/deviceConfig.yml
```

### dsAudio_test01_EnableDisableAndVerifyAudioPortStatus.py

#### Platform Support - test01

- Source
- Sink

#### User Input Required - test01

**Yes**: User interaction is necessary to confirm audio playback status (This will be automated later).

#### Acceptance Criteria - test01

Play **Stream #1** and confirm that audio is heard through the supported ports.

#### Expected Results - test01

The test enables the specified audio ports, plays the audio stream, and subsequently disables the ports

Success Criteria

- User should hear audio through the enabled port during playback
- User should not hear any audio when the port is disabled.

#### Test Steps - test01

- Initiate the Test:

- Select and execute the Python file: **`dsAudio_test01_EnableDisableAndVerifyAudioPortStatus.py`**
- The test will automatically download all required artifacts and streams, copying them to the designated target directory before commencing execution.

- Audio Playback Verification:

The test will play the designated audio stream and prompt the user with the following:

- Question: "Is audio playing on the enabled audio port? (Y/N)"
- Press **Y** if audio is heard (this will mark the step as PASS).
- Press **N** if no audio is heard (this will mark the step as FAIL).

- Audio Status Confirmation (Port Disabled):

After confirming audio playback, the test will disable the audio port and prompt the user again:

- Question: "Is audio playing when the port is disabled? (Y/N)"
- Press **N** if no audio is heard (this will mark the step as PASS).
- Press **Y** if audio is heard (this will mark the step as FAIL).

- Repeat for All Ports:

The test will iterate through all available audio ports, enabling/disabling each one and collecting user feedback accordingly.

- Test Conclusion:

Upon receiving user responses for all ports, the test will conclude and present a final result: PASS or FAIL based on the user inputs throughout the test execution.

Loading