X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=installcheck%2Fpp-scripts.pl;h=311e6331a9fcf326e15265242be581dfacdff5e9;hb=e676d2a937a46194f0bd97a130ae1a4138e8b4e9;hp=c38550a11ecfddbd46a0ecaf0c7446ad669ed193;hpb=79cdc4b6ea8848b21ba4a0e7d2fd3bc401e0bebe;p=debian%2Famanda diff --git a/installcheck/pp-scripts.pl b/installcheck/pp-scripts.pl index c38550a..311e633 100644 --- a/installcheck/pp-scripts.pl +++ b/installcheck/pp-scripts.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2008,2009 Zmanda, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 as published @@ -13,13 +13,15 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Contact information: Zmanda Inc, 465 S Mathlida Ave, Suite 300 +# Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com -use Test::More tests => 8; +use Test::More tests => 10; use lib "@amperldir@"; use Cwd qw(abs_path getcwd); +use Installcheck; +use Installcheck::Dumpcache; use Installcheck::Config; use Installcheck::Run qw(run run_err $diskname amdump_diag); use Amanda::Config qw( :init ); @@ -31,7 +33,7 @@ my $testconf; # Run amdump with client- and server-side scripts -my $templog = $Amanda::Paths::AMANDA_TMPDIR . "/check-script." . $$; +my $templog = $Installcheck::TMP . "/check-script." . $$; sub verify_log { my $msg = shift; @@ -47,7 +49,9 @@ sub verify_log { my $linenum = 1; foreach $exp (@exp) { + chomp $exp; $got = <$logfile>; + chomp $got; if (!$got) { fail($msg); diag(" Line: $linenum"); @@ -56,7 +60,7 @@ sub verify_log { diag($exp); return; } - chomp $got; + $got =~ s/ *$//g; if ($got ne $exp) { fail($msg); diag(" Line: $linenum"); @@ -81,7 +85,7 @@ sub verify_log { # check script on client $testconf = Installcheck::Run::setup(); -$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); +$testconf->add_param('autolabel', '"TESTCONF%%" empty volume_error'); $testconf->add_dle(<add_param('label_new_tapes', '"TESTCONF%%"'); +$testconf->add_param('autolabel', '"TESTCONF%%" empty volume_error'); $testconf->add_dle(<add_dle(<add_param('autolabel', '"TESTCONF%%" empty volume_error'); + +$testconf->add_dle(<write(); + +unlink $templog; +ok(run('amcheck', '-c', 'TESTCONF'), "amcheck runs successfully for ordered scripts."); + +verify_log("amcheck invokes script in correct order", + "check TESTCONF pre-host-amcheck client localhost diskname2 $diskname 40", + "check TESTCONF pre-host-amcheck client localhost diskname2 $diskname 50", + "check TESTCONF pre-host-amcheck client localhost diskname2 $diskname 60", ); + unlink $templog; Installcheck::Run::cleanup();