From nobody Fri Jul 4 17:39:24 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 1541175450053562.2951843230474; Fri, 2 Nov 2018 09:17:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EF031307DAA5; Fri, 2 Nov 2018 16:17:27 +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 B19CC60BE8; Fri, 2 Nov 2018 16:17:27 +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 5968719748; Fri, 2 Nov 2018 16:17:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wA2FqGWf013202 for ; Fri, 2 Nov 2018 11:52:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id B157E600D1; Fri, 2 Nov 2018 15:52:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-64.ams2.redhat.com [10.36.112.64]) by smtp.corp.redhat.com (Postfix) with ESMTP id 863ED600CD; Fri, 2 Nov 2018 15:52:15 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 2 Nov 2018 15:52:09 +0000 Message-Id: <20181102155209.1331-4-berrange@redhat.com> In-Reply-To: <20181102155209.1331-1-berrange@redhat.com> References: <20181102155209.1331-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [tck PATCH 3/3] Allow tests to be listed as positional arguments 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.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 02 Nov 2018 16:17:28 +0000 (UTC) The -t argument accepts the path to a test file or a test directory. It would be useful if shell wildcards could be used to specify test files, but this doesn't work when using optional arguments. By changing the test path(s) to be positional arguments we can easily allow for shell wildcards. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laine Stump --- bin/libvirt-tck | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/bin/libvirt-tck b/bin/libvirt-tck index d5519dd..bd332a4 100644 --- a/bin/libvirt-tck +++ b/bin/libvirt-tck @@ -8,7 +8,7 @@ libvirt-tck - libvirt Technology Compatability Kit =20 =3Dhead1 SYNOPSIS =20 - # libvirt-tck [OPTIONS] + # libvirt-tck [OPTIONS] [TESTS..] =20 Run with default config, probing for URI to use =20 @@ -62,8 +62,15 @@ the default configuration file from C and will allow libvirt to probe for the hypervisor driver to run. If a reliably repeatable test result set is desired, it is recommended to always give an explicit libvirt connection URI -to choose the driver. The following options are available when -running the C command +to choose the driver. + +Any command line arguments that are not parsed as options will +be considered paths to test scripts to invoke. If no paths are +given, all tests under C will be +executed. + +The following options are available when running the C +command =20 =3Dover 4 =20 @@ -98,11 +105,6 @@ networks, storage pools, etc which have a "tck" name pr= efix. User created objects whose name does not start with "tck" will be left untouched. =20 -=3Ditem -t, --testdir PATH - -Specify an alternate directory path in which to find the test -scripts to be run. If omitted, defaults to C - =3Ditem -a, --archive FILE =20 Generate an archive containing all the raw test results. The @@ -144,7 +146,6 @@ my $timer =3D 0; my $archive; my $config =3D catfile($confdir, "default.cfg"); my $format =3D "text"; -my $testdir =3D catdir($datadir, "tests"); =20 if (!GetOptions("verbose" =3D> \$verbose, "debug" =3D> \$debug, @@ -154,7 +155,6 @@ if (!GetOptions("verbose" =3D> \$verbose, "config=3Ds" =3D> \$config, "force" =3D> \$force, "format=3Ds" =3D> \$format, - "testdir=3Ds" =3D> \$testdir, "timer" =3D> \$timer) || $help) { pod2usage(-verbose =3D> $help, -output =3D> $help ? \*STDOUT : \*STDERR, @@ -181,12 +181,19 @@ if ($verbose && $quiet) { -output =3D> \*STDERR); } =20 -unless (-e $testdir) { - print STDERR "$0: test directory '$testdir' does not exist\n"; - exit 2; +my @testdirs =3D @ARGV; +unless (@testdirs) { + push @testdirs, catdir($datadir, "tests"); +} + +foreach (@testdirs) { + unless (-e $_) { + print STDERR "$0: test path '$_' does not exist\n"; + exit 2; + } } =20 -my @newargv =3D ("-r", "--norc", "--merge", $testdir); +my @newargv =3D ("-r", "--norc", "--merge", @testdirs); =20 if ($archive) { push @newargv, "-a", $archive; --=20 2.19.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list