testRexec #2

  • //
  • guest/
  • richard_geiger/
  • p4bench/
  • testRexec
  • View
  • Commits
  • Open Download .zip Download (1 KB)
#!/usr/local/bin/perl

#
#   Copyright (c) 1996 Network Appliance, Inc.
#
#   You may distribute under the terms of the Artistic License, as
#   specified in the README file included in the ttt distribution.
#

# $Id: //depot/tools/main/p4bench/testRexec#1 $


sub opts
{
  &ttt_add_opt("onhost", "[a-z-]+", $myhostname, "host to run \\\$oncmd on");
  &ttt_add_opt("oncmd", "^", "date", "command to run on \\\$onhost");
  &ttt_add_opt("user", "^", "$user", "user to run as on \\\$onhost");
  &ttt_add_opt("stimeo", ".", "1", "short timeout value for &ttt_read_agents()");
  &ttt_add_opt("ltimeo", ".", "10", "long timeout value for &ttt_read_agents()");
}

sub prereqchk { 1; }

##### Begin ttt standard preamble - do not change this code! #####

$UNIX = 1;
sub dirname
{ local($dir) = @_; $dir =~ s%^$%.%; $dir = "$dir/";
  if ($dir =~ m"^/[^/]*//*$") { return "/"; }
  if ($dir =~ m"^.*[^/]//*[^/][^/]*//*$")
    { $dir =~ s"^(.*[^/])//*[^/][^/]*//*$"$1"; { return $dir; } } #" [for cpp]
  return "."; }
$ttt_here = `/bin/pwd`; chop $ttt_here; chdir &dirname($0);
$tttroot = `/bin/pwd`; chop $tttroot; chdir $ttt_here;
require "$tttroot/tttLib.pl";

##### End ttt standard preamble - do not change the above code! #####

$rbits = "";

($status, $output) = &ttt_rexec($onhost, $oncmd, undef, $stimeo, undef, undef, undef, $user, $ltimeo);

&ttt_msg("$oncmd output <$output>\n");

$signal = $status % 255;
$status = $status >> 8;

&ttt_msg("$oncmd exited with signal <$signal>, status <$status>\n");

&ttt_exit("pass");
# Change User Description Committed
#2 830 Richard Geiger These changes allow it to work locally, and general more portable
#1 799 Richard Geiger The first version of "p4bench", scripts used to implement a crude
Perforce benchmarking system, as mentioned in

  http://maillist.perforce.com/pipermail/perforce-user/2001-February/005288.html

Beware, it's not pretty and there's no documentation, but it's a starting
point for bigger and better things.