From b9920d4d7df7ded963d29fdede1919c7d36b07de Mon Sep 17 00:00:00 2001 From: Fons Rademakers <Fons.Rademakers@cern.ch> Date: Thu, 10 Jan 2013 16:57:35 +0000 Subject: [PATCH] consistently rename ptest to xpdtest. git-svn-id: http://root.cern.ch/svn/root/trunk@48265 27541ba8-7e3a-0410-8455-c3a389f83636 --- configure | 2 +- main/Module.mk | 38 +++++++++++------------ main/src/{ptest.cxx => xpdtest.cxx} | 48 ++++++++++++++--------------- man/man1/{ptest.1 => xpdtest.1} | 32 +++++++++---------- 4 files changed, 60 insertions(+), 60 deletions(-) rename main/src/{ptest.cxx => xpdtest.cxx} (91%) rename man/man1/{ptest.1 => xpdtest.1} (93%) diff --git a/configure b/configure index bf8ba1299a5..a2d9a2dc1a4 100755 --- a/configure +++ b/configure @@ -6349,7 +6349,7 @@ rm -f lib/libRXML* bin/libRXML* etc/system.rootmap \ lib/libProofGui* bin/libProofGui* \ lib/libMySQL* bin/libMySQL* lib/libGedOld* bin/libGedOld* \ lib/libSQL.* bin/libSQL.* \ - lib/libASPluginGS.* bin/g2rootold* bin/ptest \ + lib/libASPluginGS.* bin/g2rootold* bin/ptest main/src/ptest.* \ math/mathcore/src/G__MathCore32.* \ tmva/src/G__TMVA.* graf3d/eve/src/G__Eve.* \ xrootd/src/headers.d include/Xpm.h \ diff --git a/main/Module.mk b/main/Module.mk index 92cbf1e4e75..1204433ec06 100644 --- a/main/Module.mk +++ b/main/Module.mk @@ -45,19 +45,19 @@ PROOFSERVEXE := PROOFSERVSH := endif -##### ptest ##### -PTESTS := $(MODDIRS)/ptest.cxx -PTESTO := $(call stripsrc,$(PTESTS:.cxx=.o)) -PTESTDEP := $(PTESTO:.o=.d) +##### xpdtest ##### +XPDTESTS := $(MODDIRS)/xpdtest.cxx +XPDTESTO := $(call stripsrc,$(XPDTESTS:.cxx=.o)) +XPDTESTDEP := $(XPDTESTO:.o=.d) ifneq ($(PLATFORM),win32) -PTESTEXE := bin/xpdtest +XPDTESTEXE := bin/xpdtest endif ifeq ($(PROOFLIB),) -PTESTEXE := +XPDTESTEXE := endif -PTESTLIBS := -lProof -lTree -lHist -lRIO -lNet -lThread -lMatrix -lMathCore -PTESTLIBSDEP = $(IOLIB) $(TREELIB) $(NETLIB) $(HISTLIB) $(PROOFLIB) \ - $(THREADLIB) $(MATRIXLIB) $(MATHCORELIB) +XPDTESTLIBS := -lProof -lTree -lHist -lRIO -lNet -lThread -lMatrix -lMathCore +XPDTESTLIBSDEP = $(IOLIB) $(TREELIB) $(NETLIB) $(HISTLIB) $(PROOFLIB) \ + $(THREADLIB) $(MATRIXLIB) $(MATHCORELIB) ##### roots.exe ##### ROOTSEXES := $(MODDIRS)/roots.cxx @@ -112,13 +112,13 @@ endif # used in the main Makefile ALLEXECS += $(ROOTEXE) $(ROOTNEXE) $(PROOFSERVEXE) $(PROOFSERVSH) \ - $(PTESTEXE) $(HADD) $(SSH2RPD) $(ROOTSEXE) $(ROOTSSH) + $(XPDTESTEXE) $(HADD) $(SSH2RPD) $(ROOTSEXE) $(ROOTSSH) ifneq ($(F77),) ALLEXECS += $(H2ROOT) $(G2ROOT) endif # include all dependency files -INCLUDEFILES += $(ROOTEXEDEP) $(PROOFSERVDEP) $(PTESTDEP) $(HADDDEP) \ +INCLUDEFILES += $(ROOTEXEDEP) $(PROOFSERVDEP) $(XPDTESTDEP) $(HADDDEP) \ $(H2ROOTDEP) $(SSH2RPDDEP) $(ROOTSEXEDEP) ##### local rules ##### @@ -143,9 +143,9 @@ $(PROOFSERVSH): $(call stripsrc,$(MAINDIRS)/proofserv.sh) @cp $< $@ @chmod 0755 $@ -$(PTESTEXE): $(PTESTO) $(BOOTLIBSDEP) $(PTESTLIBSDEP) - $(LD) $(LDFLAGS) -o $@ $(PTESTO) \ - $(RPATH) $(BOOTLIBS) $(PTESTLIBS) $(SYSLIBS) +$(XPDTESTEXE): $(XPDTESTO) $(BOOTLIBSDEP) $(XPDTESTLIBSDEP) + $(LD) $(LDFLAGS) -o $@ $(XPDTESTO) \ + $(RPATH) $(BOOTLIBS) $(XPDTESTLIBS) $(SYSLIBS) $(ROOTSEXE): $(ROOTSEXEO) $(BOOTLIBSDEP) $(LD) $(LDFLAGS) -o $@ $(ROOTSEXEO) \ @@ -176,22 +176,22 @@ $(G2ROOT): $(G2ROOTO) $(ORDER_) $(MINICERNLIB) ifneq ($(F77),) all-$(MODNAME): $(ROOTEXE) $(ROOTNEXE) $(PROOFSERVEXE) $(PROOFSERVSH) \ - $(PTESTEXE) $(HADD) $(SSH2RPD) $(H2ROOT) $(G2ROOT) \ + $(XPDTESTEXE) $(HADD) $(SSH2RPD) $(H2ROOT) $(G2ROOT) \ $(ROOTSEXE) $(ROOTSSH) else all-$(MODNAME): $(ROOTEXE) $(ROOTNEXE) $(PROOFSERVEXE) $(PROOFSERVSH) \ - $(PTESTEXE) $(HADD) $(SSH2RPD) $(ROOTSEXE) $(ROOTSSH) + $(XPDTESTEXE) $(HADD) $(SSH2RPD) $(ROOTSEXE) $(ROOTSSH) endif clean-$(MODNAME): - @rm -f $(ROOTEXEO) $(PROOFSERVO) $(PTESTO) $(HADDO) $(H2ROOTO) \ - $(G2ROOTO) $(SSH2RPDO) $(ROOTSEXEO) + @rm -f $(ROOTEXEO) $(PROOFSERVO) $(XPDTESTO) $(HADDO) \ + $(H2ROOTO) $(G2ROOTO) $(SSH2RPDO) $(ROOTSEXEO) clean:: clean-$(MODNAME) distclean-$(MODNAME): clean-$(MODNAME) @rm -f $(ROOTEXEDEP) $(ROOTEXE) $(ROOTNEXE) $(PROOFSERVDEP) \ - $(PROOFSERVEXE) $(PROOFSERVSH) $(PTESTDEP) $(PTESTEXE) \ + $(PROOFSERVEXE) $(PROOFSERVSH) $(XPDTESTDEP) $(XPDTESTEXE) \ $(HADDDEP) $(HADD) $(H2ROOTDEP) $(H2ROOT) $(G2ROOT) \ $(SSH2RPDDEP) $(SSH2RPD) $(ROOTSEXEDEP) $(ROOTSEXE) \ $(ROOTSSH) diff --git a/main/src/ptest.cxx b/main/src/xpdtest.cxx similarity index 91% rename from main/src/ptest.cxx rename to main/src/xpdtest.cxx index 5a0431986fd..cb928a90f60 100644 --- a/main/src/ptest.cxx +++ b/main/src/xpdtest.cxx @@ -11,7 +11,7 @@ ////////////////////////////////////////////////////////////////////////// // // -// PTest // +// xpdtest // // // // Program used to test existence and status of a proof daemon // // // @@ -68,7 +68,7 @@ int main(int argc, char **argv) { // PROOF daemon test program. // Syntax - // ptest <url> <sandbox_dir> <time_span> + // xpdtest <url> <sandbox_dir> <time_span> // // <url> URL to test; default 'localhost:1093' // <sandbox_dir> directory with users sandboxes; used to find out @@ -85,7 +85,7 @@ int main(int argc, char **argv) bool keep = 0; int rc = parse_args(argc, argv, url, sboxdir, span, test, logfile, keep); if (rc < 0) { - fprintf(stderr, "ptest: parse_args failure\n"); + fprintf(stderr, "xpdtest: parse_args failure\n"); gSystem->Exit(1); } else if (rc > 0) { gSystem->Exit(0); @@ -102,11 +102,11 @@ int main(int argc, char **argv) // Check sandbox dir FileStat_t fst; if (gSystem->GetPathInfo(sboxdir, fst) != 0) { - fprintf(stderr, "ptest: stat failure for '%s'\n", sboxdir.Data()); + fprintf(stderr, "xpdtest: stat failure for '%s'\n", sboxdir.Data()); rc = 1; } if (rc == 0 && !R_ISDIR(fst.fMode)) { - fprintf(stderr, "ptest: '%s' is not a directory\n", sboxdir.Data()); + fprintf(stderr, "xpdtest: '%s' is not a directory\n", sboxdir.Data()); rc = 1; } @@ -128,7 +128,7 @@ int main(int argc, char **argv) // Do ping if (rc == 0) if ((rc = xpd_ping(u.GetHost(), u.GetPort())) != 0) - fprintf(stderr, "ptest: failure pinging '%s'\n", url.Data()); + fprintf(stderr, "xpdtest: failure pinging '%s'\n", url.Data()); if (test > 0) { // Do TProof::Open in "masteronly" mode @@ -137,7 +137,7 @@ int main(int argc, char **argv) rc = proof_open(u.GetUrl()); if (!logfile.IsNull()) gSystem->RedirectOutput(logfile, "a", &redirH); if (rc != 0) - fprintf(stderr, "ptest: TProof::Open failure for default user '%s'\n", u.GetUrl()); + fprintf(stderr, "xpdtest: TProof::Open failure for default user '%s'\n", u.GetUrl()); } if (test > 1) { @@ -155,7 +155,7 @@ int main(int argc, char **argv) if (span > 0) { dent.Form("%s/%s", sboxdir.Data(), ent); if (gSystem->GetPathInfo(dent, st) != 0) { - fprintf(stderr, "ptest: stat failure for '%s'\n", dent.Data()); + fprintf(stderr, "xpdtest: stat failure for '%s'\n", dent.Data()); rc = 1; break; } @@ -167,7 +167,7 @@ int main(int argc, char **argv) rc = proof_open(u.GetUrl()); if (!logfile.IsNull()) gSystem->RedirectOutput(logfile, "a", &redirH); if (rc != 0) { - fprintf(stderr, "ptest: failure scanning sandbox dir '%s'\n", sboxdir.Data()); + fprintf(stderr, "xpdtest: failure scanning sandbox dir '%s'\n", sboxdir.Data()); break; } } @@ -200,26 +200,26 @@ int parse_args(int argc, char **argv, keep = 0; // Check environment settings first - if (getenv("PTEST_URL")) { - url = getenv("PTEST_URL"); + if (getenv("XPDTEST_URL")) { + url = getenv("XPDTEST_URL"); } - if (getenv("PTEST_SBOXDIR")) { - sboxdir = getenv("PTEST_SBOXDIR"); + if (getenv("XPDTEST_SBOXDIR")) { + sboxdir = getenv("XPDTEST_SBOXDIR"); } - if (getenv("PTEST_TIMESPAN")) { + if (getenv("XPDTEST_TIMESPAN")) { errno = 0; - long xspan = strtol(getenv("PTEST_TIMESPAN"), 0, 10); + long xspan = strtol(getenv("XPDTEST_TIMESPAN"), 0, 10); if (errno == 0) span = (time_t) xspan; } - if (getenv("PTEST_TEST")) { + if (getenv("XPDTEST_TEST")) { errno = 0; - long xtest = strtol(getenv("PTEST_TEST"), 0, 10); - if (errno == 0 && xtest >= 0 && xtest <= 2) sscanf(getenv("PTEST_TEST"), "%d", &test); + long xtest = strtol(getenv("XPDTEST_TEST"), 0, 10); + if (errno == 0 && xtest >= 0 && xtest <= 2) sscanf(getenv("XPDTEST_TEST"), "%d", &test); } - if (getenv("PTEST_LOGFILE")) { - logfile = getenv("PTEST_LOGFILE"); + if (getenv("XPDTEST_LOGFILE")) { + logfile = getenv("XPDTEST_LOGFILE"); } - if (getenv("PTEST_KEEP")) { + if (getenv("XPDTEST_KEEP")) { keep = 1; } @@ -301,10 +301,10 @@ void printhelp() { // Help function fprintf(stderr, "\n"); - fprintf(stderr, " ptest: test xproofd service on (remote) host\n"); + fprintf(stderr, " xpdtest: test xproofd service on (remote) host\n"); fprintf(stderr, "\n"); fprintf(stderr, " Syntax:\n"); - fprintf(stderr, " ptest [-u url] [-t test] [-d sbdir] [-s span] [-l logfile] [-k] [-h|--help]\n"); + fprintf(stderr, " xpdtest [-u url] [-t test] [-d sbdir] [-s span] [-l logfile] [-k] [-h|--help]\n"); fprintf(stderr, "\n"); fprintf(stderr, " url: URL where the xproofd under test responds [localhost:1093]\n"); fprintf(stderr, " test: type of test [0]\n"); @@ -333,7 +333,7 @@ int proof_open(const char *master) // Return 0 on success, 1 on failure int rc = 0; RedirectHandle_t rh; - TString popenfile = TString::Format("%s/ptest_popen_file", gSystem->TempDirectory()); + TString popenfile = TString::Format("%s/xpdtest_popen_file", gSystem->TempDirectory()); gSystem->RedirectOutput(popenfile, "w", &rh); TProof *p = TProof::Open(master, "masteronly"); gSystem->RedirectOutput(0, 0, &rh); diff --git a/man/man1/ptest.1 b/man/man1/xpdtest.1 similarity index 93% rename from man/man1/ptest.1 rename to man/man1/xpdtest.1 index 87a6a43fd25..cbdc1b01276 100644 --- a/man/man1/ptest.1 +++ b/man/man1/xpdtest.1 @@ -1,27 +1,27 @@ .\" .\" $Id: root-config.1,v 1.4 2005/03/21 21:42:21 rdm Exp $ .\" -.TH PTEST 1 "Version 5" "ROOT" +.TH XPDTEST 1 "Version 5" "ROOT" .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection .\" other parms are allowed: see man(7), man(1) .SH NAME -ptest \- xproofd test utility +xpdtest \- xproofd test utility .SH SYNOPSIS -.B ptest +.B xpdtest .I "[options]" .SH "DESCRIPTION" This manual page documents the -.BR ptest +.BR xpdtest program, an utility whose purpose is to test the status of an xproofd daemon running on the local machine. The target is to run -.B ptest +.B xpdtest inside a monitor infrastructure, for example .B monit (see .UR http://mmonit.com/monit/ \fIhttp://mmonit.com/monit/\fP ), capable to take some decisions and to do some actions following the result of -.B ptest. +.B xpdtest. .SH OPTIONS @@ -36,45 +36,45 @@ type of test to be run: 2 ping the daemon and check connection for the default user and all recent users The default user is the one specified in the URL (e.g. 'user' for user@localhost); if no explicit specification is found in the URL, the user under which -.B ptest +.B xpdtest is run is used; it can be also passed via the environment variable -.B PTEST_TEST. +.B XPDTEST_TEST. .TP .B \-u\fP \fR<url>\fP URL where the xproofd under test responds; it can be also passed via the environment variable -.B PTEST_URL +.B XPDTEST_URL (default is 'localhost:1093'). .TP .B \-d\fP \fR<sbdir>\fP sandbox directory used to find out the users of the facility when test is 2; it can be also passed via the environment variable -.B PTEST_SBOXDIR +.B XPDTEST_SBOXDIR (default is '/tmp/proofbox'). .TP .B \-s\fP \fR<span>\fP define the time interval, in minutes, to define 'recent' users when test is 2: only users who connected within this interval are checked; use -1 for infinite; it can be also passed via the environment variable -.B PTEST_TIMESPAN +.B XPDTEST_TIMESPAN (default is -1). .TP .B \-l\fP \fR<logfile>\fP log file if not screen; deleted if the required test fails unless '-k' is specified (see below);it can be also passed via the environment variable -.B PTEST_LOGFILE. +.B XPDTEST_LOGFILE. .TP .B \-k keep log file at path given via '-l' in all cases; it can be also passed via the environment variable -.B PTEST_KEEP +.B XPDTEST_KEEP (default is 'no keep'). .SH RETURN -.B ptest +.B xpdtest returns 0 on success and 1 in case of test failure. Errors are printed on the screen or saved into the specified log file. .SH FILES The file -.B ptest_popen_file +.B xpdtest_popen_file in the temporary directory (typically /tmp) is used to parse the output of .B TProof::Open(). The file is overwritten by each new attempt; after a run of -.B ptest +.B xpdtest it contains the result of the last session open attempt. .SH NOTES -- GitLab