Skip to content

Commit

Permalink
Make chaincode tests to run on local environments
Browse files Browse the repository at this point in the history
Currently chaincode tests tries to write into /var/hyperledger
folder where most likely that at local dev machines /var
is restricted for write, hence making test to fail. This commit
replace /var with /tmp which usually opened for write for any
users.

Change-Id: I7b2178d3dad5d9ece5598c3b10e95a699e61c3a5
Signed-off-by: Artem Barger <bartem@il.ibm.com>
  • Loading branch information
C0rWin committed Dec 24, 2016
1 parent ec550b2 commit 05a3908
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/chaincode/chaincodetest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ peer:
touchMaxNodes: 100

# Path on the file system where peer will store data
fileSystemPath: /var/hyperledger/test/tmpdb
fileSystemPath: /tmp/hyperledger/test/tmpdb


profile:
Expand Down
1 change: 1 addition & 0 deletions core/chaincode/exectransaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,7 @@ var signer msp.SigningIdentity

func TestMain(m *testing.M) {
var err error

primitives.SetSecurityLevel("SHA2", 256)

// setup the MSP manager so that we can sign/verify
Expand Down
4 changes: 2 additions & 2 deletions core/chaincode/systemchaincode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ func (osyscc *oldSysCCInfo) reset() {
func initSysCCTests() (*oldSysCCInfo, net.Listener, error) {
var opts []grpc.ServerOption
grpcServer := grpc.NewServer(opts...)
viper.Set("peer.fileSystemPath", "/var/hyperledger/test/tmpdb")
defer os.RemoveAll("/var/hyperledger/test/tmpdb")
viper.Set("peer.fileSystemPath", "/tmp/hyperledger/test/tmpdb")
defer os.RemoveAll("/tmp/hyperledger/test/tmpdb")

peer.MockInitialize()

Expand Down

0 comments on commit 05a3908

Please sign in to comment.