From d0fc4b5725356dab0e55a790446d62f121c85399 Mon Sep 17 00:00:00 2001 From: Heiko Schaefer Date: Fri, 19 May 2023 13:36:21 +0200 Subject: [PATCH] ci: Add tests against canokey virtual card (see https://github.com/canokeys/canokey-core) Fixes #4. --- .gitlab-ci.yml | 21 +++++++++++++++++++++ card-functionality/ci/virt-canokey.toml | 17 +++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 card-functionality/ci/virt-canokey.toml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c16633d..41eeaf3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -174,6 +174,27 @@ run_cardtest_opcard_rs: # (the base image is separate from the other virtual cards) key: "opcard_rs" +run_cardtest_canokey: + stage: virtual-test + image: registry.gitlab.com/openpgp-card/virtual-cards/canokey-builddeps + before_script: + - export PATH="$HOME/.cargo/bin:$PATH" + - *report-rust + script: + - sh /start.sh && sleep 10 + # - RUST_BACKTRACE=1 cargo run -p openpgp-card-tools --bin opgpcard -- status + # - RUST_BACKTRACE=1 cargo run -p openpgp-card-tools --bin opgpcard -- info + - RUST_BACKTRACE=1 cargo run -p openpgp-card-tests --bin import -- $CONFIG + - RUST_BACKTRACE=1 cargo run -p openpgp-card-tests --bin keygen -- $CONFIG + variables: + CONFIG: "card-functionality/ci/virt-canokey.toml" + cache: + # inherit all general cache settings + <<: *general_cache_config + # override the key + # (the base image of canokey-builddeps is distinct from the other virtual card images) + key: "canokey" + run_cardtest_ykneo: stage: virtual-test image: registry.gitlab.com/openpgp-card/virtual-cards/ykneo-builddeps diff --git a/card-functionality/ci/virt-canokey.toml b/card-functionality/ci/virt-canokey.toml new file mode 100644 index 0000000..2d26780 --- /dev/null +++ b/card-functionality/ci/virt-canokey.toml @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: 2021 Heiko Schaefer +# SPDX-License-Identifier: CC0-1.0 + +[card.smartpgp] +backend.pcsc = "F1D0:00000000" +config.keygen = [ + "RSA2k", "RSA3k", "RSA4k", + "NIST256", "NIST384", "Curve25519" +] +config.import = [ + "card-functionality/data/rsa2k.sec", + "card-functionality/data/rsa3k.sec", + "card-functionality/data/rsa4k.sec", + "card-functionality/data/nist256.sec", + "card-functionality/data/nist384.sec", + "card-functionality/data/25519.sec", +]