Commit af5e9f01 authored by Krishna Harsha Voora's avatar Krishna Harsha Voora Committed by Alessandro Sorniotti
Browse files

[FAB-12670] Fix pkcs11 UT Failures



This patch allows to initialize softhsm2 token
as non-root user, by merely setting SOFTHSM2_CONF,
CI Envrionment should be updated to leverage SOFTHSM2_CONF.

Change-Id: I9fdc9c837859a78619d9edc9e2e3fbe8733f04af
Signed-off-by: default avatarKrishna Harsha Voora <krishvoor@in.ibm.com>
parent f4b1a7e0
......@@ -17,6 +17,7 @@
# - orderer - builds a native fabric orderer binary
# - release - builds release packages for the host platform
# - release-all - builds release packages for all target platforms
# - softhsm2_initialization - generates softhsm2 tokens used in pkcs11 test
# - unit-test - runs the go-test based unit tests
# - verify - runs unit tests for only the changed package tree
# - profile - runs unit tests for all packages in coverprofile mode (slow)
......@@ -183,7 +184,10 @@ ccenv: $(BUILD_DIR)/image/ccenv/$(DUMMY)
integration-test: gotool.ginkgo ccenv docker-thirdparty
./scripts/run-integration-tests.sh
unit-test: unit-test-clean peer-docker docker-thirdparty ccenv
softhsm2_initialization:
./scripts/config_softhsm2.sh
unit-test: unit-test-clean peer-docker softhsm2_initialization docker-thirdparty ccenv
unit-test/run.sh
unit-tests: unit-test
......
......@@ -36,6 +36,10 @@ fi
iptables -I INPUT 1 -j ACCEPT
sysctl vm.overcommit_memory=1
##################
# Install softhsm2
yum install softhsm -y
##################
# Install Docker
cd /tmp
......
......@@ -39,7 +39,7 @@ fi
# Install pre-requisite OS packages #
#####################################
apt-get update
apt-get -y install software-properties-common curl git sudo wget "build-essential" zlib1g-dev libbz2-dev
apt-get -y install software-properties-common curl git sudo wget "build-essential" zlib1g-dev libbz2-dev softhsm2
#####################################
# Install and setup Docker services #
......
......@@ -55,6 +55,14 @@ Prerequisites
- Note: The BIOS Enabled Virtualization may be within the CPU or
Security settings of the BIOS
- (macOS) `Install softhsm on Mac OSX <http://macappstore.org/softhsm/>`__.You can
use Homebrew to install it as follows:
::
brew install softhsm
``pip``
~~~~~~
......
#!/bin/bash
#
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
cd $HOME
mkdir -p $HOME/lib/softhsm/tokens
cd $HOME/lib/softhsm/
echo "directories.tokendir = $PWD/tokens" > softhsm2.conf
echo "Update SOFTHSM2_CONF via export SOFTHSM2_CONF=$HOME/lib/softhsm/softhsm2.conf"
export SOFTHSM2_CONF=$HOME/lib/softhsm/softhsm2.conf
softhsm2-util --init-token --slot 0 --label "ForFabric" --so-pin 1234 --pin 98765432
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment