tests: Accommodate c-tap-harness 4.7 95/14295/5
authorMichael Meffie <mmeffie@sinenomine.net>
Tue, 4 Aug 2020 14:34:07 +0000 (10:34 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 21 Aug 2020 02:36:56 +0000 (22:36 -0400)
The SOURCE and BUILD environment variables have been changed to
C_TAP_SOURCE and C_TAP_BUILD in the new version of c-tap-harness.  The
runtests command syntax has changed as well.

Convert all of the old SOURCE and BUILD environment variables to the new
C_TAP_SOURCE and C_TAP_BUILD names.

Add the required -l command line option to specify the test list.

Add the new runtests -v option to run the tests in verbose mode to make
it easier to see which tests failed.

Change-Id: I209a6dc13d6cd1507519234fce1564fc4641e70b
Reviewed-on: https://gerrit.openafs.org/14295
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

16 files changed:
tests/Makefile.in
tests/auth/keys-t.c
tests/auth/writeoldkey-t
tests/bozo/bos-man-t
tests/bucoord/backup-man-t
tests/cmd/command-t.c
tests/common/servers.c
tests/kauth/kas-man-t
tests/opr/softsig-t
tests/ptserver/pt_util-t
tests/ptserver/pts-man-t
tests/rx/perf-t
tests/tests-lib/perl5/mancheck_utils.pm
tests/venus/fs-man-t
tests/volser/vos-man-t
tests/volser/vos-t.c

index 7859028..29559ba 100644 (file)
@@ -6,8 +6,8 @@ abs_top_builddir=@abs_top_builddir@
 include @TOP_OBJDIR@/src/config/Makefile.config
 include @TOP_OBJDIR@/src/config/Makefile.pthread
 
-MODULE_CFLAGS = -DSOURCE='"$(abs_top_srcdir)/tests"' \
-       -DBUILD='"$(abs_top_builddir)/tests"'
+MODULE_CFLAGS = -DC_TAP_SOURCE='"$(abs_top_srcdir)/tests"' \
+       -DC_TAP_BUILD='"$(abs_top_builddir)/tests"'
 
 SUBDIRS = tap common auth util cmd volser opr rx
 
@@ -23,7 +23,7 @@ runtests.o: $(srcdir)/runtests.c
 check test tests: runtests
        @for A in $(SUBDIRS); do cd $$A && $(MAKE) $@ && cd .. || exit 1; done
        MAKECHECK=1 $(abs_top_srcdir)/tests/libwrap @TOP_OBJDIR@/lib \
-           ./runtests $(abs_top_srcdir)/tests/TESTS
+           ./runtests -v -l $(abs_top_srcdir)/tests/TESTS
 
 install:
 
index 789b49b..f0556ce 100644 (file)
@@ -128,11 +128,11 @@ int main(int argc, char **argv)
        goto out;
 
     /* Work out the path to our KeyFile. If the test harness hasn't set
-     * the SOURCE environment variable, then assume it is in our CWD */
-    if (getenv("SOURCE") == NULL) {
+     * the C_TAP_SOURCE environment variable, then assume it is in our CWD */
+    if (getenv("C_TAP_SOURCE") == NULL) {
        keyfilesrc = strdup("KeyFile");
     } else {
-       if (asprintf(&keyfilesrc, "%s/auth/KeyFile", getenv("SOURCE")) == -1)
+       if (asprintf(&keyfilesrc, "%s/auth/KeyFile", getenv("C_TAP_SOURCE")) == -1)
            goto out;
     }
 
index 1238dce..3240212 100755 (executable)
@@ -20,16 +20,16 @@ if (!defined(gethostbyname(hostname()))) {
 plan tests => 1;
 
 my $cmd;
-if (defined($ENV{BUILD})) {
-    $cmd = $ENV{BUILD} . "/auth/writekeyfile";
+if (defined($ENV{C_TAP_BUILD})) {
+    $cmd = $ENV{C_TAP_BUILD} . "/auth/writekeyfile";
 } else {
     $cmd = $Bin . "/writekeyfile";
 }
 $cmd = abs_path($cmd);
 
 my $keyfile;
-if (defined($ENV{SOURCE})) {
-    $keyfile = $ENV{SOURCE} . "/auth/KeyFile.short";
+if (defined($ENV{C_TAP_SOURCE})) {
+    $keyfile = $ENV{C_TAP_SOURCE} . "/auth/KeyFile.short";
 } else {
     $keyfile = $Bin . "/KeyFile.short";
 }
index cfdc809..40758e8 100755 (executable)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use lib $ENV{SOURCE} . "/tests-lib/perl5";
+use lib $ENV{C_TAP_SOURCE} . "/tests-lib/perl5";
 use mancheck_utils;
 
 run_manpage_tests("src/bozo", "bos");
index 2366e79..95343d7 100755 (executable)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use lib $ENV{SOURCE} . "/tests-lib/perl5";
+use lib $ENV{C_TAP_SOURCE} . "/tests-lib/perl5";
 use mancheck_utils;
 
 run_manpage_tests("src/bucoord", "backup");
index 796ff22..71efd39 100644 (file)
@@ -360,10 +360,10 @@ main(int argc, char **argv)
     cmd_FreeArgv(tv);
 
     /* Now, try adding a configuration file into the mix */
-    if (getenv("SOURCE") == NULL)
+    if (getenv("C_TAP_SOURCE") == NULL)
        path = strdup("test1.conf");
     else {
-       if (asprintf(&path, "%s/cmd/test1.conf", getenv("SOURCE")) < 0)
+       if (asprintf(&path, "%s/cmd/test1.conf", getenv("C_TAP_SOURCE")) < 0)
            path = NULL;
     }
     if (path != NULL) {
index 70dd366..716b0ca 100644 (file)
@@ -33,7 +33,7 @@ afstest_StartVLServer(char *dirname, pid_t *serverPid)
        char *binPath, *logPath, *dbPath, *build;
 
        /* Child */
-       build = getenv("BUILD");
+       build = getenv("C_TAP_BUILD");
 
        if (build == NULL)
            build = "..";
index a877b73..bb78302 100755 (executable)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use lib $ENV{SOURCE} . "/tests-lib/perl5";
+use lib $ENV{C_TAP_SOURCE} . "/tests-lib/perl5";
 use mancheck_utils;
 
 run_manpage_tests("src/kauth", "kas");
index 2932edc..d750d98 100755 (executable)
@@ -36,10 +36,10 @@ use FindBin qw($Bin);
 my $softsig_helper;
 
 # Our softsig helper should be in $TOP_OBJDIR/tests/opr. To calculate that
-# path, use the BUILD env var if the test harness has set it; otherwise, our
-# next best guess is that it's in the same dir as this script.
-if (defined($ENV{BUILD})) {
-    $softsig_helper = $ENV{BUILD} . "/opr/softsig-helper";
+# path, use the C_TAP_BUILD env var if the test harness has set it; otherwise,
+# our next best guess is that it's in the same dir as this script.
+if (defined($ENV{C_TAP_BUILD})) {
+    $softsig_helper = $ENV{C_TAP_BUILD} . "/opr/softsig-helper";
 } else {
     $softsig_helper = $Bin . "/softsig-helper";
 }
index 723b858..553b2be 100755 (executable)
@@ -6,7 +6,7 @@ use warnings;
 use File::Basename;
 use Test::More tests=>2;
 
-my $builddir = $ENV{BUILD};
+my $builddir = $ENV{C_TAP_BUILD};
 if (!$builddir) {
   $builddir = dirname($0)."/..";
 }
index 4bfabee..0376f02 100755 (executable)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use lib $ENV{SOURCE} . "/tests-lib/perl5";
+use lib $ENV{C_TAP_SOURCE} . "/tests-lib/perl5";
 use mancheck_utils;
 
 run_manpage_tests("src/ptserver", "pts");
index 19ec85a..a6ce387 100755 (executable)
@@ -7,7 +7,7 @@ use Test::More tests=>4;
 use POSIX qw(:sys_wait_h :signal_h);
 
 my $port = 4000;
-my $build = $ENV{BUILD};
+my $build = $ENV{C_TAP_BUILD};
 $build = ".." if (!defined($build));
 my $rxperf = $build."/../src/tools/rxperf/rxperf";
 
index 90a9e0a..62e1693 100644 (file)
@@ -99,12 +99,12 @@ sub test_command_man_pages {
 sub run_manpage_tests($$) {
     my ($subdir, $command) = @_;
 
-    # When run from 'runtests', our cwd will be TOP_OBJDIR/tests. $SOURCE is
-    # set to TOP_SRCDIR/tests, and $BUILD is set to TOP_OBJDIR/tests. We want
-    # the top-level src and obj dirs, in order to find the relevant binaries
-    # and manpages.
-    my $srcdir = $ENV{SOURCE} . "/..";
-    my $objdir = $ENV{BUILD} . "/..";
+    # When run from 'runtests', our cwd will be TOP_OBJDIR/tests. $C_TAP_SOURCE
+    # is set to TOP_SRCDIR/tests, and $C_TAP_BUILD is set to TOP_OBJDIR/tests.
+    # We want the top-level src and obj dirs, in order to find the relevant
+    # binaries and manpages.
+    my $srcdir = $ENV{C_TAP_SOURCE} . "/..";
+    my $objdir = $ENV{C_TAP_BUILD} . "/..";
 
     my @sub_commands = lookup_sub_commands("$objdir/$subdir", $command);
     die("No subcommands found in $objdir/$subdir/$command?") unless(@sub_commands);
index 952b6bb..219a33a 100755 (executable)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use lib $ENV{SOURCE} . "/tests-lib/perl5";
+use lib $ENV{C_TAP_SOURCE} . "/tests-lib/perl5";
 use mancheck_utils;
 
 run_manpage_tests("src/venus", "fs");
index 8bd7259..af0fb30 100755 (executable)
@@ -2,7 +2,7 @@
 
 use strict;
 use warnings;
-use lib $ENV{SOURCE} . "/tests-lib/perl5";
+use lib $ENV{C_TAP_SOURCE} . "/tests-lib/perl5";
 use mancheck_utils;
 
 run_manpage_tests("src/volser", "vos");
index 758535e..05ec8fd 100644 (file)
@@ -69,7 +69,7 @@ TestListAddrs(struct ubik_client *client, char *dirname)
        close(outpipe[0]);
        close(outpipe[1]);
 
-       build = getenv("BUILD");
+       build = getenv("C_TAP_BUILD");
        if (build == NULL)
            build = "..";