@@ -9,7 +9,6 @@ FABLO_HOME="$TEST_TMP/../../.."
9
9
export FABLO_HOME
10
10
11
11
GATEWAY_CLIENT_DIR=" $FABLO_HOME /samples/gateway/node"
12
- ORG1_PEER0_ENV=" $TEST_TMP /fablo-target/fabric-config/connection-profiles/connection-profile-org1-peer0.env"
13
12
GATEWAY_CLIENT_OUTPUT_FILE=" $TEST_LOGS /gateway_client.log"
14
13
15
14
networkUp () {
@@ -73,16 +72,23 @@ expectInvoke "peer1.org1.example.com" "my-channel1" "chaincode1" \
73
72
# Test Node.js Gateway CLI client
74
73
echo " Testing Node.js Gateway client..."
75
74
76
- if [ ! -f " $ORG1_PEER0_ENV " ]; then
77
- echo " ERROR: Org1 Peer0 env file not found at $ORG1_PEER0_ENV "
78
- exit 1
79
- fi
80
-
81
75
echo " Installing gateway client dependencies..."
82
76
(cd " $GATEWAY_CLIENT_DIR " && npm install --silent --no-progress)
83
77
84
78
echo " Running Node.js Gateway client and checking output..."
85
- (cd " $GATEWAY_CLIENT_DIR " && set -a && source " $ORG1_PEER0_ENV " && set +a && node server.js > " $GATEWAY_CLIENT_OUTPUT_FILE " 2>&1 )
79
+ (
80
+ cd " $GATEWAY_CLIENT_DIR " &&
81
+ export \
82
+ CHANNEL_NAME=" my-channel1" \
83
+ CONTRACT_NAME=" chaincode1" \
84
+ MSP_ID=" Org1MSP" \
85
+ PEER_ORG_NAME=" peer0.org1.example.com" \
86
+ PEER_GATEWAY_URL=" localhost:7041" \
87
+ TLS_ROOT_CERT=" $TEST_TMP /fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" \
88
+ CREDENTIALS=
" $TEST_TMP /fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/users/[email protected] /msp/signcerts/[email protected] " \
89
+ PRIVATE_KEY_PEM=
" $TEST_TMP /fablo-target/fabric-config/crypto-config/peerOrganizations/org1.example.com/users/[email protected] /msp/keystore/priv-key.pem" &&
90
+ node server.js > " $GATEWAY_CLIENT_OUTPUT_FILE " 2>&1
91
+ )
86
92
GATEWAY_EXIT_CODE=$?
87
93
88
94
if [ $GATEWAY_EXIT_CODE -ne 0 ]; then
0 commit comments