Skip to content

Commit 1e7b674

Browse files
committed
Added Display Test
Signed-off-by: Manasa Bethapalli <[email protected]>
1 parent ec8d3f1 commit 1e7b674

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2+
# SPDX-License-Identifier: BSD-3-Clause-Clear
3+
4+
# IGT Core Auth Test Script
5+
6+
## Overview
7+
8+
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.
9+
10+
## Features
11+
12+
- Comprehensive authentication tests
13+
- Environment setup for required dependencies
14+
- Detailed logging of test processes and results
15+
- Color-coded pass/fail summaries
16+
- Output stored in a structured results directory
17+
- Auto-check for required libraries and dependencies
18+
- Compatible with various Linux distributions
19+
20+
## Prerequisites
21+
22+
Ensure the following components are present in the target environment:
23+
24+
- Required authentication libraries and dependencies
25+
- Write access to the filesystem (for environment setup and logging)
26+
27+
## Directory Structure
28+
29+
```bash
30+
results/
31+
├── igt_core_auth/
32+
│ ├── auth_test_<test>.txt
33+
34+
```
35+
36+
## Usage
37+
38+
1. Copy the script to your target system and make it executable:
39+
40+
```bash
41+
chmod +x run.sh
42+
```
43+
44+
2. Run the script:
45+
46+
```bash
47+
./run.sh
48+
```
49+
50+
3. Logs and test results will be available in the `results/igt_core_auth` directory.
51+
52+
## Output
53+
54+
- **Validation Result**: Printed to console and saved in a results file with PASS/FAIL status.
55+
56+
## Notes
57+
58+
- The script does not take any arguments.
59+
- It validates the presence of required libraries before executing tests.
60+
- If any critical tool is missing, the script exits with an error message.
61+
62+
## Maintenance
63+
64+
- Ensure the authentication libraries remain compatible with your system.
65+
- Update test cases as per new authentication requirements or updates in the IGT Core framework.
66+
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/sh
2+
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
3+
# SPDX-License-Identifier: BSD-3-Clause-Clear
4+
5+
# Import test suite definitions
6+
. $(pwd)/init_env
7+
TESTNAME="core_auth"
8+
9+
# Import test functions
10+
. $TOOLS/functestlib.sh
11+
12+
test_path=$(find_test_case_by_name "$TESTNAME")
13+
log_info "-----------------------------------------------------------------------------------------"
14+
log_info "-------------------Starting $TESTNAME Testcase----------------------------"
15+
16+
17+
# Print the start of the test case
18+
echo "-----------------------------------------------------------------------------------------"
19+
echo "-------------------Starting $TESTNAME Testcase----------------------------"
20+
21+
# Print a message to indicate checking for dependency binary
22+
echo "Checking if dependency binary is available"
23+
24+
# Set the library path for the IGT tests
25+
if [ -d "/data/" ] && [ -d "/data/igt/lib" ]; then
26+
# Set the LD_LIBRARY_PATH environment variable
27+
export LD_LIBRARY_PATH=/data/igt/lib
28+
echo "LD_LIBRARY_PATH is set to /data/igt/lib"
29+
else
30+
echo "Directory either /data/ or /data/igt/lib or both does not exist"
31+
exit 1
32+
fi
33+
34+
# Navigate to the directory containing the IGT tests
35+
cd /data/igt/tests/
36+
37+
# Run the core_auth test and log the output to a file
38+
./core_auth 2>&1 | tee /data/core_auth_log.txt
39+
40+
# Check the log file for the string "SUCCESS" to determine if the test passed
41+
if grep -q "SUCCESS" /data/core_auth_log.txt; then
42+
# If "SUCCESS" is found, print that the test passe
43+
log_pass "$TESTNAME : Test Passed"
44+
echo "$TESTNAME PASS" > $test_path/$TESTNAME.res
45+
46+
else
47+
# If "SUCCESS" is not found, print that the test failed
48+
log_pass "$TESTNAME : Test Failed"
49+
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res
50+
fi
51+
52+
# Print the completion of the test case
53+
echo "-------------------Completed $TESTNAME Testcase----------------------------"

0 commit comments

Comments
 (0)