Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move types not used by zedrouter out of zedroutertypes.go #3513

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/pillar/cmd/diag/diag.go
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@
}
ctx.ph.Print("\n")
// If static print static config
if port.Dhcp == types.DT_STATIC {
if port.Dhcp == types.DhcpTypeStatic {

Check warning on line 950 in pkg/pillar/cmd/diag/diag.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/diag/diag.go#L950

Added line #L950 was not covered by tests
ctx.ph.Print("INFO: %s: Static IP subnet: %s\n",
ifname, port.Subnet.String())
for _, r := range port.DefaultRouters {
Expand Down Expand Up @@ -1100,7 +1100,7 @@
} else {
for _, proxy := range port.ProxyConfig.Proxies {
switch proxy.Type {
case types.NPT_HTTP:
case types.NetworkProxyTypeHTTP:

Check warning on line 1103 in pkg/pillar/cmd/diag/diag.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/diag/diag.go#L1103

Added line #L1103 was not covered by tests
var httpProxy string
if proxy.Port > 0 {
httpProxy = fmt.Sprintf("%s:%d", proxy.Server, proxy.Port)
Expand All @@ -1109,7 +1109,7 @@
}
ctx.ph.Print("INFO: %s: http proxy %s\n",
ifname, httpProxy)
case types.NPT_HTTPS:
case types.NetworkProxyTypeHTTPS:

Check warning on line 1112 in pkg/pillar/cmd/diag/diag.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/diag/diag.go#L1112

Added line #L1112 was not covered by tests
var httpsProxy string
if proxy.Port > 0 {
httpsProxy = fmt.Sprintf("%s:%d", proxy.Server, proxy.Port)
Expand Down
2 changes: 1 addition & 1 deletion pkg/pillar/cmd/nim/nim.go
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ func (n *nim) makeLastResortDPC() (types.DevicePortConfig, error) {
IsMgmt: true,
IsL3Port: true,
DhcpConfig: types.DhcpConfig{
Dhcp: types.DT_CLIENT,
Dhcp: types.DhcpTypeClient,
},
}
dns := n.dpcManager.GetDNS()
Expand Down
56 changes: 28 additions & 28 deletions pkg/pillar/cmd/zedagent/parseconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,12 @@
apiConfigEntry *zconfig.NetworkInstanceConfig,
config *types.NetworkInstanceConfig) {

// Parse and store DnsNameToIPList form Network configuration
// Parse and store DNSNameToIPList form Network configuration

Check warning on line 387 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L387

Added line #L387 was not covered by tests
dnsEntries := apiConfigEntry.GetDns()

// Parse and populate the DnsNameToIP list
// Parse and populate the DNSNameToIP list

Check warning on line 390 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L390

Added line #L390 was not covered by tests
// This is what we will publish to zedrouter
nameToIPs := []types.DnsNameToIP{}
nameToIPs := []types.DNSNameToIP{}

Check warning on line 392 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L392

Added line #L392 was not covered by tests
for _, dnsEntry := range dnsEntries {
hostName := dnsEntry.HostName

Expand All @@ -404,7 +404,7 @@
}
}

nameToIP := types.DnsNameToIP{
nameToIP := types.DNSNameToIP{

Check warning on line 407 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L407

Added line #L407 was not covered by tests
HostName: hostName,
IPs: ips,
}
Expand Down Expand Up @@ -1122,7 +1122,7 @@

port.IsMgmt = isMgmt
port.Cost = portCost
port.Dhcp = types.DT_NONE
port.Dhcp = types.DhcpTypeNone
var ip net.IP
var network *types.NetworkXObjectConfig
if sysAdapter.Addr != "" {
Expand Down Expand Up @@ -1174,27 +1174,27 @@
port.WirelessCfg = network.WirelessCfg
port.Gateway = network.Gateway
port.DomainName = network.DomainName
port.NtpServer = network.NtpServer
port.DnsServers = network.DnsServers
port.NTPServer = network.NTPServer
port.DNSServers = network.DNSServers
// Need to be careful since zedcloud can feed us bad Dhcp type
port.Dhcp = network.Dhcp
switch port.Dhcp {
case types.DT_STATIC:
case types.DhcpTypeStatic:
if port.AddrSubnet == "" {
errStr := fmt.Sprintf("Port %s Configured as DT_STATIC but "+
errStr := fmt.Sprintf("Port %s Configured as DhcpTypeStatic but "+

Check warning on line 1184 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L1184

Added line #L1184 was not covered by tests
"missing subnet address. SysAdapter - Name: %s, Addr:%s",
port.Logicallabel, sysAdapter.Name, sysAdapter.Addr)
log.Errorf("parseSystemAdapterConfig: %s", errStr)
port.RecordFailure(errStr)
}
case types.DT_CLIENT:
case types.DhcpTypeClient:
// Do nothing
case types.DT_NONE:
case types.DhcpTypeNone:

Check warning on line 1192 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L1192

Added line #L1192 was not covered by tests
if isMgmt {
errStr := fmt.Sprintf("Port %s configured as Management port "+
"with an unsupported DHCP type %d. Client and static are "+
"the only allowed DHCP modes for management ports.",
port.Logicallabel, types.DT_NONE)
port.Logicallabel, types.DhcpTypeNone)

Check warning on line 1197 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L1197

Added line #L1197 was not covered by tests

log.Errorf("parseSystemAdapterConfig: %s", errStr)
port.RecordFailure(errStr)
Expand Down Expand Up @@ -1774,13 +1774,13 @@
}
switch proxy.Proto {
case zconfig.ProxyProto_PROXY_HTTP:
proxyEntry.Type = types.NPT_HTTP
proxyEntry.Type = types.NetworkProxyTypeHTTP

Check warning on line 1777 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L1777

Added line #L1777 was not covered by tests
case zconfig.ProxyProto_PROXY_HTTPS:
proxyEntry.Type = types.NPT_HTTPS
proxyEntry.Type = types.NetworkProxyTypeHTTPS

Check warning on line 1779 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L1779

Added line #L1779 was not covered by tests
case zconfig.ProxyProto_PROXY_SOCKS:
proxyEntry.Type = types.NPT_SOCKS
proxyEntry.Type = types.NetworkProxyTypeSOCKS

Check warning on line 1781 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L1781

Added line #L1781 was not covered by tests
case zconfig.ProxyProto_PROXY_FTP:
proxyEntry.Type = types.NPT_FTP
proxyEntry.Type = types.NetworkProxyTypeFTP

Check warning on line 1783 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L1783

Added line #L1783 was not covered by tests
default:
}
proxyConfig.Proxies = append(proxyConfig.Proxies, proxyEntry)
Expand All @@ -1796,7 +1796,7 @@

ipspec := netEnt.GetIp()
switch config.Type {
case types.NT_IPV4, types.NT_IPV6:
case types.NetworkTypeIPv4, types.NetworkTypeIPV6:
if ipspec == nil {
errStr := fmt.Sprintf("parseOneNetworkXObjectConfig: Missing ipspec for %s in %v",
config.Key(), netEnt)
Expand All @@ -1812,10 +1812,10 @@
config.SetErrorNow(errStr)
return config
}
case types.NT_NOOP:
// XXX is controller still sending static and dynamic entries with NT_NOOP? Why?
case types.NetworkTypeNOOP:
// XXX is controller still sending static and dynamic entries with NetworkTypeNOOP? Why?

Check warning on line 1816 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L1815-L1816

Added lines #L1815 - L1816 were not covered by tests
if ipspec != nil {
log.Warnf("XXX NT_NOOP for %s with ipspec %v",
log.Warnf("XXX NetworkTypeNOOP for %s with ipspec %v",

Check warning on line 1818 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L1818

Added line #L1818 was not covered by tests
config.Key(), ipspec)
err := parseIpspecNetworkXObject(ipspec, config)
if err != nil {
Expand All @@ -1835,12 +1835,12 @@
return config
}

// Parse and store DnsNameToIPList form Network configuration
// Parse and store DNSNameToIPList form Network configuration
dnsEntries := netEnt.GetDns()

// Parse and populate the DnsNameToIP list
// Parse and populate the DNSNameToIP list
// This is what we will publish to zedrouter
nameToIPs := []types.DnsNameToIP{}
nameToIPs := []types.DNSNameToIP{}
for _, dnsEntry := range dnsEntries {
hostName := dnsEntry.HostName

Expand All @@ -1858,13 +1858,13 @@
}
}

nameToIP := types.DnsNameToIP{
nameToIP := types.DNSNameToIP{

Check warning on line 1861 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L1861

Added line #L1861 was not covered by tests
HostName: hostName,
IPs: ips,
}
nameToIPs = append(nameToIPs, nameToIP)
}
config.DnsNameToIPList = nameToIPs
config.DNSNameToIPList = nameToIPs
return config
}

Expand Down Expand Up @@ -2000,8 +2000,8 @@
}
}
if n := ipspec.GetNtp(); n != "" {
config.NtpServer = net.ParseIP(n)
if config.NtpServer == nil {
config.NTPServer = net.ParseIP(n)
if config.NTPServer == nil {

Check warning on line 2004 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L2003-L2004

Added lines #L2003 - L2004 were not covered by tests
return errors.New(fmt.Sprintf("bad ntp IP %s",
n))
}
Expand All @@ -2012,7 +2012,7 @@
return errors.New(fmt.Sprintf("bad dns IP %s",
dsStr))
}
config.DnsServers = append(config.DnsServers, ds)
config.DNSServers = append(config.DNSServers, ds)

Check warning on line 2015 in pkg/pillar/cmd/zedagent/parseconfig.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/parseconfig.go#L2015

Added line #L2015 was not covered by tests
}
if dr := ipspec.GetDhcpRange(); dr != nil && dr.GetStart() != "" {
start := net.ParseIP(dr.GetStart())
Expand Down
60 changes: 30 additions & 30 deletions pkg/pillar/cmd/zedagent/parseconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ func TestParsePhysicalNetworkAdapters(t *testing.T) {
g.Expect(port.IsL3Port).To(BeTrue())
g.Expect(port.NetworkUUID.String()).To(Equal(networkUUID))
g.Expect(port.Cost).To(BeZero())
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_IPV4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_CLIENT))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeIPv4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeClient))
g.Expect(port.DhcpConfig.DomainName).To(BeEmpty())
g.Expect(port.DhcpConfig.AddrSubnet).To(BeEmpty())
g.Expect(port.DhcpConfig.DnsServers).To(BeEmpty())
g.Expect(port.DhcpConfig.DNSServers).To(BeEmpty())
g.Expect(port.DhcpConfig.Gateway).To(BeNil())
g.Expect(port.DhcpConfig.NtpServer).To(BeNil())
g.Expect(port.DhcpConfig.NTPServer).To(BeNil())
g.Expect(port.ProxyConfig.Proxies).To(BeEmpty())
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeNone))
g.Expect(port.WirelessCfg.WType).To(Equal(types.WirelessTypeNone))
Expand Down Expand Up @@ -330,8 +330,8 @@ func TestParseVlans(t *testing.T) {
g.Expect(port.IfName).To(Equal("shopfloor.100"))
g.Expect(port.NetworkUUID.String()).To(Equal(network1UUID))
g.Expect(port.Cost).To(BeEquivalentTo(10))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_IPV4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_CLIENT))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeIPv4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeClient))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeVLAN))
g.Expect(port.L2LinkConfig.VLAN.ParentPort).To(Equal("shopfloor"))
g.Expect(port.L2LinkConfig.VLAN.ID).To(BeEquivalentTo(100))
Expand All @@ -344,8 +344,8 @@ func TestParseVlans(t *testing.T) {
g.Expect(port.IfName).To(Equal("shopfloor.200"))
g.Expect(port.NetworkUUID.String()).To(Equal(network2UUID))
g.Expect(port.Cost).To(BeEquivalentTo(20))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_IPV6))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_CLIENT))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeIPV6))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeClient))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeVLAN))
g.Expect(port.L2LinkConfig.VLAN.ParentPort).To(Equal("shopfloor"))
g.Expect(port.L2LinkConfig.VLAN.ID).To(BeEquivalentTo(200))
Expand All @@ -358,8 +358,8 @@ func TestParseVlans(t *testing.T) {
g.Expect(port.IfName).To(Equal("eth0"))
g.Expect(port.NetworkUUID).To(BeZero())
g.Expect(port.Cost).To(BeZero())
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_NOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_NOOP))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeNOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeNOOP))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeNone))
g.Expect(port.WirelessCfg.WType).To(Equal(types.WirelessTypeNone))

