From nobody Fri May 3 22:15:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575468109; cv=none; d=zohomail.com; s=zohoarc; b=lEFLuZJHEUI89H5C5x+oLt0tIbpzDnbO3V3JwKRix+3a+oi1fGOH8TvHIlTBteeAwwj9aMMaPyUV/YmlY+MCekDKE6PksrfziQCclNSkrI3+Ot4kRCl4WlwypDVdZ9anjo7Y6UNAsUspwPzZwPoWNM1xmmQzwLqDv5oxvdqgkdk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575468109; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=JsIF31oukWwL1Cqm5FmXV6wviIkix2td0UuYgb8Mu1U=; b=V9TRUq2muOAbdJfpAnrNlajPjOXHyHQMZfRq7aXg4ymwd35qxRndgdLzn03t19HLiYCehowvPh4tPy86MLoYlU4o88XJUbZ3N3yQzv+eYLPXvAxLelFePOxxaSo2N1Yg7zftFnytEuvX8mBw0/8Vf2kdzCymFY7YtH0F4JnHRyE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 157546810923067.39972217611626; Wed, 4 Dec 2019 06:01:49 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-QBpol7twMjG0tcH-87YHPw-1; Wed, 04 Dec 2019 09:01:46 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1325118B9FC1; Wed, 4 Dec 2019 14:01:40 +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 ABB835DA60; Wed, 4 Dec 2019 14:01:38 +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 0CC5018089C8; Wed, 4 Dec 2019 14:01:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB4E1aCL006087 for ; Wed, 4 Dec 2019 09:01:36 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3559B5C21B; Wed, 4 Dec 2019 14:01:36 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADB2B5C1B2 for ; Wed, 4 Dec 2019 14:01:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575468108; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JsIF31oukWwL1Cqm5FmXV6wviIkix2td0UuYgb8Mu1U=; b=FRTtQIWNnxH4IwFbjiYJIpJZMdSmKP573D+LYza6ExYDUZeY9CQvud5ppzcV3NyeTXinaJ k1btGCmpLZJMUxUb1CyLwlPqZMyy0xcAh1fFthaSnmBuV2DAbF0fgDJ+Nz0rXQBw5dHgpV sVz2qqMO1IA2raQ4Mnv9q5DB20M3A80= From: Michal Privoznik To: libvir-list@redhat.com Date: Wed, 4 Dec 2019 15:01:31 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] tests: Make check-file-access.pl accept files through argv 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: , 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-MC-Unique: QBpol7twMjG0tcH-87YHPw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The script needs two files to open: $(builddir)/test_file_access.txt, and $(srcdir)/file_access_whitelist.txt. However, the script is opening the files from the $CWD which won't work for a VPATH build. Make the script accept paths to the files through @ARGV and tune the Makefile.am to pass them. Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- tests/Makefile.am | 4 +++- tests/check-file-access.pl | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index cbe8e86224..4c2856bf97 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -454,7 +454,9 @@ EXTRA_DIST +=3D $(test_scripts) if WITH_LINUX check-access: file-access-clean VIR_TEST_FILE_ACCESS=3D1 $(MAKE) $(AM_MAKEFLAGS) check - $(PERL) check-file-access.pl | sort -u + $(PERL) $(abs_srcdir)/check-file-access.pl \ + $(abs_builddir)/test_file_access.txt \ + $(abs_srcdir)/file_access_whitelist.txt | sort -u =20 file-access-clean: > test_file_access.txt diff --git a/tests/check-file-access.pl b/tests/check-file-access.pl index ea0b7a18a2..2926126b14 100755 --- a/tests/check-file-access.pl +++ b/tests/check-file-access.pl @@ -24,8 +24,12 @@ use strict; use warnings; =20 -my $access_file =3D "test_file_access.txt"; -my $whitelist_file =3D "file_access_whitelist.txt"; +sub usage { + die "$0 access_file file_access_whitelist\n"; +} + +my $access_file =3D shift or usage(); +my $whitelist_file =3D shift or usage(); =20 my @known_actions =3D ("open", "fopen", "access", "stat", "lstat", "connec= t"); =20 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list