Skip to content

Commit

Permalink
[FABG-764] peer revoke integration test
Browse files Browse the repository at this point in the history
 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>
  • Loading branch information
sudeshrshetty committed Sep 19, 2018
1 parent cf7dc62 commit b69bfc2
Show file tree
Hide file tree
Showing 4 changed files with 454 additions and 183 deletions.
26 changes: 26 additions & 0 deletions pkg/fab/resource/config.go
Expand Up @@ -131,6 +131,32 @@ func CreateConfigEnvelope(data []byte) (*common.ConfigEnvelope, error) {
return configEnvelope, nil
}

//CreateConfigUpdateEnvelope creates configuration update envelope proto
func CreateConfigUpdateEnvelope(data []byte) (*common.ConfigUpdateEnvelope, error) {

envelope := &common.Envelope{}
if err := proto.Unmarshal(data, envelope); err != nil {
return nil, errors.Wrap(err, "unmarshal envelope from config block failed")
}
payload := &common.Payload{}
if err := proto.Unmarshal(envelope.Payload, payload); err != nil {
return nil, errors.Wrap(err, "unmarshal payload from envelope failed")
}
channelHeader := &common.ChannelHeader{}
if err := proto.Unmarshal(payload.Header.ChannelHeader, channelHeader); err != nil {
return nil, errors.Wrap(err, "unmarshal payload from envelope failed")
}
if common.HeaderType(channelHeader.Type) != common.HeaderType_CONFIG {
return nil, errors.New("block must be of type 'CONFIG'")
}
configEnvelope := &common.ConfigUpdateEnvelope{}
if err := proto.Unmarshal(payload.Data, configEnvelope); err != nil {
return nil, errors.Wrap(err, "unmarshal config envelope failed")
}

return configEnvelope, nil
}

// GetLastConfigFromBlock returns the LastConfig data from the given block
func GetLastConfigFromBlock(block *common.Block) (*common.LastConfig, error) {
if block.Metadata == nil {
Expand Down
6 changes: 6 additions & 0 deletions test/integration/base_test_setup.go
Expand Up @@ -187,6 +187,12 @@ func GetConfigOverridesPath(filename string) string {
return path.Join(goPath(), "src", metadata.Project, configPath, "overrides", filename)
}

// GetCryptoConfigPath returns the path to the named crypto-config override fixture file
func GetCryptoConfigPath(filename string) string {
const configPath = "test/fixtures/fabric/v1/crypto-config"
return path.Join(goPath(), "src", metadata.Project, configPath, filename)
}

// goPath returns the current GOPATH. If the system
// has multiple GOPATHs then the first is used.
func goPath() string {
Expand Down
151 changes: 0 additions & 151 deletions test/integration/negative/revoked/main_test.go

This file was deleted.

0 comments on commit b69bfc2

Please sign in to comment.