Skip to content

Commit 9b25648

Browse files
Manasa Bethapallilab4906 User
authored andcommitted
added display test
Signed-off-by: Manasa Bethapalli <[email protected]>
1 parent ec8d3f1 commit 9b25648

File tree

2 files changed

+117
-0
lines changed

2 files changed

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

0 commit comments

Comments
 (0)