-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-5026] NodeSDK - verify install error
Add new test case to verify that we get an error when installing chain code and not using an admin user to sign the request. Change-Id: I8b66b54e2233fb6748fb55c358176c011fda5143 Signed-off-by: Bret Harrison <beharrison@nc.rr.com>
- Loading branch information
1 parent
882e289
commit bf2f388
Showing
6 changed files
with
69 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* Copyright 2017 IBM All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
// This is an end-to-end test that focuses on exercising all parts of the fabric APIs | ||
// in a happy-path scenario | ||
'use strict'; | ||
|
||
var utils = require('fabric-client/lib/utils.js'); | ||
var logger = utils.getLogger('E2E install-chaincode-fail'); | ||
|
||
var tape = require('tape'); | ||
var _test = require('tape-promise'); | ||
var test = _test(tape); | ||
|
||
var e2eUtils = require('./e2eUtils.js'); | ||
var testUtil = require('../../unit/util.js'); | ||
|
||
test('\n\n***** End-to-end flow: chaincode install *****\n\n', (t) => { | ||
testUtil.setupChaincodeDeploy(); | ||
|
||
e2eUtils.installChaincode('org1', testUtil.CHAINCODE_PATH, 'v0', t, false) | ||
.then(() => { | ||
t.fail('Successfully installed chaincode in peers of organization "org1"'); | ||
return e2eUtils.installChaincode('org2', testUtil.CHAINCODE_PATH, 'v0', t, false); | ||
}, (err) => { | ||
t.pass('Failed to install chaincode in peers of organization "org1". ' + err.stack ? err.stack : err); | ||
logger.error('Failed to install chaincode in peers of organization "org1". '); | ||
return e2eUtils.installChaincode('org2', testUtil.CHAINCODE_PATH, 'v0', t, false); | ||
}).then(() => { | ||
t.fail('Successfully installed chaincode in peers of organization "org2"'); | ||
t.end(); | ||
}, (err) => { | ||
t.pass('Failed to install chaincode in peers of organization "org2". ' + err.stack ? err.stack : err); | ||
logger.error('Failed to install chaincode in peers of organization "org2". '); | ||
t.end(); | ||
}).catch((err) => { | ||
t.fail('Test failed due to unexpected reasons. ' + err.stack ? err.stack : err); | ||
t.end(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters