Skip to content

Commit

Permalink
[FABG-751] SDK PKCS11 tests are broken with Mutual TLS
Browse files Browse the repository at this point in the history
	Fixed the working directory to import PKs

Change-Id: I7a47327aefce9b82b103f107bd7b7e952a2d8c95
Signed-off-by: Baha Shaaban <baha.shaaban@securekey.com>
  • Loading branch information
Baha Shaaban committed Sep 5, 2018
1 parent 33034df commit 8113dec
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ integration-tests-stable-negative: clean-tests depend-noforce populate-noforce
.PHONY: integration-tests-stable-pkcs11
integration-tests-stable-pkcs11: clean-tests depend-noforce populate-noforce
@. $(FIXTURE_DOCKERENV_PATH)/stable-env.sh && \
. $(FIXTURE_DOCKERENV_PATH)/nomutualtls-env.sh && \
. $(FIXTURE_CRYPTOCONFIG_PATH)/env.sh && \
$(FABRIC_DEV_REGISTRY_PRE_CMD) && \
cd $(FIXTURE_DOCKERENV_PATH) && \
Expand Down
6 changes: 3 additions & 3 deletions test/scripts/integration-pkcs11.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ PKGS=($(${GO_CMD} list ${REPO}/test/integration/... 2> /dev/null | \
# Reduce tests to changed packages.
if [ "${TEST_CHANGED_ONLY}" = true ]; then
# findChangedFiles assumes that the working directory contains the repo; so change to the repo directory.
PWD=$(pwd)
PWD_ORIG=$(pwd)
cd "${GOPATH}/src/${REPO}"
findChangedFiles
cd ${PWD}
cd ${PWD_ORIG}

if [[ "${CHANGED_FILES[@]}" =~ ( |^)(test/fixtures/|test/metadata/|test/scripts/|Makefile( |$)|Gopkg.lock( |$)|ci.properties( |$)) ]]; then
echo "Test scripts, fixtures or metadata changed - running all tests"
Expand Down Expand Up @@ -78,7 +78,7 @@ if [ ${#PKGS[@]} -eq 0 ]; then
exit 0
fi

workingDir=$(pwd)
workingDir=${GOPATH}/src/${REPO}
declare -a PRIVATE_KEYS=($(find ${workingDir}/test/fixtures/fabric/${FABRIC_CRYPTOCONFIG_VERSION} | grep '/users/' | grep '_sk$' | tr '\n' ' '))
PRIVATE_KEYS+=($(find ${workingDir}/test/fixtures/fabric/${FABRIC_CRYPTOCONFIG_VERSION} | grep 'User1@tls.example.com' | grep '.key$' | tr '\n' ' '))

Expand Down
4 changes: 2 additions & 2 deletions test/scripts/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ fi
# Reduce tests to changed packages.
if [ "${TEST_CHANGED_ONLY}" = true ]; then
# findChangedFiles assumes that the working directory contains the repo; so change to the repo directory.
PWD=$(pwd)
PWD_ORIG=$(pwd)
cd "${GOPATH}/src/${REPO}"
findChangedFiles
cd ${PWD}
cd ${PWD_ORIG}

if [[ "${CHANGED_FILES[@]}" =~ ( |^)(test/fixtures/|test/metadata/|test/scripts/|Makefile( |$)|Gopkg.lock( |$)|ci.properties( |$)) ]]; then
echo "Test scripts, fixtures or metadata changed - running all tests"
Expand Down
4 changes: 2 additions & 2 deletions test/scripts/negative.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ PKGS=($(${GO_CMD} list ${REPO}/test/integration/negative/... 2> /dev/null | \
# Reduce tests to changed packages.
if [ "${TEST_CHANGED_ONLY}" = true ]; then
# findChangedFiles assumes that the working directory contains the repo; so change to the repo directory.
PWD=$(pwd)
PWD_ORIG=$(pwd)
cd "${GOPATH}/src/${REPO}"
findChangedFiles
cd ${PWD}
cd ${PWD_ORIG}

if [[ "${CHANGED_FILES[@]}" =~ ( |^)(test/fixtures/|test/metadata/|test/scripts/|Makefile( |$)|Gopkg.lock( |$)|ci.properties( |$)) ]]; then
echo "Test scripts, fixtures or metadata changed - running all tests"
Expand Down
4 changes: 2 additions & 2 deletions test/scripts/unit-pkcs11.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ declare -a PKGS=(
# Reduce unit tests to changed packages.
if [ "$TEST_CHANGED_ONLY" = true ]; then
# findChangedFiles assumes that the working directory contains the repo; so change to the repo directory.
PWD=$(pwd)
PWD_ORIG=$(pwd)
cd "${GOPATH}/src/${REPO}"
findChangedFiles
cd ${PWD}
cd ${PWD_ORIG}

if [[ "${CHANGED_FILES[@]}" =~ ( |^)(test/fixtures/|test/metadata/|test/scripts/|Makefile( |$)|Gopkg.lock( |$)|gometalinter.json( |$)|ci.properties( |$)) ]]; then
echo "Test scripts, fixtures or metadata changed - running all tests"
Expand Down

0 comments on commit 8113dec

Please sign in to comment.