Skip to content

Commit

Permalink
[admin_api] vet
Browse files Browse the repository at this point in the history
  • Loading branch information
menghanl committed Mar 16, 2021
1 parent cee7a35 commit bc771d4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions admin/test/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const (
defaultTestTimeout = 10 * time.Second
)

// RunAndCode contains the function to make an RPC and the expected status code
// (can be OK).
type RunAndCode struct {
// Name of this RPC.
Name string
Expand All @@ -49,6 +51,8 @@ type RunAndCode struct {
Code codes.Code
}

// RunRegisterTests makes a client, runs the RPCs, and compares the status
// codes.
func RunRegisterTests(rcs []RunAndCode) error {
nodeID := uuid.New().String()
bootstrapCleanup, err := xds.SetupBootstrapFile(xds.BootstrapOptions{
Expand Down Expand Up @@ -90,6 +94,7 @@ func RunRegisterTests(rcs []RunAndCode) error {
return nil
}

// RunChannelz makes a channelz RPC.
func RunChannelz(conn *grpc.ClientConn) error {
c := channelzpb.NewChannelzClient(conn)
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
Expand All @@ -98,6 +103,7 @@ func RunChannelz(conn *grpc.ClientConn) error {
return err
}

// RunCSDS makes a CSDS RPC.
func RunCSDS(conn *grpc.ClientConn) error {
c := v3statuspb.NewClientStatusDiscoveryServiceClient(conn)
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
Expand Down

0 comments on commit bc771d4

Please sign in to comment.