Skip to content

Commit

Permalink
Fix configtx integration test
Browse files Browse the repository at this point in the history
Signed-off-by: andrew-coleman <andrew_coleman@uk.ibm.com>
  • Loading branch information
andrew-coleman authored and Param-S committed Jan 23, 2023
1 parent 60ad2c0 commit d454ea2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
16 changes: 5 additions & 11 deletions integration/configtx/consenter_mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,14 @@ import (
)

var _ = Describe("ConfigTx ConsenterMapping", func() {
It("generates genesis block and checks it contains the ConsenterMapping", func() {
testDir, err := ioutil.TempDir("", "consenter-mapping-test")
It("generates an application channel genesis block and checks it contains the ConsenterMapping", func() {
testDir, err := ioutil.TempDir("", "configtx")
Expect(err).NotTo(HaveOccurred())
defer os.RemoveAll(testDir)

network := nwo.New(nwo.MultiNodeBFTNoSysChan(), testDir, nil, StartPort(), components)

// Generate config
networkConfig := nwo.MultiNodeSmartBFT()
networkConfig.SystemChannel.Name = ""
networkConfig.Channels = nil

network := nwo.New(networkConfig, testDir, nil, StartPort(), components)
network.Consortiums = nil
network.Consensus.ChannelParticipationEnabled = true
network.Consensus.BootstrapMethod = "none"
network.GenerateConfigTree()

// bootstrap the network, which generates the genesis block
Expand All @@ -55,6 +49,6 @@ var _ = Describe("ConfigTx ConsenterMapping", func() {
o := &common.Orderers{}
err = proto.Unmarshal(group.GetValues()["Orderers"].GetValue(), o)
Expect(err).NotTo(HaveOccurred())
Expect(len(o.GetConsenterMapping())).To(Equal(4))
Expect(len(o.GetConsenterMapping())).To(Equal(3))
})
})
2 changes: 1 addition & 1 deletion integration/nwo/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ func (n *Network) CreateAndJoinChannel(o *Orderer, channelName string) {
// creates an anchor peer update transaction for each organization, and submits
// the update transactions to the orderer.
//
//TODO using configtxgen with -outputAnchorPeersUpdate to update the anchor peers is deprecated and does not work
// TODO using configtxgen with -outputAnchorPeersUpdate to update the anchor peers is deprecated and does not work
// with channel participation API. We'll have to generate the channel update explicitly (see UpdateOrgAnchorPeers).
func (n *Network) UpdateChannelAnchors(o *Orderer, channelName string) {
tempFile, err := ioutil.TempFile("", "update-anchors")
Expand Down
13 changes: 6 additions & 7 deletions integration/nwo/standard_networks.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,26 +317,25 @@ func FullEtcdRaftNoSysChan() *Config {

func MultiNodeBFTNoSysChan() *Config {
config := BasicConfig()
config.SystemChannel = nil

config.Consensus.Type = "BFT"
config.Orderers = []*Orderer{
{Name: "orderer1", Organization: "OrdererOrg"},
{Name: "orderer2", Organization: "OrdererOrg"},
{Name: "orderer3", Organization: "OrdererOrg"},
{Name: "orderer4", Organization: "OrdererOrg"},
}
config.Profiles = []*Profile{
{
Name: "SampleDevModeBFT",
Orderers: []string{"orderer1", "orderer2", "orderer3", "orderer4"},
},
{
Name: "TwoOrgsChannel",
Name: "TwoOrgsAppChannelBFT",
Consortium: "SampleConsortium",
Organizations: []string{"Org1", "Org2"},
Orderers: []string{"orderer1", "orderer2", "orderer3"},
},
}
config.SystemChannel = nil
config.Consensus.ChannelParticipationEnabled = true
config.Consensus.BootstrapMethod = "none"
config.Channels = []*Channel{{Name: "testchannel", Profile: "TwoOrgsAppChannelBFT"}}

return config
}
Expand Down

0 comments on commit d454ea2

Please sign in to comment.