-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-9574] Sub interfaces Integration Test
Testing EndpointConfig interface override with sub interfaces Also added localhost URLs in Orderer/Peer/CA configs to test local (TEST_LOCAL=true) Also added integration tests fixes for Fabric v1.2 Change-Id: I93c8f73aaac3b36279fa1f785229d475d68fbf2f Signed-off-by: Baha Shaaban <[email protected]>
- Loading branch information
Baha Shaaban
committed
May 2, 2018
1 parent
72a5fdb
commit ee50b2f
Showing
9 changed files
with
980 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# | ||
# The network connection profile provides client applications the information about the target | ||
# blockchain network that are necessary for the applications to interact with it. These are all | ||
# knowledge that must be acquired from out-of-band sources. This file provides such a source. | ||
# | ||
|
||
|
||
# | ||
# Schema version of the content. Used by the SDK to apply the corresponding parsing rules. | ||
# | ||
version: 1.0.0 | ||
|
||
# | ||
# The client section used by GO SDK. | ||
# | ||
client: | ||
# Some SDKs support pluggable KV stores, the properties under "credentialStore" | ||
# are implementation specific | ||
credentialStore: | ||
# [Optional]. Used by user store. Not needed if all credentials are embedded in configuration | ||
# and enrollments are performed elswhere. | ||
path: "/tmp/state-store" | ||
|
||
# [Optional]. Specific to the CryptoSuite implementation used by GO SDK. Software-based implementations | ||
# requiring a key store. PKCS#11 based implementations does not. | ||
cryptoStore: | ||
# Specific to the underlying KeyValueStore that backs the crypto key store. | ||
path: /tmp/msp | ||
|
||
# BCCSP config for the client. Used by GO SDK. | ||
BCCSP: | ||
security: | ||
enabled: true | ||
default: | ||
provider: "SW" | ||
hashAlgorithm: "SHA2" | ||
softVerify: true | ||
level: 256 |
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,34 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package configless | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/hyperledger/fabric-sdk-go/pkg/core/config" | ||
"github.com/hyperledger/fabric-sdk-go/pkg/fabsdk" | ||
"github.com/hyperledger/fabric-sdk-go/test/integration/e2e" | ||
) | ||
|
||
// this test mimics the original e2e test with the difference of injecting EndpointConfig interface functions implementations | ||
// to programmatically supply configs instead of using a yaml file. With this change, application developers can fetch | ||
// configs from any source as long as they provide their own implementations. | ||
|
||
func TestE2E(t *testing.T) { | ||
configPath := "../../../fixtures/config/config_test_crypto_bccsp.yaml" | ||
//Using same Run call as e2e package but with programmatically overriding interfaces | ||
e2e.RunWithoutSetup(t, config.FromFile(configPath), | ||
fabsdk.WithConfigEndpoint(endpointConfigImpls...)) | ||
|
||
// TODO test with below line once IdentityConfig and CryptoConfig are split into | ||
// TODO sub interfaces like EndpointConfig and pass them in like WithConfigEndpoint, | ||
// TODO this will allow to test overriding all config interfaces without the need of a config file | ||
// TODO maybe add config.BareBone() in the SDK to get a configProvider without a config file instead | ||
// TODO of passing in an empty file as in below comment | ||
// use an empty config file to fully depend on injected EndpointConfig interfaces | ||
//configPath = "../../../pkg/core/config/testdata/viper-test.yaml" | ||
} |
Oops, something went wrong.