Skip to content

Adds crypto algorithm performance testing harness #5

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

Merged
merged 3 commits into from
Oct 16, 2023
Merged
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
45 changes: 45 additions & 0 deletions .github/workflows/crypto-test-harness.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: Linux

on:
pull_request:
branches: ["cf-zeta"]
workflow_dispatch:

jobs:
tcrypt:
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y flex bison bc cpio busybox-static kmod
- name: Checkout
uses: actions/checkout@v3
- name: Build kernel & Modules
run: |
cp zeta/test-artifacts/config-um .config
make olddefconfig ARCH=um
make -j$(nproc) ARCH=um all
mkdir initramfs
make modules_install INSTALL_MOD_PATH=./initramfs ARCH=um
- name: Prepare initramfs
run: |
mkdir initramfs/bin initramfs/proc
cp -p /bin/busybox initramfs/bin/busybox
cp -p zeta/test-artifacts/init initramfs/init
cp -p zeta/test-artifacts/test-script.sh initramfs/test-script.sh
cd initramfs
find . -print0 | cpio --null --create --verbose --format=newc | gzip --best > ../uml-initramfs.cpio.gz
cd ..
- name: Run user-mode linux test harness
continue-on-error: true
run: |
sudo ./linux initrd=uml-initramfs.cpio.gz > tcrypt.out 2>&1
cat tcrypt.out
- name: Collect artifacts
uses: actions/upload-artifact@v3
if: success() || failure()
with:
name: tcrypt_job
path: ./tcrypt.out
16 changes: 16 additions & 0 deletions zeta/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,19 @@ $ make -C zeta lint FILES="/crypto/sha256_generic.c /crypto/sha512_generic.c"

Pass in `FILES` the files to be linted. Note the leading `/` (slash), which
indicates the position of the files with respect to the kernel source code.

### Automated performance testing

Any merge requests opened against the `cf-zeta` branch will automatically
trigger the execution of the [Crypto algorithm implementation testing
pipeline](.github/workflows/crypto-test-harness.yml) GitHub Action.

This action builds the kernel as a User-mode Linux (UML) binary
(https://docs.kernel.org/virt/uml/user_mode_linux_howto_v2.html), using the
kernel config defined in
[zeta/test-artifacts/config-um](zeta/test-artifacts/config-um), and runs a [test
script](zeta/test-artifacts/test-script.sh) in it.

New kernel configuration options added as part of development work should be
added to the [test kernel config](zeta/test-artifacts/config-um), and if needed
new test clauses added on the test script.
Loading