-
Notifications
You must be signed in to change notification settings - Fork 21
Adding support for IGT tests #174
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# License | ||
Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
||
# IGT Core Auth Test Script | ||
|
||
## Overview | ||
|
||
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. | ||
|
||
## Features | ||
|
||
- Comprehensive authentication tests | ||
- Environment setup for required dependencies | ||
- Detailed logging of test processes and results | ||
- Color-coded pass/fail summaries | ||
- Output stored in a structured results directory | ||
- Auto-check for required libraries and dependencies | ||
- Compatible with various Linux distributions | ||
|
||
## Prerequisites | ||
|
||
Ensure the following components are present in the target environment: | ||
|
||
- Required authentication libraries and dependencies | ||
- Write access to the filesystem (for environment setup and logging) | ||
|
||
## Directory Structure | ||
```bash | ||
Runner/ | ||
├──suites/ | ||
├ ├── Multimedia/ | ||
│ ├ ├── Display/ | ||
│ ├ ├ ├── core_auth/ | ||
│ ├ ├ ├ ├ └── run.sh | ||
├ ├ ├ ├ ├ └── Display_IGTTestValidation_Readme.md | ||
``` | ||
|
||
## Usage | ||
|
||
1. Copy the script to your target system and make it executable: | ||
|
||
```bash | ||
chmod +x run.sh | ||
``` | ||
|
||
2. Run the script: | ||
|
||
```bash | ||
./run.sh | ||
``` | ||
|
||
3. Logs and test results will be available in the `results/igt_core_auth` directory. | ||
|
||
## Output | ||
|
||
- **Validation Result**: Printed to console and saved in a results file with PASS/FAIL status. | ||
|
||
## Notes | ||
|
||
- The script does not take any arguments. | ||
- It validates the presence of required libraries before executing tests. | ||
- If any critical tool is missing, the script exits with an error message. | ||
|
||
## Maintenance | ||
|
||
- Ensure the authentication libraries remain compatible with your system. | ||
- Update test cases as per new authentication requirements or updates in the IGT Core framework. | ||
|
||
## Run test using: | ||
```bash | ||
git clone <this-repo> | ||
cd <this-repo> | ||
scp -r Runner user@target_device_ip:<Path in device> | ||
ssh user@target_device_ip | ||
``` | ||
|
||
- **Using Unified Runner** | ||
```bash | ||
cd <Path in device>/Runner | ||
``` | ||
|
||
- **Run Core_auth testcase** | ||
```bash | ||
./run-test.sh core_auth | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/bin/sh | ||
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
# SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
TESTNAME="core_auth" | ||
# ---- Source init_env & tools ---- | ||
INIT_ENV="" | ||
SEARCH="$SCRIPT_DIR" | ||
while [ "$SEARCH" != "/" ]; do | ||
if [ -f "$SEARCH/init_env" ]; then INIT_ENV="$SEARCH/init_env"; break; fi | ||
SEARCH=$(dirname "$SEARCH") | ||
done | ||
[ -z "$INIT_ENV" ] && echo "[ERROR] init_env not found" >&2 && exit 1 | ||
# shellcheck disable=SC1090 | ||
[ -z "$__INIT_ENV_LOADED" ] && . "$INIT_ENV" | ||
# shellcheck disable=SC1090,SC1091 | ||
. $TOOLS/functestlib.sh | ||
|
||
test_path=$(find_test_case_by_name "$TESTNAME") | ||
log_info "-----------------------------------------------------------------------------------------" | ||
log_info "-------------------Found $TESTNAME Testcase----------------------------" | ||
|
||
|
||
# Print the start of the test case | ||
echo "-----------------------------------------------------------------------------------------" | ||
echo "-------------------Starting $TESTNAME Testcase----------------------------" | ||
|
||
# Print a message to indicate checking for dependency binary | ||
echo "Checking if dependency binary is available" | ||
|
||
# Check if core_auth is available in system PATH first | ||
if command -v core_auth >/dev/null 2>&1; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use check_dependencies func from Runner/utils/functestlib.sh There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestion to use the check_dependencies function from Runner/utils/functestlib.sh. I understand that it checks whether the required binaries are available in the $PATH. |
||
echo "Found core_auth in system PATH" | ||
CORE_AUTH_CMD="core_auth" | ||
else | ||
# Search for core_auth binary using find | ||
echo "Searching for core_auth binary..." | ||
CORE_AUTH_CMD="" | ||
|
||
# Search in /usr directory tree for core_auth binary | ||
if command -v find >/dev/null 2>&1; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use check_dependencies func from Runner/utils/functestlib.sh |
||
CORE_AUTH_CMD=$(find /usr -type f -name "core_auth" -executable 2>/dev/null | head -n1) | ||
fi | ||
|
||
if [ -n "$CORE_AUTH_CMD" ] && [ -x "$CORE_AUTH_CMD" ]; then | ||
echo "Found core_auth at: $CORE_AUTH_CMD" | ||
else | ||
echo "core_auth binary not found" | ||
log_fail "$TESTNAME : core_auth binary not available" | ||
log_info "Please install IGT (Intel Graphics Tools) package" | ||
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no deterministic results file is available to write RES_FILE |
||
exit 1 | ||
fi | ||
fi | ||
|
||
#kill weston | ||
echo "killing Weston before running core_auth" | ||
pkill weston | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stop weston only if actually running. |
||
sleep 5 | ||
echo "-----------------------------------------------------------------------------------------" | ||
|
||
|
||
# Run the core_auth test and log the output to a file (using relative path for log) | ||
$CORE_AUTH_CMD 2>&1 | tee $test_path/core_auth_log.txt | ||
|
||
# Check the log file for the string "SUCCESS" to determine if the test passed | ||
if grep -q "SUCCESS" $test_path/core_auth_log.txt; then | ||
# If "SUCCESS" is found, print that the test passe | ||
log_pass "$TESTNAME : Test Passed" | ||
echo "$TESTNAME PASS" > $test_path/$TESTNAME.res | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT |
||
|
||
else | ||
# If "SUCCESS" is not found, print that the test failed | ||
log_fail "$TESTNAME : Test Failed" | ||
echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT |
||
fi | ||
|
||
# Print the completion of the test case | ||
echo "-------------------Completed $TESTNAME Testcase----------------------------" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if !test_path