-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SGX support to firmware test framework
- Implemented middleware HSM2Dongle for SGX - Updated test runner to support SGX in addition to Ledger and x86 - Added packaging capabilities to be able to copy the test suite to an SGX host - Renamed the test targets to account for the additional "real device" platforms - Updated documentation
- Loading branch information
1 parent
f0925fe
commit 2efb81b
Showing
37 changed files
with
256 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
# Ignore compiled python modules and cache | ||
**/*.pyc | ||
**/__pycache__ | ||
|
||
|
||
# Ignore package artifacts | ||
package/bin | ||
package/build | ||
package/run.spec | ||
package/bundle.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
FROM python:3.12-slim-bookworm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
if [[ $1 == "exec" ]]; then | ||
# Directories | ||
PACKAGE_DIR=$(dirname $0) | ||
BIN_DIR=bin | ||
|
||
# Remove existing build | ||
|
||
# Build | ||
echo "Building test runner..." | ||
|
||
cd $PACKAGE_DIR | ||
rm -rf $BIN_DIR | ||
mkdir $BIN_DIR | ||
pyinstaller --distpath $BIN_DIR --onefile ../run.py | ||
rm -rf build run.spec | ||
|
||
echo "Done." | ||
else | ||
REPO_ROOT=$(dirname $0)/../../.. | ||
TESTS_DIR=$(realpath $(dirname $0)/.. --relative-to=$REPO_ROOT) | ||
|
||
$REPO_ROOT/docker/mware/do-notty-nousb /hsm2/$TESTS_DIR "./package/$(basename $0) exec" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Directories and files | ||
PACKAGE_DIR=$(dirname $0) | ||
BIN_DIR=$PACKAGE_DIR/bin | ||
RUNNER_FILE=$BIN_DIR/run | ||
RESOURCES_DIR=$PACKAGE_DIR/../resources | ||
TARGET_DIR=$PACKAGE_DIR/bundle | ||
BUNDLE_FILE=$PACKAGE_DIR/bundle.tgz | ||
|
||
rm -rf $TARGET_DIR | ||
mkdir $TARGET_DIR | ||
$PACKAGE_DIR/build-runner | ||
mkdir $TARGET_DIR/bin | ||
cp $RUNNER_FILE $TARGET_DIR/bin | ||
echo "Copying files..." | ||
cp -R $RESOURCES_DIR $TARGET_DIR | ||
cp $PACKAGE_DIR/Dockerfile $TARGET_DIR | ||
cp $PACKAGE_DIR/run-with-docker $TARGET_DIR | ||
echo "Generating package..." | ||
tar -czf $BUNDLE_FILE -C $TARGET_DIR . | ||
echo "Cleaning up..." | ||
rm -rf $TARGET_DIR $BIN_DIR | ||
echo "Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$(realpath $(dirname $0)) | ||
DOCKER_IMAGE=powhsm:tests | ||
|
||
docker build -t $DOCKER_IMAGE . | ||
docker run -ti --rm -v $SCRIPT_DIR:/tests --add-host=host.docker.internal:host-gateway -w /tests $DOCKER_IMAGE ./bin/run $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
firmware/test/resources/622-sign-segwit-long-witnessscript.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
firmware/test/resources/700-dongle-fake-receipt-root-fails.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.