forked from hyperledger/fabric-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathe2e_test.go
38 lines (30 loc) · 1.15 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
38
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package pkcs11
import (
"testing"
"github.com/hyperledger/fabric-sdk-go/api/apiconfig"
"github.com/hyperledger/fabric-sdk-go/api/apicryptosuite"
"github.com/hyperledger/fabric-sdk-go/def/fabapi"
"github.com/hyperledger/fabric-sdk-go/def/fabapi/context/defprovider"
cryptosuite "github.com/hyperledger/fabric-sdk-go/pkg/cryptosuite/bccsp/pkcs11"
"github.com/hyperledger/fabric-sdk-go/test/integration/e2e"
)
func TestE2E(t *testing.T) {
// Create SDK setup for the integration tests
sdkOptions := fabapi.Options{
ConfigFile: "../" + ConfigTestFile,
ProviderFactory: &CustomCryptoSuiteProviderFactory{},
}
e2e.Run(t, sdkOptions)
}
// CustomCryptoSuiteProviderFactory is will provide custom cryptosuite (bccsp.BCCSP)
type CustomCryptoSuiteProviderFactory struct {
defprovider.DefaultProviderFactory
}
// NewCryptoSuiteProvider returns a new default implementation of BCCSP
func (f *CustomCryptoSuiteProviderFactory) NewCryptoSuiteProvider(config apiconfig.Config) (apicryptosuite.CryptoSuite, error) {
return cryptosuite.GetSuiteByConfig(config)
}