Skip to content

Commit

Permalink
gh action to publish the provider snap (#241)
Browse files Browse the repository at this point in the history
* gh action to publish the provider snap

* rename checkbox provider from checkbox-tdx-classic to checkbox-tdx
  • Loading branch information
hector-cao authored Oct 4, 2024
1 parent 82cd552 commit 198137e
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 16 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/create-snap-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,21 @@ on:

jobs:

check-secret:
runs-on: ubuntu-22.04
outputs:
snap-key: ${{ steps.snap-key.outputs.defined }}
steps:
- id: snap-key
name: Set defined=true if SNAPCRAFT7_CREDS is defined
if: "${{ env.SNAPSTORE_KEY != '' }}"
run: echo "defined=true" >> $GITHUB_OUTPUT
env:
SNAPSTORE_KEY: ${{ secrets.SNAPCRAFT7_CREDS }}

build:
runs-on: ubuntu-22.04
needs: [check-secret]
steps:
- uses: actions/checkout@v4
name: Checkout
Expand All @@ -34,3 +47,12 @@ jobs:
run: |
sudo snap install checkbox22
sudo snap install --dangerous --classic ${{ steps.build.outputs.snap }}
- if: needs.check-secret.outputs.snap-key == 'true' && (github.ref_name == 'noble-24.04')
name: Publish snap to edge channel
uses: snapcore/[email protected]
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT7_CREDS }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge
16 changes: 8 additions & 8 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,51 +72,51 @@ Go to the `tests` folder.

```
$ snapcraft
$ sudo snap install ./checkbox-tdx-classic_2.0_amd64.snap --dangerous --classic
$ sudo snap install ./checkbox-tdx_1.0.0_amd64.snap --dangerous --classic
```

- Run sanity tests to check the host setup:

```
$ checkbox-tdx-classic.test-runner-automated-host
$ checkbox-tdx.test-runner-automated-host
```

- Run guest tests:

```
$ checkbox-tdx-classic.test-runner-automated-guest
$ checkbox-tdx.test-runner-automated-guest
```

- Run boot tests:

```
$ checkbox-tdx-classic.test-runner-automated-boot
$ checkbox-tdx.test-runner-automated-boot
```

- Run perf tests:

```
$ checkbox-tdx-classic.test-runner-automated-perf
$ checkbox-tdx.test-runner-automated-perf
```

- Run quote tests:

```
$ checkbox-tdx-classic.test-runner-automated-quote
$ checkbox-tdx.test-runner-automated-quote
```

- Run stress tests:

```
$ checkbox-tdx-classic.test-runner-automated-stress
$ checkbox-tdx.test-runner-automated-stress
```

- Run all tests:

Please note that the performance tests can take a long time to run.

```
$ checkbox-tdx-classic.test-runner-automated
$ checkbox-tdx.test-runner-automated
```


Expand Down
2 changes: 1 addition & 1 deletion tests/checkbox/bin/checkbox-cli-wrapper
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# Remove temporary folder and rebuild in setup-env-and-run
TMP_FOLDER=/tmp/snap/checkbox-tdx-classic
TMP_FOLDER=/tmp/snap/checkbox-tdx
rm -rf ${TMP_FOLDER}

# wrapper around the checkbox-cli
Expand Down
2 changes: 1 addition & 1 deletion tests/checkbox/bin/checkbox-cli-wrapper-image
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if ! test -f $TDXTEST_GUEST_IMG; then
fi

# Remove temporary folder and rebuild in setup-env-and-run
TMP_FOLDER=/tmp/snap/checkbox-tdx-classic
TMP_FOLDER=/tmp/snap/checkbox-tdx
rm -rf ${TMP_FOLDER}

# wrapper around the checkbox-cli
Expand Down
2 changes: 1 addition & 1 deletion tests/checkbox/bin/checkbox-cli-wrapper-local
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

# Remove temporary folder and rebuild in setup-env-and-run
TMP_FOLDER=/tmp/snap/checkbox-tdx-classic
TMP_FOLDER=/tmp/snap/checkbox-tdx
rm -rf ${TMP_FOLDER}

# wrapper around the checkbox-cli
Expand Down
4 changes: 2 additions & 2 deletions tests/snap/hooks/configure
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ STRESS_S3_WAIT_DELAY=60
To change those values use the configure launcher.
E.g.
$ checkbox-kivu-classic.configure OPEN_N_SSID=my-wifi
$ checkbox-tdx.configure OPEN_N_SSID=my-wifi
If you __really__ need to change those values using `snap set` command,
you need to change CAPS to lowercase and underscores to dashes (-).
E.g.
$ snap set checkbox-kivu-classic open-n-ssid=my-wifi
$ snap set checkbox-tdx open-n-ssid=my-wifi
"""

import os
Expand Down
6 changes: 3 additions & 3 deletions tests/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: checkbox-tdx-classic
name: checkbox-tdx
summary: Checkbox tests for TDX
description: |
Collection of tests for Intel TDX (Trusted Domain eXtension)
version: '2.0'
version: '1.0.0'
confinement: classic
grade: stable

base: core22

# Here are the available applications of the TDX checkbox provider snap
# To run : snap run checkbox-tdx-classic.<app>
# To run : snap run checkbox-tdx.<app>
#
# checkbox-cli:
# - checkbox client, can be used to talk to the checkbox daemon
Expand Down

0 comments on commit 198137e

Please sign in to comment.