1 # Copyright (c) 2008-2012 Zmanda, Inc. All Rights Reserved.
3 # This program is free software; you can redistribute it and/or modify it
4 # under the terms of the GNU General Public License version 2 as published
5 # by the Free Software Foundation.
7 # This program is distributed in the hope that it will be useful, but
8 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # You should have received a copy of the GNU General Public License along
13 # with this program; if not, write to the Free Software Foundation, Inc.,
14 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
17 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
19 use Test::More tests => 4;
23 use lib "@amperldir@";
24 use Installcheck::Dumpcache;
25 use Installcheck::Config;
26 use Installcheck::Run qw(run run_err $diskname amdump_diag);
27 use Amanda::Config qw( :init );
34 $testconf = Installcheck::Run::setup();
35 $testconf->add_param('autolabel', '"TESTCONF%%" empty volume_error');
37 # one program "GNUTAR"
38 $testconf->add_dle(<<EODLE);
39 localhost diskname1 $diskname {
45 # and one with the amgtar application
46 $testconf->add_dle(<<EODLE);
47 localhost diskname2 $diskname {
52 property "ATIME-PRESERVE" "NO"
58 ok(run('amdump', 'TESTCONF'), "amdump runs successfully")
61 # Dump a nonexistant client, and see amdump fail.
62 $testconf = Installcheck::Run::setup();
63 $testconf->add_dle('does-not-exist.example.com / installcheck-test');
66 ok(!run('amdump', 'TESTCONF'), "amdump fails with nonexistent client");
68 #check failure in validate_optstr.
69 $testconf = Installcheck::Run::setup();
70 $testconf->add_dle(<<EODLE);
71 localhost diskname2 $diskname {
76 property "ATIME-PRESERVE" "NO"
78 compress client custom
83 ok(!run("$amlibexecdir/planner", 'TESTCONF'), "amdump fails in validate_optstr");
84 open(my $logfile, "<", "$CONFIG_DIR/TESTCONF/log/log")
85 or die("opening log: $!");
86 my $logline = grep(/^\S+ planner localhost diskname2 \d* 0 \[client custom compression with no compression program specified\]/, <$logfile>);
87 ok($logline, "planner fail without 'client custom compression with no compression program specified'");
89 Installcheck::Run::cleanup();