Skip to content

Commit

Permalink
[FABN-1169] script cert generation
Browse files Browse the repository at this point in the history
- Create multiple config files for required netowrk crypto material generation, channel tx generation, and channel update tx files
- Create script to produce all the above
- Modify all paths to math new 1.4 cryptogen file output
- remove all hard coded PEMs in test files and link to generated crypto material
- Update all tests to use new fixtures layout

Change-Id: Ia5a1f5476b3ed5b81e31283f05eddfac71bebbe2
Signed-off-by: [email protected] <[email protected]>
  • Loading branch information
nklincoln committed Mar 4, 2019
1 parent 46e6236 commit 847d2da
Show file tree
Hide file tree
Showing 319 changed files with 1,828 additions and 3,099 deletions.
19 changes: 8 additions & 11 deletions build/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,16 @@ gulp.task('docker-clean', shell.task([
'docker rmi $(docker images | grep "^dev-" | awk \'{print $3}\')',

// clean up all the containers created by docker-compose
// -tape
'docker-compose -f test/fixtures/docker-compose.yaml down',
// -cucumber
'docker-compose -f test/scenario/docker-compose/docker-compose-tls.yaml down'
'docker-compose -f test/fixtures/docker-compose/docker-compose-tls-level-db.yaml -p node down',
'docker-compose -f test/fixtures/docker-compose/docker-compose-tls.yaml -p node down'
], {
verbose: true, // so we can see the docker command output
ignoreErrors: true // kill and rm may fail because the containers may have been cleaned up
}));

gulp.task('docker-ready', ['docker-clean'], shell.task([
// make sure that necessary containers are up by docker-compose
'docker-compose -f test/fixtures/docker-compose.yaml up -d'
'docker-compose -f test/fixtures/docker-compose/docker-compose-tls-level-db.yaml -p node up -d'
]));

gulp.task('lint', ['eslint', 'tslint']);
Expand Down Expand Up @@ -188,18 +186,18 @@ gulp.task('run-test-cucumber', shell.task(
));

// Run e2e and scenario tests with code coverage
gulp.task('test-fv-scenario', shell.task('npx nyc --check-coverage --lines 92 --functions 90 --branches 70 gulp run-test-fv-sceanrio'));
gulp.task('test-fv-scenario', shell.task('npx nyc --check-coverage --lines 92 --functions 90 --branches 70 gulp run-test-fv-scenario'));

// run cucumber separate
gulp.task('test-fv-only', shell.task('npx nyc --check-coverage --lines 92 --functions 90 --branches 70 gulp run-tape-e2e'));

gulp.task('run-test-fv-sceanrio', (done) => {
gulp.task('run-test-fv-scenario', (done) => {
const tasks = ['run-tape-e2e', 'docker-clean', 'run-test-cucumber'];
runSequence(...tasks, done);
});

gulp.task('run-test-sceanrio', (done) => {
const tasks = ['docker-clean', 'run-test-cucumber'];
gulp.task('run-test-scenario', (done) => {
const tasks = ['run-test-cucumber'];
runSequence(...tasks, done);
});

Expand Down Expand Up @@ -262,15 +260,14 @@ gulp.task('run-tape-e2e', ['docker-ready'],
// saved the user certificates so they can interact with the
// network
return gulp.src(shouldRunTests([
'test/unit/config.js', // needs to be first
'test/integration/fabric-ca-affiliation-service-tests.js',
'test/integration/fabric-ca-identity-service-tests.js',
'test/integration/fabric-ca-certificate-service-tests.js',
'test/integration/fabric-ca-services-tests.js',
'test/integration/nodechaincode/e2e.js',
'test/integration/e2e.js',
'test/integration/network-e2e/e2e.js',
'test/integration/network-e2e/e2e-hsm.js',
// 'test/integration/network-e2e/e2e-hsm.js',
'test/integration/signTransactionOffline.js',
'test/integration/query.js',
'test/integration/client.js',
Expand Down
2 changes: 1 addition & 1 deletion fabric-client/test/BlockDecoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('BlockDecoder', () => {
let FakeLogger;

before(() => {
data = fs.readFileSync(path.join(__dirname, '../../test/fixtures/channel/twoorgs.genesis.block'));
data = fs.readFileSync(path.join(__dirname, '../../test/fixtures/crypto-material/config-base/twoorgs.genesis.block'));
});

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/Jenkins_Scripts/CI_Script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ sdk_E2e_Tests() {
gulp test-logging || err_Check "ERROR!!! gulp test failed"

echo -e "\033[32m Execute cucumber tests" "\033[0m"
gulp run-test-sceanrio || err_Check "ERROR!!! gulp test failed"
gulp run-test-scenario || err_Check "ERROR!!! gulp test failed"
}

# Publish npm modules after successful merge on amd64
Expand Down
10 changes: 5 additions & 5 deletions test/fixtures/caimport.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"ca-import" : {
"orgs": {
"orgs": {
"org1": {
"username": "admin",
"name": "peerOrg1",
"mspid": "Org1MSP",
"storePath": "/tmp/hfc-test-kvs_org1",
"cryptoContent": {
"privateKey": "../fixtures/msp/local/keystore/admin.pem",
"signedCert": "../fixtures/msp/local/signcerts/admin.pem"
"privateKey": "../fixtures/crypto-material/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/key.pem",
"signedCert": "../fixtures/crypto-material/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected].pem"
}
},
"org2": {
Expand All @@ -17,8 +17,8 @@
"mspid": "Org2MSP",
"storePath": "/tmp/hfc-test-kvs_org2",
"cryptoContent": {
"privateKeyPEM": "-----BEGIN PRIVATE KEY-----MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg2HxfPVxvwHYM5X8o/tEoDZ54Rl9uW13U6RElpnFOCruhRANCAATx8pv9DCChfwHoa7IRUf2z7GTmC3k2Tl8e7DWA9fZ4cpL9vdk0ZMgQZKo8Gm61NSTuHMZ8zp3uZn7QOcCmwuDg-----END PRIVATE KEY-----",
"signedCertPEM": "-----BEGIN CERTIFICATE-----MIIB8TCCAZegAwIBAgIUasxwoRvBrGrdyg9+HtdJ3brpcuMwCgYIKoZIzj0EAwIwfzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28xHzAdBgNVBAoTFkludGVybmV0IFdpZGdldHMsIEluYy4xDDAKBgNVBAsTA1dXVzEUMBIGA1UEAxMLZXhhbXBsZS5jb20wHhcNMTcwMTE5MTk1NjAwWhcNMTcxMjE5MDM1NjAwWjAQMQ4wDAYDVQQDEwVhZG1pbjBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABPHym/0MIKF/AehrshFR/bPsZOYLeTZOXx7sNYD19nhykv292TRkyBBkqjwabrU1JO4cxnzOne5mftA5wKbC4OCjYDBeMA4GA1UdDwEB/wQEAwICBDAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBQtEfVCvKOzNSiTgpaWzaYVm6eaBzAfBgNVHSMEGDAWgBQXZ0I9qp6CP8TFHZ9bw5nRtZxIEDAKBggqhkjOPQQDAgNIADBFAiEAvGd5YDIBeQZWpP9wEHFmezvSCjrzy8VcvH/7Yuv3vcoCICy5ssNrEHEyWXqBqeKfU/zrPhHsWJFIaJEDQLRQE05l-----END CERTIFICATE-----"
"privateKeyPEM": "../fixtures/crypto-material/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/key.pem",
"signedCertPEM": "../fixtures/crypto-material/crypto-config/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]"
}
}
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 847d2da

Please sign in to comment.