From nobody Tue Dec 16 08:34:14 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; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526385850945572.8804389215616; Tue, 15 May 2018 05:04:10 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 085A030C4088; Tue, 15 May 2018 12:04:08 +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 CA2C62A184; Tue, 15 May 2018 12:04:07 +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 6CA5D180B5B2; Tue, 15 May 2018 12:04:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4FC3vEp024764 for ; Tue, 15 May 2018 08:03:57 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8B457200BCE4; Tue, 15 May 2018 12:03:57 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 311D02017D16 for ; Tue, 15 May 2018 12:03:57 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 15 May 2018 14:03:48 +0200 Message-Id: <19a0a8ee7ee6fca629d727b4590c6dd8e65019e1.1526385621.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/8] Skip vircryptotest and virfilecachetest without gnutls 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 15 May 2018 12:04:09 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Fix make check without gnutls. Signed-off-by: J=C3=A1n Tomko --- tests/vircryptotest.c | 26 ++++++++++++++++++-------- tests/virfilecachetest.c | 19 +++++++++++++++---- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/tests/vircryptotest.c b/tests/vircryptotest.c index e24834c16e..d9ffc6f34c 100644 --- a/tests/vircryptotest.c +++ b/tests/vircryptotest.c @@ -20,12 +20,13 @@ =20 #include =20 -#include "vircrypto.h" -#include "virrandom.h" - #include "testutils.h" =20 -#define VIR_FROM_THIS VIR_FROM_NONE +#if WITH_GNUTLS +# include "vircrypto.h" +# include "virrandom.h" + +# define VIR_FROM_THIS VIR_FROM_NONE =20 struct testCryptoHashData { virCryptoHash hash; @@ -129,7 +130,7 @@ mymain(void) 0x1b, 0x8c, 0x3f, 0x48, 0x27, 0xae, 0xb6, 0x7a}; =20 -#define VIR_CRYPTO_HASH(h, i, o) \ +# define VIR_CRYPTO_HASH(h, i, o) \ do { \ struct testCryptoHashData data =3D { \ .hash =3D h, \ @@ -152,9 +153,9 @@ mymain(void) VIR_CRYPTO_HASH(VIR_CRYPTO_HASH_MD5, "The quick brown fox", "a2004f377= 30b9445670a738fa0fc9ee5"); VIR_CRYPTO_HASH(VIR_CRYPTO_HASH_SHA256, "The quick brown fox", "5cac4f= 980fedc3d3f1f99b4be3472c9b30d56523e632d151237ec9309048bda9"); =20 -#undef VIR_CRYPTO_HASH +# undef VIR_CRYPTO_HASH =20 -#define VIR_CRYPTO_ENCRYPT(a, n, i, il, c, cl) \ +# define VIR_CRYPTO_ENCRYPT(a, n, i, il, c, cl) \ do { \ struct testCryptoEncryptData data =3D { \ .algorithm =3D a, \ @@ -173,10 +174,19 @@ mymain(void) VIR_CRYPTO_ENCRYPT(VIR_CRYPTO_CIPHER_AES256CBC, "aes265cbc", secretdata, 7, expected_ciphertext, 16); =20 -#undef VIR_CRYPTO_ENCRYPT +# undef VIR_CRYPTO_ENCRYPT =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } =20 /* Forces usage of not so random virRandomBytes */ VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virrandommock.so") +#else +static int +mymain(void) +{ + return EXIT_AM_SKIP; +} + +VIR_TEST_MAIN(mymain); +#endif /* WITH_GNUTLS */ diff --git a/tests/virfilecachetest.c b/tests/virfilecachetest.c index 3c55cd1e02..44386742e1 100644 --- a/tests/virfilecachetest.c +++ b/tests/virfilecachetest.c @@ -20,11 +20,13 @@ #include =20 #include "testutils.h" -#include "virfile.h" -#include "virfilecache.h" =20 +#if WITH_GNUTLS +# include "virfile.h" +# include "virfilecache.h" =20 -#define VIR_FROM_THIS VIR_FROM_NONE + +# define VIR_FROM_THIS VIR_FROM_NONE =20 =20 struct _testFileCacheObj { @@ -212,7 +214,7 @@ mymain(void) =20 virFileCacheSetPriv(cache, &testPriv); =20 -#define TEST_RUN(name, newData, expectData, expectSave) \ +# define TEST_RUN(name, newData, expectData, expectSave) \ do { \ testFileCacheData data =3D { \ cache, name, newData, expectData, expectSave \ @@ -233,3 +235,12 @@ mymain(void) } =20 VIR_TEST_MAIN_PRELOAD(mymain, abs_builddir "/.libs/virfilecachemock.so") +#else +static int +mymain(void) +{ + return EXIT_AM_SKIP; +} + +VIR_TEST_MAIN(mymain); +#endif /* WITH_GNUTLS */ --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list