diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-04-04 11:46:47 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-04-04 11:46:47 -0400 |
commit | c470944b30a677c4d616cee1a6dbd58d2061c694 (patch) | |
tree | 83d65b5e821bdf8a5d00564d576c377fee5b2c33 /devtools | |
parent | d9060af36a6cd6cfa972a3f2c7387e2f99d724a8 (diff) | |
download | gpsd-c470944b30a677c4d616cee1a6dbd58d2061c694.tar.gz |
Added -q option for testing.
Diffstat (limited to 'devtools')
-rwxr-xr-x | devtools/flocktest | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/devtools/flocktest b/devtools/flocktest index c92bd5ad..c4b740d9 100755 --- a/devtools/flocktest +++ b/devtools/flocktest @@ -3,7 +3,7 @@ """\ flocktest - shepherd script for the GPSD test flock -usage: flocktest [-c] [-d subdir] [-k key] -v [-x exclude] [-?] +usage: flocktest [-c] [-q] [-d subdir] [-k key] -v [-x exclude] [-?] The -? makes flocktest prints this help and exits. @@ -15,6 +15,8 @@ Otherwise, the remote flockdriver script is executed on each machine. The -d option passes it a name for the remote test subdirectory +The -q option supprssed CIA notifications + The -v option shows all ssh commands issued and runs flockdriver with -x set. The -x option specifies a comma-separated list of items that are @@ -36,10 +38,12 @@ flockdriver = ''' generator="http://gpsd.berlios.de/flockdriver" -while getopts d opt +quiet=no +while getopts dq opt do case $opt in d) subdir=$2; shift; shift ;; + q) quiet=yes; shift ;; esac done @@ -101,7 +105,9 @@ refname=${refname##refs/heads/} gitver=$(git --version) gitver=${gitver##* } -${sendmail} << EOM +if [ $quiet = no ] +then + ${sendmail} << EOM Message-ID: <${merged}.${subdir}.blip@%(project)s> From: ${from} To: ${to} @@ -128,6 +134,7 @@ Subject: DeliverXML </body> </message> EOM +fi exit $status # End. @@ -178,6 +185,7 @@ class TestSite: "Copy flockdriver to the remote site and run it." self.starttime = time.time() status = 1 + # FIXME: subdir and cianotify are globals ofp = os.popen("ssh -p %s %s 'cat >flockdriver.%s'" \ % (self.config.get("port", "22"), self.me, subdir), "w") @@ -186,6 +194,8 @@ class TestSite: print >>sys.stderr, "flocktest: flockdriver copy failed" else: command = "sh flockdriver.%s -d %s" % (subdir, subdir,) + if not cianotify: + command += " -q" if self.verbose > 1: command = "sh -x " + command status = self.do_remote(command) @@ -220,7 +230,7 @@ class TestFlock: else: print "== %s test succeeded in %.2f seconds ==" % (site.fqdn, site.elapsed) elapsed = time.time() - starttime - print "== %d tests completed in %.2f seconds: %d failed ==" % (len(slaves), site.elapsed, failed) + print "== %d tests completed in %.2f seconds: %d failed ==" % (len(slaves), elapsed, failed) def exclude(self, exclusions): "Delete matching sites." self.sitelist = filter(lambda x: x.fqdn not in exclusions and x.config["arch"] not in exclusions, self.sitelist) @@ -235,7 +245,7 @@ class TestFlock: if __name__ == '__main__': try: - (options, arguments) = getopt.getopt(sys.argv[1:], "cdk:vx:?") + (options, arguments) = getopt.getopt(sys.argv[1:], "cdk:qvx:?") except getopt.GetoptError, msg: print "flocktest: " + str(msg) raise SystemExit, 1 @@ -245,6 +255,7 @@ if __name__ == '__main__': key = None verbose = False dumpconf = False + cianotify = True for (switch, val) in options: if switch == '-c': dumpconf = True @@ -252,8 +263,8 @@ if __name__ == '__main__': subdir = val elif switch == '-k': key = val - elif switch == '-N': - execute = False + elif switch == '-q': + cianotify = False elif switch == '-v': verbose = True elif switch == '-x': |