File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -264,3 +264,31 @@ func (o *OTG) GNMIOpts() *gnmi.Opts {
264264 return rawapis .FetchOTGGNMI (ctx , o .ate )
265265 })
266266}
267+
268+
269+ func (o * OTG ) AppendConfig (t testing.TB , cfg gosnappi.ConfigAppend ) {
270+ t .Helper ()
271+ t = events .ActionStarted (t , "Appending config to %s" , o .ate )
272+ warns , err := appendConfig (context .Background (), o .ate , cfg )
273+ if err != nil {
274+ t .Fatalf ("AppendConfig(t) on %s: %v" , o .ate , err )
275+ }
276+
277+ if len (warns ) > 0 {
278+ t .Logf ("AppendConfig(t) on %s non-fatal warnings: %v" , o .ate , warns )
279+ }
280+ }
281+
282+ func appendConfig (ctx context.Context , ate binding.ATE , cfg gosnappi.ConfigAppend ) ([]string , error ) {
283+ api , err := rawapis .FetchOTG (ctx , ate )
284+ if err != nil {
285+ return nil , err
286+ }
287+
288+ resp , err := api .AppendConfig (cfg )
289+ if err != nil {
290+ return nil , err
291+ }
292+ return resp .Warnings (), nil
293+ }
294+
You can’t perform that action at this time.
0 commit comments