-# 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
# 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;
# 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'),
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)");
"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)");
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) {