Skip to content

Commit bfecb77

Browse files
committed
Adding support for IGT tests
Add Display IGT Core Auth test suite Add test files for Display IGT Core Authentication validation: - Display_IGTTestValidation_Readme.md: Documentation with usage instructions - run.sh: Script to execute and validate core_auth tests Signed-off-by: vsalipal <[email protected]>
1 parent 78e2929 commit bfecb77

File tree

2 files changed

+159
-0
lines changed

2 files changed

+159
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# License
2+
Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
3+
SPDX-License-Identifier: BSD-3-Clause-Clear
4+
5+
# IGT Core Auth Test Script
6+
7+
## Overview
8+
9+
This script automates the validation of authentication mechanisms within the IGT Core framework. It performs a series of tests to ensure that the authentication processes are functioning correctly and securely. The script captures detailed logs and provides a summary of the test results.
10+
11+
## Features
12+
13+
- Comprehensive authentication tests
14+
- Environment setup for required dependencies
15+
- Detailed logging of test processes and results
16+
- Color-coded pass/fail summaries
17+
- Output stored in a structured results directory
18+
- Auto-check for required libraries and dependencies
19+
- Compatible with various Linux distributions
20+
21+
## Prerequisites
22+
23+
Ensure the following components are present in the target environment:
24+
25+
- Required authentication libraries and dependencies
26+
- Write access to the filesystem (for environment setup and logging)
27+
28+
## Directory Structure
29+
```bash
30+
Runner/
31+
├──suites/
32+
├ ├── Multimedia/
33+
│ ├ ├── Display/
34+
│ ├ ├ ├── core_auth/
35+
│ ├ ├ ├ ├ └── run.sh
36+
├ ├ ├ ├ ├ └── Display_IGTTestValidation_Readme.md
37+
```
38+
39+
## Usage
40+
41+
1. Copy the script to your target system and make it executable:
42+
43+
```bash
44+
chmod +x run.sh
45+
```
46+
47+
2. Run the script:
48+
49+
```bash
50+
./run.sh
51+
```
52+
53+
3. Logs and test results will be available in the `results/igt_core_auth` directory.
54+
55+
## Output
56+
57+
- **Validation Result**: Printed to console and saved in a results file with PASS/FAIL status.
58+
59+
## Notes
60+
61+
- The script does not take any arguments.
62+
- It validates the presence of required libraries before executing tests.
63+
- If any critical tool is missing, the script exits with an error message.
64+
65+
## Maintenance
66+
67+
- Ensure the authentication libraries remain compatible with your system.
68+
- Update test cases as per new authentication requirements or updates in the IGT Core framework.
69+
70+
## Run test using:
71+
```bash
72+
git clone <this-repo>
73+
cd <this-repo>
74+
scp -r Runner user@target_device_ip:<Path in device>
75+
ssh user@target_device_ip
76+
```
77+
78+
- **Using Unified Runner**
79+
```bash
80+
cd <Path in device>/Runner
81+
```
82+
83+
- **Run Core_auth testcase**
84+
```bash
85+
./run-test.sh core_auth
86+
```
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/bin/sh
2+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
3+
# SPDX-License-Identifier: BSD-3-Clause-Clear
4+
5+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
6+
TESTNAME="core_auth"
7+
# ---- Source init_env & tools ----
8+
INIT_ENV=""
9+
SEARCH="$SCRIPT_DIR"
10+
while [ "$SEARCH" != "/" ]; do
11+
if [ -f "$SEARCH/init_env" ]; then INIT_ENV="$SEARCH/init_env"; break; fi
12+
SEARCH=$(dirname "$SEARCH")
13+
done
14+
[ -z "$INIT_ENV" ] && echo "[ERROR] init_env not found" >&2 && exit 1
15+
# shellcheck disable=SC1090
16+
[ -z "$__INIT_ENV_LOADED" ] && . "$INIT_ENV"
17+
# shellcheck disable=SC1090,SC1091
18+
. $TOOLS/functestlib.sh
19+
20+
test_path=$(find_test_case_by_name "$TESTNAME")
21+
log_info "-----------------------------------------------------------------------------------------"
22+
log_info "-------------------Found $TESTNAME Testcase----------------------------"
23+
24+
25+
# Print the start of the test case
26+
echo "-----------------------------------------------------------------------------------------"
27+
echo "-------------------Starting $TESTNAME Testcase----------------------------"
28+
29+
# Print a message to indicate checking for dependency binary
30+
echo "Checking if dependency binary is available"
31+
32+
# Check if core_auth is available in system PATH first
33+
if command -v core_auth >/dev/null 2>&1; then
34+
echo "Found core_auth in system PATH"
35+
CORE_AUTH_CMD="core_auth"
36+
else
37+
# Search for core_auth binary using find
38+
echo "Searching for core_auth binary..."
39+
CORE_AUTH_CMD=""
40+
41+
# Search in /usr directory tree for core_auth binary
42+
if command -v find >/dev/null 2>&1; then
43+
CORE_AUTH_CMD=$(find /usr -type f -name "core_auth" -executable 2>/dev/null | head -n1)
44+
fi
45+
46+
if [ -n "$CORE_AUTH_CMD" ] && [ -x "$CORE_AUTH_CMD" ]; then
47+
echo "Found core_auth at: $CORE_AUTH_CMD"
48+
else
49+
echo "core_auth binary not found"
50+
log_fail "$TESTNAME : core_auth binary not available"
51+
log_info "Please install IGT (Intel Graphics Tools) package"
52+
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
53+
exit 1
54+
fi
55+
fi
56+
57+
# Run the core_auth test and log the output to a file (using relative path for log)
58+
$CORE_AUTH_CMD 2>&1 | tee $test_path/core_auth_log.txt
59+
60+
# Check the log file for the string "SUCCESS" to determine if the test passed
61+
if grep -q "SUCCESS" $test_path/core_auth_log.txt; then
62+
# If "SUCCESS" is found, print that the test passe
63+
log_pass "$TESTNAME : Test Passed"
64+
echo "$TESTNAME PASS" > $test_path/$TESTNAME.res
65+
66+
else
67+
# If "SUCCESS" is not found, print that the test failed
68+
log_fail "$TESTNAME : Test Failed"
69+
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
70+
fi
71+
72+
# Print the completion of the test case
73+
echo "-------------------Completed $TESTNAME Testcase----------------------------"

0 commit comments

Comments
 (0)