Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```
80 changes: 80 additions & 0 deletions Runner/suites/Multimedia/Display/core_auth/run.sh
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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if !test_path

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use check_dependencies func from Runner/utils/functestlib.sh

Copy link
Author

Choose a reason for hiding this comment

The 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.
Since IGT binaries are typically located in /usr/libexec/igt-gpu-tools/, which isn't part of the default $PATH, the user would need to manually move the required binaries to a standard location like /usr/bin/ or /usr/local/bin/ to make them discoverable by check_dependencies. This script doesn't handle that relocation, so it would be a manual prerequisite for running the tests.
Let me know if you're okay with this assumption, or if you'd prefer a different approach.

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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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----------------------------"
Loading