Skip to content

Commit

Permalink
fixup! Refactor setup
Browse files Browse the repository at this point in the history
  • Loading branch information
simo5 committed Aug 27, 2024
1 parent 34616e1 commit a29e79a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,22 @@ jobs:
dnf -y install $dnf_opts \
git ${{ matrix.compiler }} meson \
pkgconf-pkg-config openssl-devel openssl \
diffutils expect valgrind
diffutils expect valgrind opensc gnutls-utils
if [ "${{ matrix.token }}" = "softokn" ]; then
dnf -y install nss-softokn nss-tools nss-softokn-devel
elif [ "${{ matrix.token }}" = "softhsm" ]; then
dnf -y install softhsm opensc p11-kit-devel p11-kit-server \
gnutls-utils
dnf -y install softhsm p11-kit-devel p11-kit-server
fi
elif [ -f /etc/debian_version ]; then
apt-get -q update
apt-get -yq install git ${{ matrix.compiler }} meson \
pkg-config libssl-dev openssl expect \
valgrind procps
valgrind procps opensc gnutls-bin
if [ "${{ matrix.token }}" = "softokn" ]; then
apt-get -yq install libnss3 libnss3-tools libnss3-dev
elif [ "${{ matrix.token }}" = "softhsm" ]; then
apt-get -yq install softhsm2 opensc p11-kit libp11-kit-dev \
p11-kit-modules gnutls-bin
apt-get -yq install softhsm2 p11-kit libp11-kit-dev \
p11-kit-modules
fi
fi
- name: Checkout Repository
Expand Down Expand Up @@ -103,13 +102,13 @@ jobs:
brew install \
meson \
openssl@3 \
pkg-config
pkg-config \
opensc \
p11-kit
if [ "${{ matrix.token }}" = "softokn" ]; then
brew install nss
elif [ "${{ matrix.token }}" = "softhsm" ]; then
brew install \
opensc \
p11-kit \
softhsm
fi
- name: Checkout Repository
Expand Down
13 changes: 5 additions & 8 deletions tests/setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -ex
# Copyright (C) 2024 Simo Sorcen <[email protected]>
# Copyright (C) 2024 Simo Sorce <[email protected]>
# SPDX-License-Identifier: Apache-2.0

source "${TESTSSRCDIR}/helpers.sh"
Expand All @@ -10,18 +10,13 @@ fi

TOKENTYPE=$1

# Temporary dir
# Temporary dir and Token data dir
TMPPDIR="${TESTBLDDIR}/${TOKENTYPE}"
TOKDIR="$TMPPDIR/tokens"
if [ -d "${TMPPDIR}" ]; then
rm -fr "${TMPPDIR}"
fi
mkdir "${TMPPDIR}"

# Token data dir
TOKDIR="$TMPPDIR/tokens"
if [ -d "${TOKDIR}" ]; then
rm -fr "${TOKDIR}"
fi
mkdir "${TOKDIR}"

PINVALUE="12345678"
Expand Down Expand Up @@ -323,6 +318,8 @@ echo ""

if [ -f /etc/redhat-release ]; then
title PARA "explicit EC unsupported on Fedora/EL"
elif [ "${TOKENTYPE}" == "softokn" ]; then
title PARA "explicit EC unsupported with softokn"
else
title PARA "generate explicit EC key pair"
KEYID='0007'
Expand Down

0 comments on commit a29e79a

Please sign in to comment.