testing: add vexxhost sample config

This adds a sample setup for vexxhost, which specifies DHCP and IPv6
SLAAC.

Honestly, I think this reveals that Debian/Ubuntu aren't handling this
combo quite right.  They don't seem to be correctly specifying the
ipv6 autoconfig options for the interface.  None of this path has been
touched in a long time, so I am inclined to leave well enough alone.
his at least provides a basis for tweaking in the future.

This has some slight reworking of things in the test generator.  The
sample configs are all using the more modern stable-name "ens3"
instead of "eth0", so we need to parameterize this to some bits of the
testing.  Also makes sure it sets up the ipv6 address as a hostname.

Change-Id: If87bb8f981cb2e7e12918919210d0d58349f17a2
This commit is contained in:
Ian Wienand 2022-05-31 16:33:39 +10:00
parent 0e39e82c6c
commit b685f6cdb1
17 changed files with 86 additions and 5 deletions

View File

@ -0,0 +1 @@
vexxhost.redhat.network.out

View File

@ -0,0 +1,10 @@
### Write /etc/resolv.conf
nameserver 199.204.44.24
nameserver 199.204.47.54
### Write /etc/network/interfaces
auto lo
iface lo inet loopback
source /etc/network/interfaces.d/*.cfg
### Write /etc/network/interfaces.d/ens3.cfg
auto ens3
iface ens3 inet dhcp

View File

@ -0,0 +1 @@
vexxhost.redhat.network.out

View File

@ -0,0 +1,9 @@
### Write /etc/resolv.conf
nameserver 199.204.44.24
nameserver 199.204.47.54
### Write /etc/conf.d/net.ens3
# Automatically generated, do not edit
config_ens3="dhcp"
mac_ens3="fa:16:3e:d1:1f:b2"
config_ens3="dhcp"
mac_ens3="fa:16:3e:d1:1f:b2"

View File

@ -0,0 +1,14 @@
### Write /etc/systemd/resolved.conf
[Resolve]
DNS = 199.204.44.24 199.204.47.54
### Write /etc/systemd/network/ens3.network
# Automatically generated, do not edit
[Match]
MACAddress=fa:16:3e:d1:1f:b2
Name=ens3
[Network]
DHCP=ipv4
IPv6AcceptRA=yes

View File

@ -0,0 +1,11 @@
### Write /etc/resolv.conf
nameserver 199.204.44.24
nameserver 199.204.47.54
### Write /etc/sysconfig/network/ifcfg-ens3
# Automatically generated, do not edit
BOOTPROTO=dhcp
LLADDR=fa:16:3e:d1:1f:b2
STARTMODE=auto
IPV6INIT=yes
IPV6_PRIVACY=no
IPV6_AUTOCONF=yes

View File

@ -0,0 +1,14 @@
### Write /etc/resolv.conf
nameserver 199.204.44.24
nameserver 199.204.47.54
### Write /etc/sysconfig/network-scripts/ifcfg-ens3
# Automatically generated, do not edit
DEVICE=ens3
BOOTPROTO=dhcp
HWADDR=fa:16:3e:d1:1f:b2
ONBOOT=yes
%NM_CONTROLLED%
TYPE=Ethernet
IPV6INIT=yes
IPV6_PRIVACY=no
IPV6_AUTOCONF=yes

View File

@ -0,0 +1 @@
vexxhost.redhat.network.out

View File

@ -0,0 +1 @@
vexxhost.debian.network.out

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"links": [{"id": "tapb906a68b-39", "vif_id": "b906a68b-39ea-450b-be0a-62a607bcb004", "type": "ovs", "mtu": 1500, "ethernet_mac_address": "fa:16:3e:d1:1f:b2"}], "networks": [{"id": "network0", "type": "ipv4_dhcp", "link": "tapb906a68b-39", "network_id": "6d6357ac-0f70-4afa-8bd7-c274cc4ea235"}, {"id": "network1", "type": "ipv6_slaac", "link": "tapb906a68b-39", "ip_address": "2604:e100:1:0:f816:3eff:fed1:1fb2", "netmask": "ffff:ffff:ffff:ffff::", "routes": [], "network_id": "6d6357ac-0f70-4afa-8bd7-c274cc4ea235", "services": []}], "services": [{"type": "dns", "address": "199.204.44.24"}, {"type": "dns", "address": "199.204.47.54"}]}

View File

@ -0,0 +1 @@
{}

View File

@ -0,0 +1 @@
{"static": {}}

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
fa:16:3e:d1:1f:b2

View File

@ -0,0 +1 @@
1

View File

@ -33,12 +33,23 @@ sample_data_path = os.path.join(
distros = ['Ubuntu', 'Debian', 'Fedora', 'RedHat', 'CentOS', 'Gentoo',
'openSUSE', 'networkd', 'Rocky']
styles = ['hp', 'rax', 'rax-iad', 'liberty', 'nokey']
styles = ['hp', 'rax', 'rax-iad', 'liberty', 'nokey', 'vexxhost']
ips = {'hp': '127.0.1.1',
'rax': '23.253.229.154',
'rax-iad': '146.20.110.113',
'liberty': '23.253.229.154',
'nokey': '127.0.1.1'}
'nokey': '127.0.1.1',
'vexxhost': '2604:e100:1:0:f816:3eff:fed1:1fb2'}
interfaces = {
'hp': 'eth0',
'rax': 'eth0',
'rax-iad': 'eth0',
'liberty': 'eth0',
'nokey': 'eth0',
'vexxhost': 'ens3',
}
built_scenarios = []
for distro in distros:
@ -292,11 +303,12 @@ class TestGlean(base.BaseTestCase):
def test_glean_systemd(self):
with mock.patch('glean.systemlock.Lock'):
self._assert_distro_provider(self.distro, self.style,
'eth0', skip_dns=True)
interfaces[self.style], skip_dns=True)
def test_glean_systemd_resolved(self):
with mock.patch('glean.systemlock.Lock'):
self._assert_distro_provider(self.distro, self.style, 'eth0')
self._assert_distro_provider(self.distro, self.style,
interfaces[self.style])
def test_glean_skip_dns(self):
with mock.patch('glean.systemlock.Lock'):
@ -306,4 +318,4 @@ class TestGlean(base.BaseTestCase):
def test_glean_nm(self):
with mock.patch('glean.systemlock.Lock'):
self._assert_distro_provider(
self.distro, self.style, 'eth0', use_nm=True)
self.distro, self.style, interfaces[self.style], use_nm=True)