forked from hyperledger/fabric-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathe2e_test.go
37 lines (29 loc) · 1.14 KB
/
e2e_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package pkcs11
import (
"testing"
"github.com/hyperledger/fabric-sdk-go/pkg/config"
"github.com/hyperledger/fabric-sdk-go/pkg/fabsdk"
"github.com/hyperledger/fabric-sdk-go/api/apiconfig"
"github.com/hyperledger/fabric-sdk-go/api/apicryptosuite"
cryptosuite "github.com/hyperledger/fabric-sdk-go/pkg/cryptosuite/bccsp/pkcs11"
"github.com/hyperledger/fabric-sdk-go/pkg/fabsdk/factory/defcore"
"github.com/hyperledger/fabric-sdk-go/test/integration/e2e"
)
func TestE2E(t *testing.T) {
// Create SDK setup for the integration tests
e2e.Run(t,
config.FromFile("../"+ConfigTestFile),
fabsdk.WithCorePkg(&CustomCryptoSuiteProviderFactory{}))
}
// CustomCryptoSuiteProviderFactory is will provide custom cryptosuite (bccsp.BCCSP)
type CustomCryptoSuiteProviderFactory struct {
defcore.ProviderFactory
}
// NewCryptoSuiteProvider returns a new default implementation of BCCSP
func (f *CustomCryptoSuiteProviderFactory) NewCryptoSuiteProvider(config apiconfig.Config) (apicryptosuite.CryptoSuite, error) {
return cryptosuite.GetSuiteByConfig(config)
}