1 # Copyright (c) 2008 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;
21 use lib "@amperldir@";
22 use Installcheck::Dumpcache;
23 use Installcheck::Config;
24 use Installcheck::Run qw(run run_err $diskname amdump_diag);
25 use Amanda::Config qw( :init );
32 $testconf = Installcheck::Run::setup();
33 $testconf->add_param('autolabel', '"TESTCONF%%" empty volume_error');
35 # one program "GNUTAR"
36 $testconf->add_dle(<<EODLE);
37 localhost diskname1 $diskname {
43 # and one with the amgtar application
44 $testconf->add_dle(<<EODLE);
45 localhost diskname2 $diskname {
50 property "ATIME-PRESERVE" "NO"
56 ok(run('amdump', 'TESTCONF'), "amdump runs successfully")
59 # Dump a nonexistant client, and see amdump fail.
60 $testconf = Installcheck::Run::setup();
61 $testconf->add_dle('does-not-exist.example.com / installcheck-test');
64 ok(!run('amdump', 'TESTCONF'), "amdump fails with nonexistent client");
66 #check failure in validate_optstr.
67 $testconf = Installcheck::Run::setup();
68 $testconf->add_dle(<<EODLE);
69 localhost diskname2 $diskname {
74 property "ATIME-PRESERVE" "NO"
76 compress client custom
81 ok(!run("$amlibexecdir/planner", 'TESTCONF'), "amdump fails in validate_optstr");
82 open(my $logfile, "<", "$CONFIG_DIR/TESTCONF/log/log")
83 or die("opening log: $!");
84 my $logline = grep(/^\S+ planner localhost diskname2 \d* 0 \[client custom compression with no compression program specified\]/, <$logfile>);
85 ok($logline, "planner fail without 'client custom compression with no compression program specified'");
87 Installcheck::Run::cleanup();