[ovs-dev] rhel: Fix tests on mock and koji

Message ID a1f754db18055db6890c7dad9142bbffd16a91a4.1551369311.git.tredaelli@redhat.com
State New
Headers show
Series
  • [ovs-dev] rhel: Fix tests on mock and koji
Related show

Commit Message

Timothy Redaelli Feb. 28, 2019, 3:55 p.m.
Currently many tests fails on mock/koji since /etc/resolv.conf is not
present. The unexpected warning causes them to abort.

After this patch an empty resolv.conf is created and used before issuing
"make check".

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 rhel/openvswitch-fedora.spec.in | 2 ++
 rhel/ovn-fedora.spec.in         | 2 ++
 2 files changed, 4 insertions(+)

Comments

Flavio Leitner Feb. 28, 2019, 4:24 p.m. | #1
On Thu, Feb 28, 2019 at 04:55:11PM +0100, Timothy Redaelli wrote:
> Currently many tests fails on mock/koji since /etc/resolv.conf is not
> present. The unexpected warning causes them to abort.
> 
> After this patch an empty resolv.conf is created and used before issuing
> "make check".
> 
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> ---

Acked-by: Flavio Leitner <fbl@sysclose.org>
Ben Pfaff Feb. 28, 2019, 10:40 p.m. | #2
On Thu, Feb 28, 2019 at 01:24:08PM -0300, Flavio Leitner wrote:
> On Thu, Feb 28, 2019 at 04:55:11PM +0100, Timothy Redaelli wrote:
> > Currently many tests fails on mock/koji since /etc/resolv.conf is not
> > present. The unexpected warning causes them to abort.
> > 
> > After this patch an empty resolv.conf is created and used before issuing
> > "make check".
> > 
> > Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> > ---
> 
> Acked-by: Flavio Leitner <fbl@sysclose.org>

Thanks, Timothy (and Flavio).  I applied this to master.

Patch

diff --git a/rhel/openvswitch-fedora.spec.in b/rhel/openvswitch-fedora.spec.in
index 9be31ada0..eec98485f 100644
--- a/rhel/openvswitch-fedora.spec.in
+++ b/rhel/openvswitch-fedora.spec.in
@@ -302,6 +302,8 @@  rm -f $RPM_BUILD_ROOT%{_libdir}/libovn*
 
 %check
 %if %{with check}
+    touch resolv.conf
+    export OVS_RESOLV_CONF=$(pwd)/resolv.conf
     if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :;
     else
         cat tests/testsuite.log
diff --git a/rhel/ovn-fedora.spec.in b/rhel/ovn-fedora.spec.in
index 15f3352ca..ea44e49cc 100644
--- a/rhel/ovn-fedora.spec.in
+++ b/rhel/ovn-fedora.spec.in
@@ -212,6 +212,8 @@  rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/openvswitch
 
 %check
 %if %{with check}
+    touch resolv.conf
+    export OVS_RESOLV_CONF=$(pwd)/resolv.conf
     if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :;
     else
         cat tests/testsuite.log