|
| 1 | +// BlackBoxTest represents a list of test APIs that facilitates testing the |
| 2 | +// switch/network (injecting events, mutating switch state etc.) |
| 3 | + |
| 4 | +syntax = "proto3"; |
| 5 | + |
| 6 | +package gnoi.test; |
| 7 | + |
| 8 | +//import "enums/enums.proto"; |
| 9 | +import "types/types.proto"; |
| 10 | +import "google/rpc/status.proto"; |
| 11 | + |
| 12 | +service BlackBoxTest { |
| 13 | + // This RPC allows the state of a transceiver (for both optical, and copper |
| 14 | + // cable) to be set on the switch. The goal is to simulate the |
| 15 | + // insertion/removal of a transceiver and verify that the switch initializes |
| 16 | + // the transceiver correctly. This RPC maps to the `fake` removal of a |
| 17 | + // physical module, and un-doing the `fake` removal (i.e., insert). This does |
| 18 | + // not implement any fake insertion of a non-present module. The switch |
| 19 | + // remembers the state of a transceiver based on this RPC (until reboot). |
| 20 | + rpc SetTransceiverState(SetTransceiverStateRequest) |
| 21 | + returns (SetTransceiverStateResponse) {} |
| 22 | + |
| 23 | + // This RPC changes the state of the link connected to the specified port(s). |
| 24 | + // The goal is to simulate a link going up/down due to factors external to the |
| 25 | + // switch: copper cable/fiber removed, cable/fiber gone bad, etc. |
| 26 | + rpc SetHardwareLinkState(SetHardwareLinkStateRequest) |
| 27 | + returns (SetHardwareLinkStateResponse) {} |
| 28 | + |
| 29 | + // This RPC sets the Alarm state in the switch. The caller is able to set the |
| 30 | + // id, resource, description, alarm severity, and type. One goal is to put the |
| 31 | + // switch into a critical state to verify that the switch prevents write |
| 32 | + // operations to the switch over P4RT/gNMI/gNOI and that the switch continues |
| 33 | + // to forward packets and export telemetry. |
| 34 | + rpc SetAlarm(SetAlarmRequest) returns (SetAlarmResponse) {} |
| 35 | + |
| 36 | + // Switch performs an internal consistency check. It verifies if the hardware |
| 37 | + // contents match with the corresponding software contents. If no component is |
| 38 | + // specified, verification runs for all valid components. It performs |
| 39 | + // verification on the supplied components otherwise. RPC fails for any |
| 40 | + // invalid component. |
| 41 | + rpc VerifyState(VerifyStateRequest) returns (VerifyStateResponse); |
| 42 | +} |
| 43 | + |
| 44 | +message SetTransceiverStateRequest { |
| 45 | + message TransceiverStateRequest { |
| 46 | + enum TransceiverState { |
| 47 | + STATE_UNSPECIFIED = 0; |
| 48 | + REMOVE = 1; // Remove a module. |
| 49 | + UNDO_REMOVE = 2; // Undo removal (i.e., insertion) of a module. |
| 50 | + } |
| 51 | + |
| 52 | + // Path to the transceiver component. |
| 53 | + .gnoi.types.Path transceiver = 1; |
| 54 | + TransceiverState state = 2; |
| 55 | + } |
| 56 | + |
| 57 | + repeated TransceiverStateRequest transceiver_requests = 1; |
| 58 | +} |
| 59 | + |
| 60 | +message SetTransceiverStateResponse { |
| 61 | + message TransceiverStateResponse { |
| 62 | + // Path to the transceiver component. |
| 63 | + .gnoi.types.Path transceiver = 1; |
| 64 | + // Status of the operation. In case of failures, canonical error code and |
| 65 | + // message show the details. |
| 66 | + google.rpc.Status status = 2; |
| 67 | + } |
| 68 | + |
| 69 | + repeated TransceiverStateResponse transceiver_responses = 1; |
| 70 | +} |
| 71 | + |
| 72 | +message SetHardwareLinkStateRequest { |
| 73 | + message HardwareLinkStateInfo { |
| 74 | + // Path to the interface. |
| 75 | + .gnoi.types.Path interface = 1; |
| 76 | + bool enabled = 2; |
| 77 | + } |
| 78 | + |
| 79 | + repeated HardwareLinkStateInfo link_requests = 1; |
| 80 | +} |
| 81 | + |
| 82 | +message SetHardwareLinkStateResponse { |
| 83 | + message SetHardwareLinkStateStatus { |
| 84 | + // Path to the interface. |
| 85 | + .gnoi.types.Path interface = 1; |
| 86 | + // Status of the operation. In case of failures, canonical error code and |
| 87 | + // message show the details. |
| 88 | + google.rpc.Status status = 2; |
| 89 | + } |
| 90 | + |
| 91 | + repeated SetHardwareLinkStateStatus link_responses = 1; |
| 92 | +} |
| 93 | + |
| 94 | +message SetAlarmRequest { |
| 95 | + // ID associated with the alarm. |
| 96 | + string id = 1; |
| 97 | + // Resource that raises the alarm. Must be a valid component ID. |
| 98 | + string resource = 2; |
| 99 | + // Description of the alarm. |
| 100 | + string description = 3; |
| 101 | + // OPENCONFIG_ALARM_SEVERITY from the OpenConfig system model. |
| 102 | + // openconfig.enums.OpenconfigAlarmTypesOPENCONFIGALARMSEVERITY severity = 4; |
| 103 | + // OPENCONFIG_ALARM_TYPE_ID from the OpenConfig system model. |
| 104 | + // openconfig.enums.OpenconfigAlarmTypesOPENCONFIGALARMTYPEID type = 5; |
| 105 | +} |
| 106 | + |
| 107 | +message SetAlarmResponse {} |
| 108 | + |
| 109 | +message VerifyStateRequest { |
| 110 | + // Resources that verify states. Must be valid component IDs. |
| 111 | + repeated string components = 1; |
| 112 | +} |
| 113 | + |
| 114 | +message VerifyStateResponse { |
| 115 | + message VerifyStateResult { |
| 116 | + string component = 1; |
| 117 | + // Status of the operation. In case of failures, canonical error code |
| 118 | + // and message show the details. |
| 119 | + google.rpc.Status status = 2; |
| 120 | + } |
| 121 | + |
| 122 | + // Overall (aggregated) test result. Overall result succeeds if and only |
| 123 | + // if the test passes for all components. If it fails for any component, |
| 124 | + // the overall result is a failure. |
| 125 | + bool success = 1; |
| 126 | + repeated VerifyStateResult results = 2; |
| 127 | +} |
0 commit comments