Skip to content

Commit 9970f15

Browse files
committed
[FAB-3628]: Add Crypto config
This config file is used with cryptogen when generating crypto material for use in the behave functional and system tests. Change-Id: I7800e21e6d0dbd892b8368e44c7c8be43ed3de3f Signed-off-by: Latitia M Haskins <[email protected]>
1 parent 1dfdee5 commit 9970f15

File tree

2 files changed

+29
-11
lines changed

2 files changed

+29
-11
lines changed

test/feature/configs/crypto.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
OrdererOrgs:
2+
- Name: Orderer
3+
Domain: example.com
4+
Specs:
5+
- Hostname: orderer
6+
7+
PeerOrgs:
8+
- Name: Org1
9+
Domain: org1.example.com
10+
Template:
11+
Count: 2
12+
Users:
13+
Count: 1
14+
15+
- Name: Org2
16+
Domain: org2.example.com
17+
Template:
18+
Count: 2
19+
Users:
20+
Count: 1

test/feature/steps/config_util.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright IBM Corp. 2016 All Rights Reserved.
1+
# Copyright IBM Corp. 2017 All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -19,9 +19,9 @@
1919
import sys
2020
from shutil import copyfile
2121

22-
def generateConfig(context, channelID, profile, ordererBlock="orderer.block"):
22+
def generateConfig(channelID, profile, projectName, ordererBlock="orderer.block"):
2323
# Save all the files to a specific directory for the test
24-
testConfigs = "configs/%s" % context.composition.projectName
24+
testConfigs = "configs/%s" % projectName
2525
if not os.path.isdir(testConfigs):
2626
os.mkdir(testConfigs)
2727

@@ -44,17 +44,15 @@ def generateConfig(context, channelID, profile, ordererBlock="orderer.block"):
4444
print("Unable to generate channel config data: {0}".format(sys.exc_info()[0]))
4545

4646

47-
def generateCrypto(context, numOrgs=2, numPeersPerOrg=2, numOrderers=1):
47+
def generateCrypto(projectName):
4848
# Save all the files to a specific directory for the test
49-
testConfigs = "configs/%s" % context.composition.projectName
49+
testConfigs = "configs/%s" % projectName
5050
if not os.path.isdir(testConfigs):
5151
os.mkdir(testConfigs)
5252

5353
try:
54-
subprocess.check_call(["cryptogen",
55-
"-peerOrgs", numOrgs,
56-
"-ordererNodes", numOrderers,
57-
"-peersPerOrg", numPeersPerOrg,
58-
"-baseDir", testConfigs])
54+
subprocess.check_call(["cryptogen", "generate",
55+
'--output={0}'.format(testConfigs),
56+
'--config=./configs/crypto.yaml'])
5957
except:
60-
print("Unable to generate crypto material: {0}".format(sys.exc_info()[0]))
58+
print("Unable to generate crypto material: {0}".format(sys.exc_info()[1]))

0 commit comments

Comments
 (0)