Skip to content

Commit

Permalink
Implement 'osnadmin channel info' subcommand and update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Priyansu Rout <[email protected]>
  • Loading branch information
Priyansurout committed Jun 13, 2024
1 parent e95740a commit f88783d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/osnadmin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func executeForArgs(args []string) (output string, exit int, err error) {
infoChannelID := info.Flag("channelID", "Channel ID").Short('c').Required().String()

remove := channel.Command("remove", "Remove a channel from an Ordering Service Node (OSN).")
removeChannelID := remove.Flag("channelID", "Channel ID").Short('c').String()
removeChannelID := remove.Flag("channelID", "Channel ID").Short('c').Required().String()

command, err := app.Parse(args)
if err != nil {
Expand Down
14 changes: 14 additions & 0 deletions cmd/osnadmin/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,20 @@ var _ = Describe("osnadmin", func() {
}, nil)
})

It("returns an error when channelID flag is not provided", func() {
args := []string{
"channel",
"info",
"--orderer-address", ordererURL,
"--ca-file", ordererCACert,
"--client-cert", clientCert,
"--client-key", clientKey,
}
output, exit, err := executeForArgs(args)
expectedErrorMessage := "required flag(s) \"channelID\" not set"
checkCLIError(output, exit, err, expectedErrorMessage)
})

It("uses the channel participation API to list the details of a single channel", func() {
args := []string{
"channel",
Expand Down

0 comments on commit f88783d

Please sign in to comment.