Commit c09de6fc authored by Lubomir Rintel's avatar Lubomir Rintel 🥕 Committed by Vladimír Beneš
Browse files

ipv4: fix a race in ipv4_method_shared_with_already_running_dnsmasq

dnsmasq instance we start with --bind-interfaces would bind to all
interfaces with an address on startup. The test expects it to bind
before NetworkManager-managed instance of dnsmasq attempts to bind
and end up failing. Given it's started in background when the
interface is not configured yet, it may or may not end up trying
to bind at the right time.

It inded fails occassionally, roughly once in a few hundred runs.

This patch makes sure the interface is configured at the time dnsmasq is
started and gives it hopefully enough time to bind.
parent b348b76d
......@@ -1496,7 +1496,9 @@ Feature: nmcli: ipv4
Scenario: nmcli - ipv4 - method shared when dnsmasq does run
* Note the output of "pidof NetworkManager" as value "1"
* Prepare veth pairs "test1,test2" bridged over "vethbr"
* Execute "/usr/sbin/dnsmasq --log-dhcp --log-queries --conf-file=/dev/null --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --pid-file=/tmp/ &"
* Execute "ip addr add dev test1"
* Execute "ip link set up dev test1"
* Execute "/usr/sbin/dnsmasq --log-dhcp --log-queries --conf-file=/dev/null --no-hosts --keep-in-foreground --bind-interfaces --except-interface=lo --clear-on-reload --pid-file=/tmp/ & sleep 2"
* Add a new connection of type "ethernet" and options "con-name tc1 autoconnect no ifname test1 ipv4.method shared ipv6.method ignore"
* Add a new connection of type "ethernet" and options "con-name tc2 autoconnect no ifname test2 ipv4.may-fail yes ipv6.method manual ipv6.addresses 1::1/128"
* Bring up connection "tc1" ignoring error
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment