diff --git a/Runner/suites/Multimedia/Display/core_auth/Display_IGTTestValidation_Readme.md b/Runner/suites/Multimedia/Display/core_auth/Display_IGTTestValidation_Readme.md new file mode 100644 index 00000000..7696910d --- /dev/null +++ b/Runner/suites/Multimedia/Display/core_auth/Display_IGTTestValidation_Readme.md @@ -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 +cd +scp -r Runner user@target_device_ip: +ssh user@target_device_ip +``` + +- **Using Unified Runner** +```bash +cd /Runner +``` + +- **Run Core_auth testcase** +```bash +./run-test.sh core_auth +``` \ No newline at end of file diff --git a/Runner/suites/Multimedia/Display/core_auth/run.sh b/Runner/suites/Multimedia/Display/core_auth/run.sh new file mode 100755 index 00000000..9883dcd1 --- /dev/null +++ b/Runner/suites/Multimedia/Display/core_auth/run.sh @@ -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 + 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 + 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 + exit 1 + fi +fi + +#kill weston +echo "killing Weston before running core_auth" +pkill weston +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 + +else + # If "SUCCESS" is not found, print that the test failed + log_fail "$TESTNAME : Test Failed" + echo "$TESTNAME FAIL" > $test_path/$TESTNAME.res +fi + +# Print the completion of the test case +echo "-------------------Completed $TESTNAME Testcase----------------------------"