go_study/fabric-main/integration/pvtdatapurge/pvtdatapurge_suite_test.go

56 lines
1.1 KiB
Go

/*
Copyright IBM Corp All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package pvtdatapurge
import (
"encoding/json"
"path/filepath"
"testing"
"github.com/hyperledger/fabric/integration"
"github.com/hyperledger/fabric/integration/nwo"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
func TestEndToEnd(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Private Data Purge Suite")
}
var (
buildServer *nwo.BuildServer
components *nwo.Components
)
var _ = SynchronizedBeforeSuite(func() []byte {
buildServer = nwo.NewBuildServer()
buildServer.Serve()
components = buildServer.Components()
payload, err := json.Marshal(components)
Expect(err).NotTo(HaveOccurred())
return payload
}, func(payload []byte) {
err := json.Unmarshal(payload, &components)
Expect(err).NotTo(HaveOccurred())
})
var _ = SynchronizedAfterSuite(func() {
}, func() {
buildServer.Shutdown()
})
func StartPort() int {
return integration.PrivateDataPurgeBasePort.StartPortForNode()
}
func CollectionConfig(collConfigFile string) string {
return filepath.Join("..", "pvtdata", "testdata", "collection_configs", collConfigFile)
}