Integrated virt_CACard in CI jobs (#1757)
Was: "Implement OpenSC CI without HW cards" (https://github.com/OpenSC/OpenSC/pull/1757)
This commit is contained in:
parent
9099d95c77
commit
b0241eefa1
|
@ -0,0 +1,126 @@
|
|||
before_script:
|
||||
# Avoid picking up PIV endpoint in CAC cards
|
||||
- sed -e "/PIV-II/d" -i src/libopensc/ctx.c
|
||||
# enable debug messages in the testsuite
|
||||
- sed -e "s/^p11test_CFLAGS/#p11test_CFLAGS/g" -i src/tests/p11test/Makefile.am
|
||||
- ./bootstrap
|
||||
- ./configure
|
||||
- make -j4
|
||||
- make check
|
||||
- make install
|
||||
- ldconfig /usr/local/lib
|
||||
- git clone https://github.com/PL4typus/virt_cacard.git
|
||||
- cd virt_cacard && export CACARD_DIR=$PWD && ./autogen.sh && ./configure && make
|
||||
variables:
|
||||
SOFTHSM2_CONF: softhsm2.conf
|
||||
CNTNR_REGISTRY: pl4typus/opensc-images
|
||||
FEDORA29_BUILD: fedora-29
|
||||
FEDORA30_BUILD: fedora-30
|
||||
UBUNTU_BUILD: ubuntu-18.04
|
||||
DEBIAN_BUILD: debian-testing
|
||||
|
||||
.job_base: &base_job
|
||||
artifacts:
|
||||
expire_in: '1 week'
|
||||
when: on_failure
|
||||
paths:
|
||||
- src/tests/p11test/*.log
|
||||
|
||||
.job_template: &functional_test
|
||||
<<: *base_job
|
||||
artifacts:
|
||||
expire_in: '1 week'
|
||||
when: on_failure
|
||||
paths:
|
||||
- src/tests/p11test/*.log
|
||||
- src/tests/p11test/*.json
|
||||
- tests/test-suite.log
|
||||
cache:
|
||||
paths:
|
||||
- src/tests/p11test/*.json
|
||||
|
||||
.virt_cacard: &virt_cacard
|
||||
only:
|
||||
- virt_cacard
|
||||
script:
|
||||
- ./setup-softhsm2.sh
|
||||
- cd ../src/tests/p11test/
|
||||
- pcscd -x
|
||||
- ./p11test -s 0 -p 12345678 -o cac.json -i | tee cac.log &
|
||||
- sleep 5
|
||||
- cd $CACARD_DIR
|
||||
- ./virt_cacard &
|
||||
- cd ../src/tests/p11test/
|
||||
- wait $(ps aux | grep '[p]11test'| awk '{print $2}')
|
||||
- kill -9 $(ps aux | grep '[v]irt_cacard'| awk '{print $2}')
|
||||
- if [[ -f cac_old.json ]]; then diff -u3 cac_old.json cac.json; fi
|
||||
- cp cac.json cac_old.json
|
||||
# cache the results for the next run
|
||||
tags:
|
||||
- shared
|
||||
|
||||
.virt_cacard_valgrind: &virt_cacard_valgrind
|
||||
only:
|
||||
- virt_cacard
|
||||
script:
|
||||
- ./setup-softhsm2.sh
|
||||
- cd ../src/tests/p11test/
|
||||
# remove the dlcose() calls to have reasonable traces
|
||||
- sed '/if(pkcs11_so)/I {N;d;}' -i p11test_loader.c
|
||||
- make
|
||||
- pcscd -x
|
||||
- valgrind --leak-check=full --trace-children=yes --suppressions=p11test.supp ./p11test -s 0 -p 12345678 -i 2>&1| tee cac.log &
|
||||
- sleep 5
|
||||
- cd $CACARD_DIR
|
||||
- ./virt_cacard &
|
||||
- wait $(ps aux | grep '[v]algrind'| awk '{print $2}')
|
||||
- kill -9 $(ps aux | grep '[v]irt_cacard'| awk '{print $2}')
|
||||
- cd ../src/tests/p11test/
|
||||
- grep "definitely lost:.*0 bytes in 0 blocks" cac.log
|
||||
tags:
|
||||
- shared
|
||||
|
||||
################################
|
||||
## Virtual CACard ##
|
||||
################################
|
||||
|
||||
Fedora29 Build and Test virt_cacard:
|
||||
<<: *functional_test
|
||||
image: $CI_REGISTRY/$CNTNR_REGISTRY/$FEDORA29_BUILD:latest
|
||||
<<: *virt_cacard
|
||||
|
||||
Fedora30 Build and Test virt_cacard:
|
||||
<<: *functional_test
|
||||
image: $CI_REGISTRY/$CNTNR_REGISTRY/$FEDORA30_BUILD:latest
|
||||
<<: *virt_cacard
|
||||
|
||||
Ubuntu18.04 Build and Test virt_cacard:
|
||||
<<: *functional_test
|
||||
image: $CI_REGISTRY/$CNTNR_REGISTRY/$UBUNTU_BUILD:latest
|
||||
<<: *virt_cacard
|
||||
|
||||
Debian-testing Build and Test virt_cacard:
|
||||
<<: *functional_test
|
||||
image: $CI_REGISTRY/$CNTNR_REGISTRY/$DEBIAN_BUILD:latest
|
||||
<<: *virt_cacard
|
||||
|
||||
Fedora29 Build and Test virt_cacard with valgrind:
|
||||
<<: *base_job
|
||||
image: $CI_REGISTRY/$CNTNR_REGISTRY/$FEDORA29_BUILD:latest
|
||||
<<: *virt_cacard_valgrind
|
||||
|
||||
Fedora30 Build and Test virt_cacard with valgrind:
|
||||
<<: *base_job
|
||||
image: $CI_REGISTRY/$CNTNR_REGISTRY/$FEDORA30_BUILD:latest
|
||||
<<: *virt_cacard_valgrind
|
||||
|
||||
Ubuntu18.04 Build and Test virt_cacard with valgrind:
|
||||
<<: *base_job
|
||||
image: $CI_REGISTRY/$CNTNR_REGISTRY/$UBUNTU_BUILD:latest
|
||||
<<: *virt_cacard_valgrind
|
||||
|
||||
Debian-testing Build and Test virt_cacard with valgrind:
|
||||
<<: *base_job
|
||||
image: $CI_REGISTRY/$CNTNR_REGISTRY/$DEBIAN_BUILD:latest
|
||||
<<: *virt_cacard_valgrind
|
||||
|
57
.travis.yml
57
.travis.yml
|
@ -24,6 +24,12 @@ matrix:
|
|||
- HOST=i686-w64-mingw32
|
||||
- DO_PUSH_ARTIFACT=yes
|
||||
- env: DO_COVERITY_SCAN=yes
|
||||
- compiler: gcc
|
||||
os: linux
|
||||
dist: bionic
|
||||
env:
|
||||
- DO_SIMULATION=cac
|
||||
sudo: true
|
||||
|
||||
env:
|
||||
global:
|
||||
|
@ -48,7 +54,6 @@ addons:
|
|||
- gcc-mingw-w64-x86-64
|
||||
- libpcsclite-dev
|
||||
- mingw-w64
|
||||
- wine
|
||||
- xsltproc
|
||||
- gengetopt
|
||||
- libcmocka-dev
|
||||
|
@ -69,6 +74,13 @@ before_install:
|
|||
brew install gengetopt help2man cmocka ccache;
|
||||
export PATH="/usr/local/opt/ccache/libexec:$PATH";
|
||||
fi
|
||||
- if [ "${DO_SIMULATION}" = "cac" ]; then
|
||||
sudo apt-get install -y libglib2.0-dev libnss3-dev pkgconf libtool make autoconf autoconf-archive automake libsofthsm2-dev softhsm2 softhsm2-common help2man gnutls-bin libcmocka-dev libusb-dev libudev-dev flex libnss3-tools libssl-dev libpcsclite1;
|
||||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig;
|
||||
fi
|
||||
- if [ -n "${HOST}" ]; then
|
||||
sudo apt-get install -y wine;
|
||||
fi
|
||||
|
||||
before_script:
|
||||
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
|
||||
|
@ -172,6 +184,23 @@ before_script:
|
|||
sudo /etc/init.d/pcscd restart;
|
||||
fi
|
||||
|
||||
- if [ "${DO_SIMULATION}" = "cac" ]; then
|
||||
git clone https://github.com/frankmorgner/vsmartcard.git;
|
||||
cd vsmartcard/virtualsmartcard;
|
||||
autoreconf -vis && ./configure && make -j4 && sudo make install;
|
||||
|
||||
cd $TRAVIS_BUILD_DIR;
|
||||
git clone https://gitlab.freedesktop.org/spice/libcacard.git;
|
||||
cd libcacard && ./autogen.sh --prefix=/usr && make -j4 && sudo make install;
|
||||
|
||||
cd $TRAVIS_BUILD_DIR;
|
||||
git clone https://github.com/PL4typus/virt_cacard.git;
|
||||
cd virt_cacard && ./autogen.sh && ./configure && make;
|
||||
|
||||
cd $TRAVIS_BUILD_DIR;
|
||||
sudo /etc/init.d/pcscd restart;
|
||||
fi
|
||||
|
||||
script:
|
||||
- if [ "${DO_COVERITY_SCAN}" != "yes" ]; then
|
||||
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||
|
@ -249,6 +278,20 @@ script:
|
|||
|
||||
set +ex;
|
||||
fi
|
||||
- if [ "${DO_SIMULATION}" = "cac" ]; then
|
||||
cd $TRAVIS_BUILD_DIR;
|
||||
make check && sudo make install;
|
||||
export LD_LIBRARY_PATH=/usr/local/lib;
|
||||
cd src/tests/p11test/;
|
||||
./p11test -s 0 -p 12345678 -i &
|
||||
sleep 5;
|
||||
cd $TRAVIS_BUILD_DIR/virt_cacard;
|
||||
./setup-softhsm2.sh;
|
||||
export SOFTHSM2_CONF=$PWD/softhsm2.conf;
|
||||
./virt_cacard &
|
||||
wait $(ps aux | grep '[p]11test'| awk '{print $2}');
|
||||
kill -9 $(ps aux | grep '[v]irt_cacard'| awk '{print $2}');
|
||||
fi
|
||||
|
||||
after_script:
|
||||
# kill process started during compilation to finish the build, see
|
||||
|
@ -265,15 +308,15 @@ after_script:
|
|||
fi
|
||||
|
||||
before_cache:
|
||||
- brew cleanup
|
||||
- brew cleanup
|
||||
|
||||
cache:
|
||||
apt: true
|
||||
ccache: true
|
||||
directories:
|
||||
- $HOME/.m2/
|
||||
- $HOME/Library/Caches/Homebrew
|
||||
- openssl_bin
|
||||
- openpace_bin
|
||||
- $HOME/.m2/
|
||||
- $HOME/Library/Caches/Homebrew
|
||||
- openssl_bin
|
||||
- openpace_bin
|
||||
files:
|
||||
- isetup-5.5.6.exe
|
||||
- isetup-5.5.6.exe
|
||||
|
|
|
@ -11,6 +11,7 @@ Build and test status of specific cards:
|
|||
| Cards | Status |
|
||||
|---------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| CAC | [![CAC](https://gitlab.com/redhat-crypto/OpenSC/badges/cac/build.svg)](https://gitlab.com/redhat-crypto/OpenSC/pipelines) |
|
||||
| [virt_CACard](https://github.com/OpenSC/OpenSC/tree/virt_cacard) | [![virt_CACard](https://travis-ci.org/OpenSC/OpenSC.svg)](https://travis-ci.org/OpenSC/OpenSC/branches) |
|
||||
| [Coolkey](https://github.com/dogtagpki/coolkey/tree/master/applet) | [![Coolkey](https://gitlab.com/redhat-crypto/OpenSC/badges/coolkey/build.svg)](https://gitlab.com/redhat-crypto/OpenSC/pipelines) |
|
||||
| [PivApplet](https://github.com/arekinath/PivApplet) | [![PIV](https://travis-ci.org/OpenSC/OpenSC.svg)](https://travis-ci.org/OpenSC/OpenSC/branches) |
|
||||
| [OpenPGP Applet](https://github.com/Yubico/ykneo-openpgp/) | [![OpenPGP](https://travis-ci.org/OpenSC/OpenSC.svg)](https://travis-ci.org/OpenSC/OpenSC/branches) |
|
||||
|
|
|
@ -1114,6 +1114,7 @@ AC_CONFIG_FILES([
|
|||
MacOSX/Distribution.xml
|
||||
MacOSX/resources/Welcome.html
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
cat <<EOF
|
||||
|
|
Loading…
Reference in New Issue