Skip to content

Commit

Permalink
run ipv6 multicast tests on ubuntu and macos
Browse files Browse the repository at this point in the history
  • Loading branch information
afflux committed Jun 8, 2024
1 parent 24e38a6 commit 72e5b2e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/pythonpackage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,23 @@ jobs:
pip install tox
- name: Setup network interfaces
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
set -x
sudo ip link add type veth
sudo ip link set dev veth0 address 02:00:00:00:00:00
sudo ip link set dev veth1 address 02:00:00:00:00:01
sudo ip link set up dev veth0
sudo ip link set up dev veth1
sudo ip link set dev veth0 address 02:00:00:00:00:00 name feth0
sudo ip link set dev veth1 address 02:00:00:00:00:01 name feth1
sudo ip link set up dev feth0
sudo ip link set up dev feth1
- name: Setup network interfaces
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
set -x
sudo ifconfig feth0 create
sudo ifconfig feth0 peer feth1
sudo ifconfig feth0 lladdr 02:00:00:00:00:00 up
sudo ifconfig feth1 lladdr 02:00:00:00:00:01 up
- name: Run tests, flake8 and mypy
run: |
Expand Down
24 changes: 12 additions & 12 deletions tests/test_sd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2377,27 +2377,27 @@ class TestMulticastEndpointsV6(
required setup on Linux:
ip link add type veth
ip link set dev veth0 address 02:00:00:00:00:00
ip link set dev veth1 address 02:00:00:00:00:01
ip link set up dev veth0
ip link set up dev veth1
ip link set dev veth0 address 02:00:00:00:00:00 name feth0
ip link set dev veth1 address 02:00:00:00:00:01 name feth1
ip link set up dev feth0
ip link set up dev feth1
"""

bind_lo_addr = "fe80::ff:fe00:0%veth0"
sender_lo_addr = "fe80::ff:fe00:1%veth0"
send_addr = "fe80::ff:fe00:0%veth1"
bind_mc_addr = "ff02::dead:beef%veth0"
send_mc_addr = "ff02::dead:beef%veth1"
bind_interface = "veth0"
send_interface = "veth1"
bind_lo_addr = "fe80::ff:fe00:0%feth0"
sender_lo_addr = "fe80::ff:fe00:1%feth0"
send_addr = "fe80::ff:fe00:0%feth1"
bind_mc_addr = "ff02::dead:beef%feth0"
send_mc_addr = "ff02::dead:beef%feth1"
bind_interface = "feth0"
send_interface = "feth1"
AF = socket.AF_INET6

def setUp(self):
try:
socket.if_nametoindex(self.bind_interface)
socket.if_nametoindex(self.send_interface)
except OSError as exc:
raise unittest.SkipTest("test interfaces veth0 / veth1 not up") from exc
raise unittest.SkipTest("test interfaces feth0 / feth1 not up") from exc

def _mc_sockopts(self, sock: socket.socket) -> None:
ifindex = socket.if_nametoindex(self.send_interface)
Expand Down

0 comments on commit 72e5b2e

Please sign in to comment.