go.ligato.io/vpp-agent/v3@v3.5.0/examples/kvscheduler/mock_plugins/scenario/config.go (about)

     1  //  Copyright (c) 2019 Cisco and/or its affiliates.
     2  //
     3  //  Licensed under the Apache License, Version 2.0 (the "License");
     4  //  you may not use this file except in compliance with the License.
     5  //  You may obtain a copy of the License at:
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  //  Unless required by applicable law or agreed to in writing, software
    10  //  distributed under the License is distributed on an "AS IS" BASIS,
    11  //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  //  See the License for the specific language governing permissions and
    13  //  limitations under the License.
    14  
    15  package scenario
    16  
    17  import (
    18  	interfaces "go.ligato.io/vpp-agent/v3/examples/kvscheduler/mock_plugins/ifplugin/model"
    19  	l2 "go.ligato.io/vpp-agent/v3/examples/kvscheduler/mock_plugins/l2plugin/model"
    20  )
    21  
    22  // Items used across all scenarios:
    23  
    24  var (
    25  	loopback1 = &interfaces.Interface{
    26  		Name:    "loopback1",
    27  		Type:    interfaces.Interface_TAP,
    28  		Enabled: true,
    29  	}
    30  
    31  	tap1 = &interfaces.Interface{
    32  		Name:    "tap1",
    33  		Type:    interfaces.Interface_TAP,
    34  		Enabled: true,
    35  	}
    36  
    37  	tap2 = &interfaces.Interface{
    38  		Name:        "tap2",
    39  		Type:        interfaces.Interface_TAP,
    40  		Enabled:     true,
    41  		PhysAddress: "11:22:33:44:55:66",
    42  	}
    43  
    44  	tap2Invalid = &interfaces.Interface{
    45  		Name:        "tap2",
    46  		Type:        interfaces.Interface_TAP,
    47  		Enabled:     true,
    48  		PhysAddress: "invalid-hw-address",
    49  	}
    50  
    51  	bd1 = &l2.BridgeDomain{
    52  		Name: "bd1",
    53  		Interfaces: []*l2.BridgeDomain_Interface{
    54  			{
    55  				Name: tap1.GetName(),
    56  			},
    57  			{
    58  				Name: tap2.GetName(),
    59  			},
    60  			{
    61  				Name:                    loopback1.GetName(),
    62  				BridgedVirtualInterface: true,
    63  			},
    64  		},
    65  	}
    66  
    67  	bd1WithoutTap1 = &l2.BridgeDomain{ // bd1 edited
    68  		Name: "bd1",
    69  		Interfaces: []*l2.BridgeDomain_Interface{
    70  			{
    71  				Name: tap2.GetName(),
    72  			},
    73  			{
    74  				Name:                    loopback1.GetName(),
    75  				BridgedVirtualInterface: true,
    76  			},
    77  		},
    78  	}
    79  
    80  	bd2 = &l2.BridgeDomain{
    81  		Name: "bd2",
    82  		Interfaces: []*l2.BridgeDomain_Interface{
    83  			{
    84  				Name: tap1.GetName(),
    85  			},
    86  		},
    87  	}
    88  
    89  	bd2WithTap2 = &l2.BridgeDomain{
    90  		Name: "bd2",
    91  		Interfaces: []*l2.BridgeDomain_Interface{
    92  			{
    93  				Name: tap1.GetName(),
    94  			},
    95  			{
    96  				Name: tap2.GetName(),
    97  			},
    98  		},
    99  	}
   100  
   101  	fib1 = &l2.FIBEntry{
   102  		PhysAddress:       "cc:cc:cc:dd:dd:dd",
   103  		BridgeDomain:      bd1.GetName(),
   104  		Action:            l2.FIBEntry_FORWARD,
   105  		OutgoingInterface: tap1.GetName(),
   106  	}
   107  
   108  	fib2 = &l2.FIBEntry{
   109  		PhysAddress:       "aa:aa:aa:bb:bb:bb",
   110  		BridgeDomain:      bd1.GetName(),
   111  		Action:            l2.FIBEntry_FORWARD,
   112  		OutgoingInterface: tap2.GetName(),
   113  	}
   114  
   115  	fib3 = &l2.FIBEntry{
   116  		PhysAddress:       "ee:ee:ee:ff:ff:ff",
   117  		BridgeDomain:      bd2.GetName(),
   118  		Action:            l2.FIBEntry_FORWARD,
   119  		OutgoingInterface: tap1.GetName(),
   120  	}
   121  )