f-56: agent: MTU unique network.mtu_vm, underlay à 9000 contrôlé à la création, option DHCP 26 et host_mtu #56
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
d1b50d546c
commit
8cb5117cb2
37 changed files with 518 additions and 24 deletions
|
|
@ -16,6 +16,7 @@ type Subnet struct {
|
|||
InterfaceIP net.IP
|
||||
VPCRoute *net.IPNet
|
||||
DefaultGateway net.IP
|
||||
MTU int
|
||||
}
|
||||
|
||||
func (s Subnet) Instance() string {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ func (b Dnsmasq) config(s Subnet) dhcp.Config {
|
|||
InterfaceIP: s.InterfaceIP,
|
||||
VPCRoute: s.VPCRoute,
|
||||
DefaultGateway: s.DefaultGateway,
|
||||
MTU: s.MTU,
|
||||
}
|
||||
if s.Listen != "" && s.Listen != s.Bridge {
|
||||
c.Listen = s.Listen
|
||||
|
|
|
|||
|
|
@ -112,6 +112,12 @@ func TestDnsmasqSetVM_RejectsAVMWithoutReservation(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestDnsmasqConfig_CarriesTheMTU(t *testing.T) {
|
||||
if c := (Dnsmasq{}).config(Subnet{VPC: "vp-s9", Bridge: "br-s9r1", MTU: 1450}); c.MTU != 1450 {
|
||||
t.Errorf("mtu = %d, want 1450", c.MTU)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDnsmasqConfig_ListenOnGatewayExcludesTheBridge(t *testing.T) {
|
||||
c := Dnsmasq{}.config(Subnet{VPC: "vp-s9", Bridge: "br-s9r1", Listen: "gw-s9r1"})
|
||||
if c.Listen != "gw-s9r1" || c.Except != "br-s9r1" {
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ func (b Two) pushSubnet(s Subnet) error {
|
|||
subnet := dhcpapi.Subnet{
|
||||
Network: s.Network.String(),
|
||||
InterfaceIP: s.InterfaceIP.String(),
|
||||
MTU: s.MTU,
|
||||
}
|
||||
if s.VPCRoute != nil {
|
||||
subnet.VPCRoute = s.VPCRoute.String()
|
||||
|
|
|
|||
|
|
@ -93,6 +93,18 @@ func TestTwoPushSubnet_ReachesTheStore(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestTwoPushSubnet_CarriesTheMTU(t *testing.T) {
|
||||
b, s, store := twoBackend(t)
|
||||
s.MTU = 1450
|
||||
|
||||
if err := b.pushSubnet(s); err != nil {
|
||||
t.Fatalf("pushSubnet: %v", err)
|
||||
}
|
||||
if got, _ := store.Subnet(); got.MTU != 1450 {
|
||||
t.Errorf("mtu = %d, want 1450", got.MTU)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTwoPushSubnet_OmitsAnAbsentVPCRouteAndGateway(t *testing.T) {
|
||||
b, s, store := twoBackend(t)
|
||||
s.VPCRoute = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue