From nobody Fri May 16 05:40:11 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1501063426916380.0514670956736; Wed, 26 Jul 2017 03:03:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31A1D267C5; Wed, 26 Jul 2017 10:03:45 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0EFA8779EA; Wed, 26 Jul 2017 10:03:45 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 43A44180BA88; Wed, 26 Jul 2017 10:03:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6QA1CM5008898 for ; Wed, 26 Jul 2017 06:01:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id F2CD451C89; Wed, 26 Jul 2017 10:01:11 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.201]) by smtp.corp.redhat.com (Postfix) with ESMTP id 505076FE60; Wed, 26 Jul 2017 10:01:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 31A1D267C5 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 26 Jul 2017 12:00:45 +0200 Message-Id: <7e53940f0221c293f57644af3b6ca3cc209701f1.1501062802.git.pkrempa@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH 15/24] tests: Extract mock library for making hash table deterministic X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 26 Jul 2017 10:03:45 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" virHashNew calls virRandomBits to initialize seed for the hashing function. If a test uses iteration through the hash table to produce results they may/will be non-deterministic. Extract the mock library which was used for mac address mapping to be universal. --- tests/Makefile.am | 17 +++++++++------= -- tests/{virmacmapmock.c =3D> virdeterministichashmock.c} | 0 tests/virmacmaptest.c | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) rename tests/{virmacmapmock.c =3D> virdeterministichashmock.c} (100%) diff --git a/tests/Makefile.am b/tests/Makefile.am index 5be81d221..a2a9ebec9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1198,22 +1198,23 @@ else ! WITH_NSS EXTRA_DIST +=3D nsstest.c nssmock.c nsslinktest.c endif ! WITH_NSS -if WITH_YAJL -virmacmapmock_la_SOURCES =3D \ - virmacmapmock.c -virmacmapmock_la_CFLAGS =3D $(AM_CFLAGS) -virmacmapmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -virmacmapmock_la_LIBADD =3D $(MOCKLIBS_LIBS) +virdeterministichashmock_la_SOURCES =3D \ + virdeterministichashmock.c +virdeterministichashmock_la_CFLAGS =3D $(AM_CFLAGS) +virdeterministichashmock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +virdeterministichashmock_la_LIBADD =3D $(MOCKLIBS_LIBS) + +test_libraries +=3D virdeterministichashmock.la +if WITH_YAJL virmacmaptest_SOURCES =3D \ virmacmaptest.c testutils.h testutils.c virmacmaptest_CLFAGS =3D $(AM_CFLAGS) virmacmaptest_LDADD =3D $(LDADDS) -test_libraries +=3D virmacmapmock.la test_programs +=3D virmacmaptest else ! WITH_YAJL -EXTRA_DIST +=3D virmacmapmock.c virmacmaptest.c +EXTRA_DIST +=3D virmacmaptest.c endif ! WITH_YAJL virnetdevtest_SOURCES =3D \ diff --git a/tests/virmacmapmock.c b/tests/virdeterministichashmock.c similarity index 100% rename from tests/virmacmapmock.c rename to tests/virdeterministichashmock.c diff --git a/tests/virmacmaptest.c b/tests/virmacmaptest.c index 35e312771..0627fb37a 100644 --- a/tests/virmacmaptest.c +++ b/tests/virmacmaptest.c @@ -234,4 +234,4 @@ mymain(void) return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virmacmapmock.so") +VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virdeterministichashmoc= k.so") --=20 2.13.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list