Skip to content

Commit

Permalink
Cirrus: Add OpenDNSSEC tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyRand committed Jun 20, 2021
1 parent 020e80f commit 0ec8883
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,27 @@ task:
depends_on:
- "Compile Go latest linux amd64"

task:
name: "opendnssec"
container:
image: fedora:latest
cpu: 1
memory: 1G
install_script:
- dnf install -y git autoconf libtool g++ softhsm opensc diffutils
- curl -o libpkcs11proxy.so https://api.cirrus-ci.com/v1/artifact/build/$CIRRUS_BUILD_ID/Compile%20Go%20latest%20linux%20amd64/binaries/dist/libpkcs11proxy.so
opendnssec_build_script:
- git clone https://github.com/opendnssec/pkcs11-testing.git
- cd pkcs11-testing
- chmod +x autogen.sh
- ./autogen.sh
- ./configure --disable-dependency-tracking
- make install
test_script:
- testdata/ci-opendnssec-tests.bash
depends_on:
- "Compile Go latest linux amd64"

# TODO: Add Windows unit tests

# TODO: "Testing config parsing" from travis.bash
Expand Down
38 changes: 38 additions & 0 deletions testdata/ci-opendnssec-tests.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

set -euo pipefail
shopt -s nullglob globstar

export PKCS11PROXY_CKBI_TARGET=/usr/lib64/pkcs11/libsofthsm2.so

echo "===== init slot 0 ====="

SLOT_ID=$(softhsm2-util --init-token --slot 0 --label softhsm --so-pin 1234 --pin 1234 | grep -oE '[^ ]+$')

echo "===== test-all slot 0 (default) ====="

pkcs11-testing --module "$PKCS11PROXY_CKBI_TARGET" --slot "$SLOT_ID" --pin 1234 --test-all | tee test-all-default.txt || true

echo "===== test-all slot 0 (via pkcs11proxy) ====="

pkcs11-testing --module ./libpkcs11proxy.so --slot "$SLOT_ID" --pin 1234 --test-all | tee test-all-pkcs11proxy.txt || true

echo "===== test-all slot 0 (diff) ====="

diff -I '^Modulus: [0-9A-F]\+$' test-all-default.txt test-all-pkcs11proxy.txt

echo "===== init slot 1 ====="

SLOT_ID=$(softhsm2-util --init-token --slot 1 --label softhsm --so-pin 1234 --pin 1234 | grep -oE '[^ ]+$')

echo "===== test-stability slot 1 (default) ====="

pkcs11-testing --module "$PKCS11PROXY_CKBI_TARGET" --slot "$SLOT_ID" --pin 1234 --test-stability | tee test-stability-default.txt

echo "===== test-stability slot 1 (via pkcs11proxy) ====="

pkcs11-testing --module ./libpkcs11proxy.so --slot "$SLOT_ID" --pin 1234 --test-stability | tee test-stability-pkcs11proxy.txt

echo "===== test-stability slot 1 (diff) ====="

diff test-stability-default.txt test-stability-pkcs11proxy.txt

0 comments on commit 0ec8883

Please sign in to comment.