X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=installcheck%2Famdump.pl;fp=installcheck%2Famdump.pl;h=508e6e9615dfc0ac4d08a4f0dc8e6e7e42f30d9b;hb=2627875b7d18858bc1f9f7652811e4d8c15a23eb;hp=0000000000000000000000000000000000000000;hpb=fb2bd066c2f8b34addafe48d62550e3033a59431;p=debian%2Famanda diff --git a/installcheck/amdump.pl b/installcheck/amdump.pl new file mode 100644 index 0000000..508e6e9 --- /dev/null +++ b/installcheck/amdump.pl @@ -0,0 +1,65 @@ +# Copyright (c) 2005-2008 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 +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License along +# 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 +# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com + +use Test::More tests => 2; + +use lib "@amperldir@"; +use Installcheck::Config; +use Installcheck::Run qw(run run_err $diskname amdump_diag); +use Amanda::Config qw( :init ); +use Amanda::Paths; + +my $testconf; + +# Just run amdump. + +$testconf = Installcheck::Run::setup(); +$testconf->add_param('label_new_tapes', '"TESTCONF%%"'); + +# one program "GNUTAR" +$testconf->add_dle(<add_dle(<write(); + +ok(run('amdump', 'TESTCONF'), "amdump runs successfully") + or amdump_diag(); + +# Dump a nonexistant client, and see amdump fail. +$testconf = Installcheck::Run::setup(); +$testconf->add_dle('does-not-exist.example.com / installcheck-test'); +$testconf->write(); + +ok(!run('amdump', 'TESTCONF'), "amdump fails with nonexistent client"); + +Installcheck::Run::cleanup();