forked from hyperledger/fabric-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
e2e_test.go
36 lines (28 loc) · 1.11 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
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package pkcs11
import (
"testing"
"github.com/hyperledger/fabric-sdk-go/pkg/fabsdk"
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/core/config"
cryptosuite "github.com/hyperledger/fabric-sdk-go/pkg/core/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
}
// CreateCryptoSuiteProvider returns a new default implementation of BCCSP
func (f *CustomCryptoSuiteProviderFactory) CreateCryptoSuiteProvider(config core.CryptoSuiteConfig) (core.CryptoSuite, error) {
return cryptosuite.GetSuiteByConfig(config)
}