Expand Down Expand Up @@ -389,8 +389,8 @@ func TestParseVlans(t *testing.T) {
g.Expect(port.IfName).To(Equal("warehouse.100"))
g.Expect(port.NetworkUUID.String()).To(Equal(network3UUID))
g.Expect(port.Cost).To(BeEquivalentTo(30))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_IPV4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_STATIC))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeIPv4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeStatic))
g.Expect(port.DhcpConfig.AddrSubnet).To(Equal("192.168.1.150/24"))
g.Expect(port.DhcpConfig.Gateway.String()).To(Equal("192.168.1.1"))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeVLAN))
Expand All @@ -405,8 +405,8 @@ func TestParseVlans(t *testing.T) {
g.Expect(port.IfName).To(Equal("eth1"))
g.Expect(port.NetworkUUID).To(BeZero())
g.Expect(port.Cost).To(BeZero())
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_NOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_NOOP))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeNOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeNOOP))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeNone))
g.Expect(port.WirelessCfg.WType).To(Equal(types.WirelessTypeNone))
}
Expand Down Expand Up @@ -496,8 +496,8 @@ func TestParseBonds(t *testing.T) {
g.Expect(port.IfName).To(Equal("bond0"))
g.Expect(port.NetworkUUID.String()).To(Equal(networkUUID))
g.Expect(port.Cost).To(BeEquivalentTo(10))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_IPV4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_CLIENT))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeIPv4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeClient))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeBond))
g.Expect(port.L2LinkConfig.Bond.AggregatedPorts).To(Equal([]string{"shopfloor1", "shopfloor0"}))
g.Expect(port.L2LinkConfig.Bond.Mode).To(Equal(types.BondModeActiveBackup))
Expand All @@ -515,8 +515,8 @@ func TestParseBonds(t *testing.T) {
g.Expect(port.IfName).To(Equal("eth0"))
g.Expect(port.NetworkUUID).To(BeZero())
g.Expect(port.Cost).To(BeZero())
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_NOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_NOOP))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeNOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeNOOP))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeNone))
g.Expect(port.WirelessCfg.WType).To(Equal(types.WirelessTypeNone))
// underlying physical "shopfloor1" adapter
Expand All @@ -527,8 +527,8 @@ func TestParseBonds(t *testing.T) {
g.Expect(port.IfName).To(Equal("eth1"))
g.Expect(port.NetworkUUID).To(BeZero())
g.Expect(port.Cost).To(BeZero())
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_NOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_NOOP))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeNOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeNOOP))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeNone))
g.Expect(port.WirelessCfg.WType).To(Equal(types.WirelessTypeNone))
}
Expand Down Expand Up @@ -651,8 +651,8 @@ func TestParseVlansOverBonds(t *testing.T) {
g.Expect(port.IfName).To(Equal("shopfloor.100"))
g.Expect(port.NetworkUUID.String()).To(Equal(network1UUID))
g.Expect(port.Cost).To(BeEquivalentTo(10))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_IPV4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_CLIENT))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeIPv4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeClient))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeVLAN))
g.Expect(port.L2LinkConfig.VLAN.ParentPort).To(Equal("bond-shopfloor"))
g.Expect(port.L2LinkConfig.VLAN.ID).To(BeEquivalentTo(100))
Expand All @@ -666,8 +666,8 @@ func TestParseVlansOverBonds(t *testing.T) {
g.Expect(port.IfName).To(Equal("shopfloor.200"))
g.Expect(port.NetworkUUID.String()).To(Equal(network2UUID))
g.Expect(port.Cost).To(BeEquivalentTo(20))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_IPV4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_CLIENT))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeIPv4))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeClient))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeVLAN))
g.Expect(port.L2LinkConfig.VLAN.ParentPort).To(Equal("bond-shopfloor"))
g.Expect(port.L2LinkConfig.VLAN.ID).To(BeEquivalentTo(200))
Expand All @@ -681,8 +681,8 @@ func TestParseVlansOverBonds(t *testing.T) {
g.Expect(port.IfName).To(Equal("bond0"))
g.Expect(port.NetworkUUID).To(BeZero())
g.Expect(port.Cost).To(BeZero())
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_NOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_NOOP))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeNOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeNOOP))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeBond))
g.Expect(port.L2LinkConfig.Bond.AggregatedPorts).To(Equal([]string{"shopfloor1", "shopfloor0"}))
g.Expect(port.L2LinkConfig.Bond.Mode).To(Equal(types.BondModeActiveBackup))
Expand All @@ -701,8 +701,8 @@ func TestParseVlansOverBonds(t *testing.T) {
g.Expect(port.IfName).To(Equal("eth0"))
g.Expect(port.NetworkUUID).To(BeZero())
g.Expect(port.Cost).To(BeZero())
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_NOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_NOOP))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeNOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeNOOP))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeNone))
g.Expect(port.WirelessCfg.WType).To(Equal(types.WirelessTypeNone))
// underlying physical "shopfloor1" adapter
Expand All @@ -714,8 +714,8 @@ func TestParseVlansOverBonds(t *testing.T) {
g.Expect(port.IfName).To(Equal("eth1"))
g.Expect(port.NetworkUUID).To(BeZero())
g.Expect(port.Cost).To(BeZero())
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NT_NOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DT_NOOP))
g.Expect(port.DhcpConfig.Type).To(BeEquivalentTo(types.NetworkTypeNOOP))
g.Expect(port.DhcpConfig.Dhcp).To(Equal(types.DhcpTypeNOOP))
g.Expect(port.L2LinkConfig.L2Type).To(Equal(types.L2LinkTypeNone))
g.Expect(port.WirelessCfg.WType).To(Equal(types.WirelessTypeNone))
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/pillar/cmd/zedagent/reportinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@
for _, router := range port.DefaultRouters {
devicePort.DefaultRouters = append(devicePort.DefaultRouters, router.String())
}
// devicePort.DnsServers is deprecated - replaced by Dns
// devicePort.DNSServers is deprecated - replaced by Dns
devicePort.Dns = new(info.ZInfoDNS)
devicePort.Dns.DNSdomain = port.DomainName
for _, dnsServer := range port.DNSServers {
Expand Down Expand Up @@ -1146,12 +1146,12 @@
dp.DefaultRouters = make([]string, 0)
dp.DefaultRouters = append(dp.DefaultRouters, npc.Gateway.String())

dp.NtpServer = npc.NtpServer.String()
dp.NtpServer = npc.NTPServer.String()

Check warning on line 1149 in pkg/pillar/cmd/zedagent/reportinfo.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/reportinfo.go#L1149

Added line #L1149 was not covered by tests

dp.Dns = new(info.ZInfoDNS)
dp.Dns.DNSdomain = npc.DomainName
dp.Dns.DNSservers = make([]string, 0)
for _, d := range npc.DnsServers {
for _, d := range npc.DNSServers {

Check warning on line 1154 in pkg/pillar/cmd/zedagent/reportinfo.go

View check run for this annotation

Codecov / codecov/patch

pkg/pillar/cmd/zedagent/reportinfo.go#L1154

Added line #L1154 was not covered by tests
dp.Dns.DNSservers = append(dp.Dns.DNSservers, d.String())
}
// XXX Not in definition. Remove?
Expand Down
Loading