-
Notifications
You must be signed in to change notification settings - Fork 5
Functional Test Updates and CI Support Scripts #67
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?
Conversation
Add GitHub Actions workflow for automated hardware testing on AST1060. The workflow runs in two stages: 1. Precommit checks on ubuntu-22.04: - Verify Cargo.lock - Run cargo xtask precommit (format/lint/build) - Upload bloat reports 2. Hardware functional tests on self-hosted runner with AST1060: - Build firmware with test features (hmac, hash, rsa, ecdsa) - Generate UART boot image with proper 4-byte size header - Upload firmware via UART following AST1060 boot protocol - Monitor test execution and parse PASS/FAIL/SKIP results - Upload test logs and artifacts The workflow supports manual triggering with test suite selection and only runs hardware tests if precommit checks pass.
- Added instructions on how to configure the test host environment. - Added scripts required to package the binary and kick off the test.
This fully encapsulates the test flow into Python. Use of tio has been removed and replaced entirely by pyserial, removing the complication of an external tool. TODO: The test firmware itself needs a clear delineator when it is complete that we can look for. As it stands, tests just sort of run and complete with inconsistent syntax, and eventually we run out of tests and get stuck looking at timer ISR test leftovers. As it stands the script will time out after 600 seconds. All test output is logged to a file within the working directory. The script also serves as a tool to manipulate the GPIOs controlling boot functionality, and can be configured to target different GPIOs if needed.
Made tests outputs more consistent, but further refinements are necessary. Also added a test end print and adjusted the script to key off of it.
Move i2c to i2c2
The --upload-only parameter lets us target devices that we have only manual SRST and UART control over.
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.
Please see my review comment and test results below.
| return False | ||
|
|
||
| # Keep only last few lines in buffer | ||
| buffer = '\n'.join(lines[-10:]) |
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.
The line buffer = '\n'.join(lines[-10:]) retains already-processed lines, causing the loop to re-scan them in the next iteration. This leads to double-counting of PASS/FAIL results.
Test execution completed!
Results: {'passed': 119, 'failed': 6, 'skipped': 0}
❌ Test execution failed!
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.
I verified that applying the following patch fixes the issue by only retaining the last incomplete fragment:
diff --git a/scripts/uart-test-exec.py b/scripts/uart-test-exec.py
index 9530f94..05ba45c 100644
--- a/scripts/uart-test-exec.py
+++ b/scripts/uart-test-exec.py
@@ -309,7 +309,7 @@ class UartTestExecutor:
# Parse test results
lines = buffer.split('\n')
- for line in lines:
+ for line in lines[:-1]:
if 'PASS' in line:
test_results['passed'] += 1
elif 'FAIL' in line:
@@ -328,7 +328,7 @@ class UartTestExecutor:
return False
# Keep only last few lines in buffer
- buffer = '\n'.join(lines[-10:])
+ buffer = lines[-1]With this fix, the counts are correct (showing 3 fails instead of 6):
Test execution completed!
Results: {'passed': 43, 'failed': 3, 'skipped': 0}
❌ Test execution failed!
Basic help is in the root, detailed documentation of the CI support script and configuration is in docs/ci-aspeed.md
This also refines the functional test structure to make it more machine parseable. This is effectively a manual convention due to lack of a test infrastructure to enforce it, but it ensures the script only has to key on 4 tokens.