1 # Copyright (c) 2008-2012 Zmanda, Inc. All Rights Reserved.
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # You should have received a copy of the GNU General Public License along
14 # with this program; if not, write to the Free Software Foundation, Inc.,
15 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
18 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
20 use Test::More tests => 12;
24 use lib "@amperldir@";
26 use Installcheck::Run qw( run run_get );
27 use Installcheck::Catalogs;
29 use Amanda::Constants;
32 my $testconf = Installcheck::Run::setup();
35 ## try a few various options with a pretty normal logfile
37 $cat = Installcheck::Catalogs::load('normal');
40 ok(run('amstatus', 'TESTCONF'),
41 "plain amstatus runs without error");
42 like($Installcheck::Run::stdout,
43 qr{clienthost:/some/dir\s*0\s*100k\s*finished\s*\(13:01:53\)},
44 "output is reasonable");
46 ok(run('amstatus', 'TESTCONF', '--summary'),
47 "amstatus --summary runs without error");
48 unlike($Installcheck::Run::stdout,
49 qr{clienthost:/some/dir\s*0\s*100k\s*finished\s*\(13:01:53\)},
50 "output does not contain the finished dump");
51 like($Installcheck::Run::stdout,
53 "output contains summary info");
55 ## now test a file with spaces and other funny characters in filenames
57 $cat = Installcheck::Catalogs::load('quoted');
60 ok(run('amstatus', 'TESTCONF'),
61 "amstatus runs without error with quoted disknames");
62 like($Installcheck::Run::stdout,
63 # note that amstatus' output is quoted, so backslashes are doubled
64 qr{clienthost:"C:\\\\Some Dir\\\\"\s*0\s*100k\s*finished\s*\(13:01:53\)},
67 ## now test a chunker partial result
69 $cat = Installcheck::Catalogs::load('chunker-partial');
72 ok(!run('amstatus', 'TESTCONF'),
73 "amstatus return error with chunker partial");
74 is($Installcheck::Run::exit_code, 4,
75 "correct exit code for chunker partial");
76 like($Installcheck::Run::stdout,
77 qr{localhost:/etc 0\s*80917k dump failed: dumper: \[/usr/sbin/tar returned error\], finished \(7:49:53\)},
80 ## now test a taper-parallel-write > 1
82 $cat = Installcheck::Catalogs::load('taper-parallel-write');
85 ok(run('amstatus', 'TESTCONF'),
86 "amstatus with taper-parallel-write runs without error");
87 like($Installcheck::Run::stdout,
88 qr{\s*tape 3\s*:\s*1\s*142336k\s*142336k \( 5.82\%\) amstatus_test_3-AA-003 \(1 chunks\)},