From nobody Wed Apr 24 19:13:45 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=1557129710; cv=none; d=zoho.com; s=zohoarc; b=GPbctrksqVtL+eexQal4OM0MAXHQJ2OtF3qSRZ1subKN0OdX9KWR1ux9gfZm0kg61L5QoBUI62cMZ/ojUYasvDvx90BT1D/Cq7vd0rOEzJtU2FNKgEENEg3m8nY23rZvCJo9dFh/u2G4tmGKXvF8xoegT0ohA5Q0k6RUS+IwoxU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557129710; 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=ypfcfbZKPVsTMxlLB9ObbAJfxlRjwQ0M+yKXEZIBMps=; b=OUB5fVVHgN6DJWKYtTvG+wpnFFl07+UnMG60rtLXMHlTwjRSaH1qSiTSzojsPl10DZiCozwjavWcqKVIFlkT8NGp/9mt3vdU1v08W6WlScZyC0FeD1t6RMA0jxLHFUNAInVWQbXU8mA7HuXDSxIlZnFh4B1udFnv0uv6LbN5mOg= 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 1557129710382914.2127193645681; Mon, 6 May 2019 01:01:50 -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 11FBA5945B; Mon, 6 May 2019 08:01:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8245E5F9CB; Mon, 6 May 2019 08:01:47 +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 7F74241F3D; Mon, 6 May 2019 08:01:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4681ixY007753 for ; Mon, 6 May 2019 04:01:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6E3A75DA5B; Mon, 6 May 2019 08:01:44 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2ACB5DA35 for ; Mon, 6 May 2019 08:01:41 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 6 May 2019 10:01:37 +0200 Message-Id: <3b1dcab2e1b1eb52cc408acbe8f5d40ad97ca043.1557129682.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] 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.39]); Mon, 06 May 2019 08:01:48 +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 --- .gitignore | 2 +- Makefile.am | 2 +- cfg.mk | 4 +- configure.ac | 1 + tests/Makefile.am | 22 +----- tests/qemucapabilitiestest.c | 4 +- tests/testutils.c | 2 +- tests/{ =3D> tools}/.valgrind.supp | 0 tests/tools/Makefile.am | 85 +++++++++++++++++++++ tests/{ =3D> tools}/check-file-access.pl | 0 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 | 0 tests/{ =3D> tools}/qemucapsprobemock.c | 0 tests/{ =3D> tools}/test-wrap-argv.pl | 2 +- 16 files changed, 98 insertions(+), 26 deletions(-) rename tests/{ =3D> tools}/.valgrind.supp (100%) create mode 100644 tests/tools/Makefile.am rename tests/{ =3D> tools}/check-file-access.pl (100%) 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 (100%) 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/Makefile.am b/Makefile.am index eba5916352..875c0fa997 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,7 @@ ## . =20 SUBDIRS =3D . gnulib/lib include/libvirt src tools docs gnulib/tests \ - tests po examples + tests tests/tools po examples =20 XZ_OPT ?=3D -v -T0 export XZ_OPT 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/configure.ac b/configure.ac index fabec815db..893d0db17a 100644 --- a/configure.ac +++ b/configure.ac @@ -925,6 +925,7 @@ AC_CONFIG_FILES([\ include/libvirt/libvirt-common.h \ examples/Makefile \ tests/Makefile \ + tests/tools/Makefile \ tools/Makefile]) AC_OUTPUT =20 diff --git a/tests/Makefile.am b/tests/Makefile.am index 46d94d2236..0f5a5c231e 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,15 @@ 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 + tools/check-file-access.pl \ + tools/file_access_whitelist.txt =20 if WITH_TESTS noinst_PROGRAMS =3D $(test_programs) $(test_helpers) @@ -478,7 +474,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 +599,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.am b/tests/tools/Makefile.am new file mode 100644 index 0000000000..8a34b4a84f --- /dev/null +++ b/tests/tools/Makefile.am @@ -0,0 +1,85 @@ +# vim: filetype=3Dautomake + +AM_CPPFLAGS =3D \ + -I$(top_srcdir)/tests/ \ + -I$(top_builddir) -I$(top_srcdir) \ + -I$(top_builddir)/gnulib/lib -I$(top_srcdir)/gnulib/lib \ + -I$(top_builddir)/include -I$(top_srcdir)/include \ + -I$(top_builddir)/src -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/util \ + -I$(top_srcdir)/src/conf \ + $(NULL) + +WARN_CFLAGS +=3D $(RELAXED_FRAME_LIMIT_CFLAGS) + +AM_CFLAGS =3D \ + -Dabs_builddir=3D"\"$(abs_builddir)\"" \ + -Dabs_top_builddir=3D"\"$(abs_top_builddir)\"" \ + -Dabs_srcdir=3D"\"$(abs_srcdir)\"" \ + -Dabs_top_srcdir=3D"\"$(abs_top_srcdir)\"" \ + $(LIBXML_CFLAGS) \ + $(LIBNL_CFLAGS) \ + $(GNUTLS_CFLAGS) \ + $(SASL_CFLAGS) \ + $(SELINUX_CFLAGS) \ + $(APPARMOR_CFLAGS) \ + $(YAJL_CFLAGS) \ + $(XDR_CFLAGS) \ + $(WARN_CFLAGS) + +AM_LDFLAGS =3D \ + -export-dynamic + +MOCKLIBS_LDFLAGS =3D -module -avoid-version \ + -rpath /evil/libtool/hack/to/force/shared/lib/creation \ + $(MINGW_EXTRA_LDFLAGS) + +GNULIB_LIBS =3D \ + ../../gnulib/lib/libgnu.la + +MOCKLIBS_LIBS =3D \ + $(GNULIB_LIBS) \ + ../../src/libvirt.la + +PROBES_O =3D +if WITH_DTRACE_PROBES +PROBES_O +=3D ../../src/libvirt_probes.lo +endif WITH_DTRACE_PROBES + +LDADDS =3D \ + $(NO_INDIRECT_LDFLAGS) \ + $(PROBES_O) \ + $(GNULIB_LIBS) \ + ../../src/libvirt.la + +test_helpers =3D +test_libraries =3D + +if WITH_QEMU +test_helpers +=3D qemucapsprobe +test_libraries +=3D qemucapsprobemock.la + +qemucapsprobe_SOURCES =3D \ + qemucapsprobe.c \ + ../testutils.h +qemucapsprobe_LDADD =3D \ + ../libqemutestdriver.la $(LDADDS) + +qemucapsprobemock_la_SOURCES =3D \ + qemucapsprobemock.c +qemucapsprobemock_la_LDFLAGS =3D $(MOCKLIBS_LDFLAGS) +qemucapsprobemock_la_LIBADD =3D $(MOCKLIBS_LIBS) +endif WITH_QEMU + + +if WITH_TESTS +noinst_PROGRAMS =3D $(test_helpers) +noinst_LTLIBRARIES =3D $(test_libraries) +else ! WITH_TESTS +check_PROGRAMS =3D $(test_helpers) +check_LTLIBRARIES =3D $(test_libraries) +endif ! WITH_TESTS + +EXTRA_DIST =3D \ + .valgrind.supp \ + oomtrace.pl diff --git a/tests/check-file-access.pl b/tests/tools/check-file-access.pl similarity index 100% rename from tests/check-file-access.pl rename to tests/tools/check-file-access.pl 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 100% rename from tests/qemucapsprobe.c rename to tests/tools/qemucapsprobe.c 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