Skip to content

Commit 8df6d95

Browse files
committed
updated the env varaible loading
Signed-off-by: kalio007 <[email protected]>
1 parent 3ed85c2 commit 8df6d95

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

e2e-network/docker/test-01-simple.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ FABLO_HOME="$TEST_TMP/../../.."
99
export FABLO_HOME
1010

1111
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"
1312
GATEWAY_CLIENT_OUTPUT_FILE="$TEST_LOGS/gateway_client.log"
1413

1514
networkUp() {
@@ -73,16 +72,23 @@ expectInvoke "peer1.org1.example.com" "my-channel1" "chaincode1" \
7372
# Test Node.js Gateway CLI client
7473
echo "Testing Node.js Gateway client..."
7574

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-
8175
echo "Installing gateway client dependencies..."
8276
(cd "$GATEWAY_CLIENT_DIR" && npm install --silent --no-progress)
8377

8478
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+
)
8692
GATEWAY_EXIT_CODE=$?
8793

8894
if [ $GATEWAY_EXIT_CODE -ne 0 ]; then

0 commit comments

Comments
 (0)