Skip to content
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

SGX MVP integration tests #204

Merged
merged 1 commit into from
Oct 1, 2024
Merged
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
57 changes: 54 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
- name: Ledger Signer's unit tests
run: firmware/src/ledger/signer/test/run-all.sh

run-integration-tests:
name: Integration tests
run-integration-tests-tcpsigner:
name: Integration tests for TCPSigner
runs-on: ubuntu-20.04

steps:
Expand All @@ -63,7 +63,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: rootstock/hsm-integration-test
ref: 5.1.0.plus
ref: 5.3.0.plus
path: hsm-integration-test
ssh-key: ${{ secrets.HSM_INTEGRATION_TEST_SSH_KEY }}

Expand All @@ -78,3 +78,54 @@ jobs:
- name: Run HSM integration tests
working-directory: hsm-integration-test
run: sh smoke-test.sh

run-integration-tests-sgx:
name: Integration tests for SGX simulator
runs-on: ubuntu-20.04

steps:
- name: Checkout rsk-powhsm repo
uses: actions/checkout@v3
with:
path: rsk-powhsm

- name: Build required software
working-directory: rsk-powhsm
run: |
docker/mware/build
docker/packer/build
docker/sgx/build
middleware/build/manager_sgx
docker/sgx/do-notty /hsm2/firmware/src/sgx "make generate-private-key"
firmware/build/build-sgx-sim \
0xe108960a242ad7bd45c21aff9c7ed9c516789e9cffacdd895502727d8f460d2c \
0x6E regtest

- name: Checkout hsm-integration-test repo
uses: actions/checkout@v3
with:
repository: rootstock/hsm-integration-test
ref: 5.3.0.plus
path: hsm-integration-test
ssh-key: ${{ secrets.HSM_INTEGRATION_TEST_SSH_KEY }}

- name: Copy required files
run: |
mkdir hsm-integration-test/docker/manager/manager_sgx
tar -xzf rsk-powhsm/middleware/bin/manager_sgx.tgz \
-C hsm-integration-test/docker/manager/manager_sgx
cp rsk-powhsm/firmware/src/sgx/bin/hsmsgx \
hsm-integration-test/docker/sgx
cp rsk-powhsm/firmware/src/sgx/bin/hsmsgx_enclave.signed \
hsm-integration-test/docker/sgx
echo abcd1234 > hsm-integration-test/docker/manager/pin.txt
echo -n abcd1234 > hsm-integration-test/docker/sgx/kvstore-password.dat
echo -en "\x03" > hsm-integration-test/docker/sgx/kvstore-retries.dat
echo -en "\x03" > hsm-integration-test/docker/sgx/kvstore-retries.dat
dd if=/dev/urandom bs=1 count=32 \
of=hsm-integration-test/docker/sgx/kvstore-seed.dat
echo "SGX_SIM=yes" >> "$GITHUB_ENV"

- name: Run HSM integration tests
working-directory: hsm-integration-test
run: sh smoke-test.sh
Loading