X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=installcheck%2Famcheckdump.pl;h=21fbdd501bbb445177f7e22ae58a10cc05218390;hb=b116e9366c7b2ea2c2eb53b0a13df4090e176235;hp=65919111ae49f191c7ee95402b78af17e8ae0c3d;hpb=2627875b7d18858bc1f9f7652811e4d8c15a23eb;p=debian%2Famanda diff --git a/installcheck/amcheckdump.pl b/installcheck/amcheckdump.pl index 6591911..21fbdd5 100644 --- a/installcheck/amcheckdump.pl +++ b/installcheck/amcheckdump.pl @@ -1,4 +1,4 @@ -# Copyright (c) 2005-2008 Zmanda Inc. All Rights Reserved. +# Copyright (c) 2007, 2008, 2010 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,16 @@ # 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 => 9; +use strict; +use warnings; use lib "@amperldir@"; use Installcheck::Config; +use Installcheck::Dumpcache; use Installcheck::Run qw(run run_get run_err $diskname); use Amanda::Paths; @@ -40,9 +43,6 @@ like(run_err('amcheckdump', 'this-probably-doesnt-exist'), qr(could not open con # Now use a config with a vtape and without usetimestamps $testconf = Installcheck::Run::setup(); -$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); -$testconf->add_param('usetimestamps', 'no'); -$testconf->add_dle("localhost $diskname installcheck-test"); $testconf->write(); ok(run('amcheckdump', 'TESTCONF'), @@ -50,8 +50,7 @@ ok(run('amcheckdump', 'TESTCONF'), like($Installcheck::Run::stdout, qr(could not find)i, "..but finds no dumps."); -BAIL_OUT("amdump failed") - unless run('amdump', 'TESTCONF'); +Installcheck::Dumpcache::load("notimestamps"); like(run_get('amcheckdump', 'TESTCONF'), qr(Validating), "amcheckdump succeeds, claims to validate something (usetimestamps=no)"); @@ -63,16 +62,9 @@ like(run_get('amcheckdump', 'TESTCONF', '-oorg=installcheck'), qr(Validating), "amcheckdump accepts '-o' options on the command line"); ## -# And a config with usetimestamps enabled +# Try with usetimestamps enabled -$testconf = Installcheck::Run::setup(); -$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); -$testconf->add_param('usetimestamps', 'yes'); -$testconf->add_dle("localhost $diskname installcheck-test"); -$testconf->write(); - -BAIL_OUT("amdump failed") - unless run('amdump', 'TESTCONF'); +Installcheck::Dumpcache::load("basic"); like(run_get('amcheckdump', 'TESTCONF'), qr(Validating), "amcheckdump succeeds, claims to validate something (usetimestamps=yes)"); @@ -82,7 +74,7 @@ like(run_get('amcheckdump', 'TESTCONF'), qr(Validating), my $vtape1 = Installcheck::Run::vtape_dir(1); opendir(my $vtape_dir, $vtape1) || die "can't opendir $vtape1: $!"; -@dump1 = grep { /^0+1/ } readdir($vtape_dir); +my @dump1 = grep { /^0+1/ } readdir($vtape_dir); closedir $vtape_dir; for my $dumpfile (@dump1) {