From nobody Fri Apr 19 20:45:06 2024 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 ARC-Seal: i=1; a=rsa-sha256; t=1557234270; cv=none; d=zoho.com; s=zohoarc; b=FjmvgNqOFbwGig/KhpFx759yMqr0Ob6JAxyNf1c8a9P17ouRMEw2C71TQg7ndrEzTL1sEQx9V5rN8YY8HJLQgQQqlOfDxsLN6+FXMhrd9CXbsB6llL4CsvqcFGueRgKiohyiWgTXNpZL6V04oaWN0QIARy7C3ViA8ola7n9XsFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557234270; 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:ARC-Authentication-Results; bh=S7XYBj1n62JipuPqTm4gJ+804NA5SOM/4f2yKqtNJB0=; b=T+R/hXcWHsu2FQ2o5aUMuQ3Ot0oNK9WF28y7UzfFyV1LBM+b8ukBTjN2LokwFLFA9rVwZby+64KlLWIWt74TaNSIEJS3T1sWRbYAd3dcHT++nbHXafk6Ngzpuz5xlE69e1jp4yROap9gp+nOb/w4FbZqDBmAppTyo4nzmr/49wA= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1557234270350246.30786507370533; Tue, 7 May 2019 06:04:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E1D1308622B; Tue, 7 May 2019 13:04:18 +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 34FE561B76; Tue, 7 May 2019 13:04:15 +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 A9DCC18089CB; Tue, 7 May 2019 13:04:12 +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 x47D4ABW030016 for ; Tue, 7 May 2019 09:04:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 57AA75EDE4; Tue, 7 May 2019 13:04:10 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id D116D627D8 for ; Tue, 7 May 2019 13:04:04 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 7 May 2019 15:04:01 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2] tests: Move tools under tests/tools/ 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-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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 07 May 2019 13:04:24 +0000 (UTC) Content-Type: text/plain; charset="utf-8" There are some scripts/binaries that are not tests themselves but rather fulfill support purpose. Separate them from the rest of the tests. Signed-off-by: Michal Privoznik --- diff to v1: - Found a way to generate a binary into a subdir. So no new Makefile.am is introduced .gitignore | 2 +- cfg.mk | 4 ++-- tests/Makefile.am | 22 +++----------------- tests/qemucapabilitiestest.c | 4 ++-- tests/testutils.c | 2 +- tests/{ =3D> tools}/.valgrind.supp | 0 tests/tools/Makefile.inc.am | 23 +++++++++++++++++++++ tests/{ =3D> tools}/check-file-access.pl | 2 +- tests/{ =3D> tools}/file_access_whitelist.txt | 0 tests/{ =3D> tools}/group-qemu-caps.pl | 0 tests/{ =3D> tools}/oomtrace.pl | 0 tests/{ =3D> tools}/qemucapsprobe.c | 2 +- tests/{ =3D> tools}/qemucapsprobemock.c | 0 tests/{ =3D> tools}/test-wrap-argv.pl | 2 +- 14 files changed, 35 insertions(+), 28 deletions(-) rename tests/{ =3D> tools}/.valgrind.supp (100%) create mode 100644 tests/tools/Makefile.inc.am rename tests/{ =3D> tools}/check-file-access.pl (98%) rename tests/{ =3D> tools}/file_access_whitelist.txt (100%) rename tests/{ =3D> tools}/group-qemu-caps.pl (100%) rename tests/{ =3D> tools}/oomtrace.pl (100%) rename tests/{ =3D> tools}/qemucapsprobe.c (96%) rename tests/{ =3D> tools}/qemucapsprobemock.c (100%) rename tests/{ =3D> tools}/test-wrap-argv.pl (98%) diff --git a/.gitignore b/.gitignore index 16eb4a3e2e..c231d394f3 100644 --- a/.gitignore +++ b/.gitignore @@ -170,7 +170,7 @@ /tests/*.trs /tests/*test /tests/commandhelper -/tests/qemucapsprobe +/tests/tools/qemucapsprobe !/tests/virsh-self-test !/tests/virt-aa-helper-test !/tests/virt-admin-self-test diff --git a/cfg.mk b/cfg.mk index b785089910..5e055023ee 100644 --- a/cfg.mk +++ b/cfg.mk @@ -1169,10 +1169,10 @@ header-ifdef: =20 test-wrap-argv: $(AM_V_GEN)$(VC_LIST) | $(GREP) -E '\.(ldargs|args)' | xargs \ - $(PERL) $(top_srcdir)/tests/test-wrap-argv.pl --check + $(PERL) $(top_srcdir)/tests/tools/test-wrap-argv.pl --check =20 group-qemu-caps: - $(AM_V_GEN)$(PERL) $(top_srcdir)/tests/group-qemu-caps.pl --check $(top_s= rcdir)/ + $(AM_V_GEN)$(PERL) $(top_srcdir)/tests/tools/group-qemu-caps.pl --check $= (top_srcdir)/ =20 # sc_po_check can fail if generated files are not built first sc_po_check: \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 46d94d2236..c63e8a6e70 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -75,7 +75,6 @@ MOCKLIBS_LIBS =3D \ ../src/libvirt.la =20 EXTRA_DIST =3D \ - .valgrind.supp \ bhyvexml2argvdata \ bhyveargv2xmldata \ bhyvexml2xmloutdata \ @@ -107,7 +106,6 @@ EXTRA_DIST =3D \ nwfilterxml2firewalldata \ nwfilterxml2xmlin \ nwfilterxml2xmlout \ - oomtrace.pl \ qemuagentdata \ qemuargv2xmldata \ qemublocktestdata \ @@ -285,12 +283,10 @@ test_programs +=3D qemuxml2argvtest qemuxml2xmltest \ qemusecuritytest \ qemufirmwaretest \ $(NULL) -test_helpers +=3D qemucapsprobe test_libraries +=3D libqemumonitortestutils.la \ libqemutestdriver.la \ qemuxml2argvmock.la \ qemucaps2xmlmock.la \ - qemucapsprobemock.la \ qemucpumock.la \ $(NULL) endif WITH_QEMU @@ -442,15 +438,13 @@ 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) tools/check-file-access.pl | sort -u =20 file-access-clean: > test_file_access.txt endif WITH_LINUX =20 -EXTRA_DIST +=3D \ - check-file-access.pl \ - file_access_whitelist.txt +include tools/Makefile.inc.am =20 if WITH_TESTS noinst_PROGRAMS =3D $(test_programs) $(test_helpers) @@ -478,7 +472,7 @@ TESTS_ENVIRONMENT =3D \ =20 VALGRIND =3D valgrind --quiet --leak-check=3Dfull --trace-children=3Dyes \ --trace-children-skip=3D"*/tools/virsh","*/tests/commandhelper" \ - --suppressions=3D$(abs_srcdir)/.valgrind.supp + --suppressions=3D$(abs_srcdir)/tools/.valgrind.supp valgrind: $(MAKE) check VG=3D"$(LIBTOOL) --mode=3Dexecute $(VALGRIND)" =20 @@ -603,16 +597,6 @@ qemucapabilitiestest_SOURCES =3D \ qemucapabilitiestest_LDADD =3D libqemumonitortestutils.la \ $(qemu_LDADDS) $(LDADDS) =20 -qemucapsprobe_SOURCES =3D \ - qemucapsprobe.c -qemucapsprobe_LDADD =3D \ - libqemutestdriver.la $(LDADDS) - -qemucapsprobemock_la_SOURCES =3D \ - qemucapsprobemock.c -qemucapsprobemock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) -qemucapsprobemock_la_LIBADD =3D $(MOCKLIBS_LIBS) - qemucommandutiltest_SOURCES =3D \ qemucommandutiltest.c \ testutils.c testutils.h \ diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index ac9ab6bfce..48363326f4 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -225,11 +225,11 @@ mymain(void) return EXIT_FAILURE; =20 /* - * Run "tests/qemucapsprobe /path/to/qemu/binary >foo.replies" + * Run "tests/tools/qemucapsprobe /path/to/qemu/binary >foo.replies" * to generate updated or new *.replies data files. * * If you manually edit replies files you can run - * "tests/qemucapsfixreplies foo.replies" to fix the replies ids. + * "tests/tools/qemucapsfixreplies foo.replies" to fix the replies ids. * * Once a replies file has been generated and tweaked if necessary, * you can drop it into tests/qemucapabilitiesdata/ (with a sensible diff --git a/tests/testutils.c b/tests/testutils.c index 245b1832f6..080a1ccda2 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -533,7 +533,7 @@ virTestRewrapFile(const char *filename) return -1; } =20 - if (virAsprintf(&script, "%s/test-wrap-argv.pl", abs_srcdir) < 0) + if (virAsprintf(&script, "%s/tools/test-wrap-argv.pl", abs_srcdir) < 0) goto cleanup; =20 cmd =3D virCommandNewArgList(perl, script, "--in-place", filename, NUL= L); diff --git a/tests/.valgrind.supp b/tests/tools/.valgrind.supp similarity index 100% rename from tests/.valgrind.supp rename to tests/tools/.valgrind.supp diff --git a/tests/tools/Makefile.inc.am b/tests/tools/Makefile.inc.am new file mode 100644 index 0000000000..ffc38a93f7 --- /dev/null +++ b/tests/tools/Makefile.inc.am @@ -0,0 +1,23 @@ +# vim: filetype=3Dautomake + +if WITH_QEMU +test_helpers +=3D tools/qemucapsprobe +test_libraries +=3D tools/qemucapsprobemock.la + +tools_qemucapsprobe_SOURCES =3D \ + tools/qemucapsprobe.c \ + testutils.h +tools_qemucapsprobe_LDADD =3D \ + libqemutestdriver.la $(LDADDS) + +tools_qemucapsprobemock_la_SOURCES =3D \ + tools/qemucapsprobemock.c +tools_qemucapsprobemock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +tools_qemucapsprobemock_la_LIBADD =3D $(MOCKLIBS_LIBS) +endif WITH_QEMU + +EXTRA_DIST +=3D \ + tools/.valgrind.supp \ + tools/check-file-access.pl \ + tools/file_access_whitelist.txt \ + tools/oomtrace.pl diff --git a/tests/check-file-access.pl b/tests/tools/check-file-access.pl similarity index 98% rename from tests/check-file-access.pl rename to tests/tools/check-file-access.pl index ea0b7a18a2..2f1796b0f3 100755 --- a/tests/check-file-access.pl +++ b/tests/tools/check-file-access.pl @@ -25,7 +25,7 @@ use strict; use warnings; =20 my $access_file =3D "test_file_access.txt"; -my $whitelist_file =3D "file_access_whitelist.txt"; +my $whitelist_file =3D "tools/file_access_whitelist.txt"; =20 my @known_actions =3D ("open", "fopen", "access", "stat", "lstat", "connec= t"); =20 diff --git a/tests/file_access_whitelist.txt b/tests/tools/file_access_whit= elist.txt similarity index 100% rename from tests/file_access_whitelist.txt rename to tests/tools/file_access_whitelist.txt diff --git a/tests/group-qemu-caps.pl b/tests/tools/group-qemu-caps.pl similarity index 100% rename from tests/group-qemu-caps.pl rename to tests/tools/group-qemu-caps.pl diff --git a/tests/oomtrace.pl b/tests/tools/oomtrace.pl similarity index 100% rename from tests/oomtrace.pl rename to tests/tools/oomtrace.pl diff --git a/tests/qemucapsprobe.c b/tests/tools/qemucapsprobe.c similarity index 96% rename from tests/qemucapsprobe.c rename to tests/tools/qemucapsprobe.c index 14c0ecad97..7a5018676c 100644 --- a/tests/qemucapsprobe.c +++ b/tests/tools/qemucapsprobe.c @@ -47,7 +47,7 @@ main(int argc, char **argv) virThread thread; virQEMUCapsPtr caps; =20 - VIR_TEST_PRELOAD(abs_builddir "/.libs/qemucapsprobemock.so"); + VIR_TEST_PRELOAD(abs_builddir "/tools/.libs/qemucapsprobemock.so"); =20 if (argc !=3D 2) { fprintf(stderr, "%s QEMU_binary\n", argv[0]); diff --git a/tests/qemucapsprobemock.c b/tests/tools/qemucapsprobemock.c similarity index 100% rename from tests/qemucapsprobemock.c rename to tests/tools/qemucapsprobemock.c diff --git a/tests/test-wrap-argv.pl b/tests/tools/test-wrap-argv.pl similarity index 98% rename from tests/test-wrap-argv.pl rename to tests/tools/test-wrap-argv.pl index 7867e9d719..4a28ee9d46 100755 --- a/tests/test-wrap-argv.pl +++ b/tests/tools/test-wrap-argv.pl @@ -94,7 +94,7 @@ sub rewrap { close DIFF; =20 print STDERR "Incorrect line wrapping in $file\n"; - print STDERR "Use test-wrap-argv.pl to wrap test data files\n"; + print STDERR "Use tests/tools/test-wrap-argv.pl to wrap test d= ata files\n"; return -1; } } else { --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list