[ovs-dev] [PATCH] ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build
tredaelli at redhat.com
Mon Oct 22 16:18:56 UTC 2018
On Mon, 22 Oct 2018 21:19:35 +0530
nusiddiq at redhat.com wrote:
> From: Numan Siddique <nusiddiq at redhat.com>
> The test "ovn-nbctl: LBs - daemon" fails when it runs the command
> "ovn-nbctl lb-add lb0 188.8.131.52a 192.168.10.10:80,192.168.10.20:80". ovn-nbctl
> extracts the vip by calling the socket util function 'inet_parse_active()',
> and this function blocks when it calls dns_resolve(). It blocks because
> networking is disabled with mock rpm build.
> To address this issue, this patch adds a new function -
> inet_parse_active_address_and_port() which expects IP:[port] address
> in the 'target_' argument and disables resolving the host.
> This new function is now used in ovn-northd and ovn-nbctl. It is fine to
> use this function as load balancer VIP cannot be a hostname.
> Reported-by: Timothy Redaelli <tredaelli at redhat.com>
> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1641672
> Signed-off-by: Numan Siddique <nusiddiq at redhat.com>
I tested this both by building an OVS package with mock (with make
check enabled) and manually using the following command lines:
$ cd ovs
$ ./boot.sh && ./configure && make -j$(nproc)
$ sudo unshare -mn -- sh -c 'ip addr add dev lo 127.0.0.1 && \
mount --bind /dev/null /etc/resolv.conf && runuser $SUDO_USER'
$ make sandbox SANDBOXFLAGS="--ovn"
$ ovn-nbctl -vsocket_util:off lb-add lb0 184.108.40.206a \
Without this patch the 'ovn-nbctl' command stay blocked for more than
1 minutes. strace shows up it's trying to contact 127.0.0.1 on port 53
in order to resolve "220.127.116.11a".
With this patch, instead, the 'ovn-nbctl' command instantaneously
returns with retcode = 1 and "ovn-nbctl: 18.104.22.168a: should be an IP
address (or an IP address and a port number with : as a separator)." is
printed on stderr.
Tested-By: Timothy Redaelli <tredaelli at redhat.com>
More information about the dev