Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit b69bfc2

Browse files
committed
[FABG-764] peer revoke integration test
step 1: generate CRL (by bypassing fabric-ca) step 2: update MSP revocation_list in channel config step 3: perform revoke peer test Change-Id: If3eddfcbf8b1f5f30f282a024b805b1368c45870 Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com>
1 parent cf7dc62 commit b69bfc2

File tree

4 files changed

+454
-183
lines changed

4 files changed

+454
-183
lines changed

pkg/fab/resource/config.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,32 @@ func CreateConfigEnvelope(data []byte) (*common.ConfigEnvelope, error) {
131131
return configEnvelope, nil
132132
}
133133

134+
//CreateConfigUpdateEnvelope creates configuration update envelope proto
135+
func CreateConfigUpdateEnvelope(data []byte) (*common.ConfigUpdateEnvelope, error) {
136+
137+
envelope := &common.Envelope{}
138+
if err := proto.Unmarshal(data, envelope); err != nil {
139+
return nil, errors.Wrap(err, "unmarshal envelope from config block failed")
140+
}
141+
payload := &common.Payload{}
142+
if err := proto.Unmarshal(envelope.Payload, payload); err != nil {
143+
return nil, errors.Wrap(err, "unmarshal payload from envelope failed")
144+
}
145+
channelHeader := &common.ChannelHeader{}
146+
if err := proto.Unmarshal(payload.Header.ChannelHeader, channelHeader); err != nil {
147+
return nil, errors.Wrap(err, "unmarshal payload from envelope failed")
148+
}
149+
if common.HeaderType(channelHeader.Type) != common.HeaderType_CONFIG {
150+
return nil, errors.New("block must be of type 'CONFIG'")
151+
}
152+
configEnvelope := &common.ConfigUpdateEnvelope{}
153+
if err := proto.Unmarshal(payload.Data, configEnvelope); err != nil {
154+
return nil, errors.Wrap(err, "unmarshal config envelope failed")
155+
}
156+
157+
return configEnvelope, nil
158+
}
159+
134160
// GetLastConfigFromBlock returns the LastConfig data from the given block
135161
func GetLastConfigFromBlock(block *common.Block) (*common.LastConfig, error) {
136162
if block.Metadata == nil {

test/integration/base_test_setup.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ func GetConfigOverridesPath(filename string) string {
187187
return path.Join(goPath(), "src", metadata.Project, configPath, "overrides", filename)
188188
}
189189

190+
// GetCryptoConfigPath returns the path to the named crypto-config override fixture file
191+
func GetCryptoConfigPath(filename string) string {
192+
const configPath = "test/fixtures/fabric/v1/crypto-config"
193+
return path.Join(goPath(), "src", metadata.Project, configPath, filename)
194+
}
195+
190196
// goPath returns the current GOPATH. If the system
191197
// has multiple GOPATHs then the first is used.
192198
func goPath() string {

test/integration/negative/revoked/main_test.go

Lines changed: 0 additions & 151 deletions
This file was deleted.

0 commit comments

Comments
 (0)