[ovs-dev] [PATCH] ovn-nbctl: Fix the ovn-nbctl test "LBs - daemon" which fails during rpm build

Timothy Redaelli 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,". 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 && \
  mount --bind /dev/null /etc/resolv.conf && runuser $SUDO_USER'
$ make sandbox SANDBOXFLAGS="--ovn"
$ ovn-nbctl -vsocket_util:off lb-add lb0 \,

Without this patch the 'ovn-nbctl' command stay blocked for more than
1 minutes. strace shows up it's trying to contact on port 53
in order to resolve "".

With this patch, instead, the 'ovn-nbctl' command instantaneously
returns with retcode = 1 and "ovn-nbctl: 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 mailing list