#!/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");