mirror of
https://github.com/AlbrechtL/openwrt-docker.git
synced 2026-10-27 00:00:59 +00:00
Adapt CI to eth* NIC names of multipass 1.17 VMs
Multipass 1.17 VMs name their NICs eth0/eth1/eth2 instead of ens3/ens4/ens5, so 'ip addr add ... dev ens4' fails on wan-vm. Update the interface names in the test job and the WAN_IF/LAN_IF test parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6d617e3864
commit
5af163b06f
@@ -308,20 +308,20 @@ jobs:
|
||||
# Prepare WAN VM
|
||||
echo '******** wan-vm IPs ********'
|
||||
# Add IP address
|
||||
multipass exec wan-vm -- sudo ip addr add 192.168.22.1/24 dev ens4
|
||||
multipass exec wan-vm -- sudo ip addr add 192.168.22.1/24 dev eth1
|
||||
multipass exec wan-vm -- ip addr
|
||||
# Install DHCP server
|
||||
multipass exec wan-vm -- sudo sh -c 'apt-get update && apt-get install -y isc-dhcp-server && echo "default-lease-time 600;\nmax-lease-time 7200;\nsubnet 192.168.22.0 netmask 255.255.255.0 {\n range 192.168.22.100 192.168.22.200;\n option routers 192.168.22.1;\n option domain-name-servers 8.8.8.8, 8.8.4.4;\n option domain-name \"example.org\";\n}" > /etc/dhcp/dhcpd.conf && systemctl enable isc-dhcp-server && systemctl restart isc-dhcp-server'
|
||||
multipass exec wan-vm -- cat /etc/dhcp/dhcpd.conf
|
||||
# Enable NAT
|
||||
multipass exec wan-vm -- sudo modprobe iptable_nat
|
||||
multipass exec wan-vm -- sudo iptables -t nat -A POSTROUTING -o ens3 -j MASQUERADE
|
||||
multipass exec wan-vm -- sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
|
||||
multipass exec wan-vm -- sudo sysctl -w net.ipv4.ip_forward=1
|
||||
|
||||
# Prepare LAN VM
|
||||
echo '******** lan-vm IPs ********'
|
||||
multipass exec lan-vm -- sudo ip addr add 172.31.1.2/24 dev ens4
|
||||
multipass exec lan-vm -- sudo ip addr add 172.31.22.2/24 dev ens4
|
||||
multipass exec lan-vm -- sudo ip addr add 172.31.1.2/24 dev eth1
|
||||
multipass exec lan-vm -- sudo ip addr add 172.31.22.2/24 dev eth1
|
||||
multipass exec lan-vm -- ip addr
|
||||
|
||||
# Double check if virtual networks are working
|
||||
@@ -330,8 +330,8 @@ jobs:
|
||||
sudo ufw status
|
||||
|
||||
echo '******** router-vm IPs ********'
|
||||
multipass exec router-vm -- sudo ip addr add 192.168.22.99/24 dev ens4
|
||||
multipass exec router-vm -- sudo ip addr add 172.31.22.99/24 dev ens5
|
||||
multipass exec router-vm -- sudo ip addr add 192.168.22.99/24 dev eth1
|
||||
multipass exec router-vm -- sudo ip addr add 172.31.22.99/24 dev eth2
|
||||
multipass exec router-vm -- ip addr
|
||||
|
||||
echo '******** Test connection between router-vm, lan-vm and wan-vm ********'
|
||||
|
||||
@@ -258,8 +258,8 @@ def test_openwrt_booted(docker_services):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("parameter",
|
||||
[('LAN_IF','veth'),('LAN_IF','veth,nofixedip'),('LAN_IF','ens5'),('LAN_IF',''),('LAN_IF','host')], indirect=True,
|
||||
ids=['LAN_IF=veth','LAN_IF=veth,nofixedip', 'LAN_IF=ens5', 'LAN_IF=""', 'LAN_IF="host"'])
|
||||
[('LAN_IF','veth'),('LAN_IF','veth,nofixedip'),('LAN_IF','eth2'),('LAN_IF',''),('LAN_IF','host')], indirect=True,
|
||||
ids=['LAN_IF=veth','LAN_IF=veth,nofixedip', 'LAN_IF=eth2', 'LAN_IF=""', 'LAN_IF="host"'])
|
||||
def test_openwrt_lan(docker_services, parameter):
|
||||
wait_for_openwrt_startup(docker_services)
|
||||
|
||||
@@ -302,8 +302,8 @@ def test_openwrt_lan(docker_services, parameter):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("parameter",
|
||||
[('WAN_IF','host'),('WAN_IF','none'),('WAN_IF','ens4'),('WAN_IF','')], indirect=True,
|
||||
ids=['WAN_IF=host', 'WAN_IF=none', 'WAN_IF=ens4', 'WAN_IF=""'])
|
||||
[('WAN_IF','host'),('WAN_IF','none'),('WAN_IF','eth1'),('WAN_IF','')], indirect=True,
|
||||
ids=['WAN_IF=host', 'WAN_IF=none', 'WAN_IF=eth1', 'WAN_IF=""'])
|
||||
def test_openwrt_wan(docker_services, parameter):
|
||||
wait_for_openwrt_startup(docker_services)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user