-
Notifications
You must be signed in to change notification settings - Fork 91
/
stress_test.sh
executable file
·54 lines (41 loc) · 1.16 KB
/
stress_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Copyright IBM Corp. All Rights Reserved.
# Copyright 2020 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
SCRIPTDIR="$(dirname $(readlink --canonicalize ${BASH_SOURCE}))"
FPC_PATH="${SCRIPTDIR}/.."
FABRIC_SCRIPTDIR="${FPC_PATH}/fabric/bin/"
: ${FABRIC_CFG_PATH:="${FPC_PATH}/integration/config"}
. ${FABRIC_SCRIPTDIR}/lib/common_utils.sh
. ${FABRIC_SCRIPTDIR}/lib/common_ledger.sh
TEST_NAME=TestStress
CHAINCODES=(auction_test echo_test)
CC_PATH=${FPC_PATH}/samples/chaincode/auction/_build/lib/
CC_LANG=fpc-c
CC_VER="$(cat ${CC_PATH}/mrenclave)"
CC_SEQ="1"
CC_EP="OR('SampleOrg.member')" # note that we use .member as NodeOUs is disabled with the crypto material used in the integration tests.
run_test() {
# call sdk test
try go test -v "${SCRIPTDIR}/client_sdk/go/stress_test"
# cleanup
rm -rf keystore wallet
}
# 1. prepare
para
say "Preparing ${TEST_NAME} Test ..."
# - clean up relevant docker images
docker_clean ${ERCC_ID}
trap ledger_shutdown EXIT
para
say "Run ${TEST_NAME} test"
say "- setup ledger"
ledger_init
say "- run test"
run_test
say "- shutdown ledger"
ledger_shutdown
para
yell "${TEST_NAME} test PASSED"
exit 0