1 # Copyright (c) 2007-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 => 4;
24 use lib "@amperldir@";
25 use Installcheck::Config;
26 use Installcheck::Dumpcache;
27 use Installcheck::Catalogs;
28 use Installcheck::Run qw(run run_get run_err $diskname);
32 Amanda::Debug::dbopen("installcheck");
35 # First, try amoverview without a config
37 ok(!run('amoverview'),
38 "amoverview with no arguments returns an error exit status");
39 like($Installcheck::Run::stderr, qr/\AUSAGE:/i,
40 ".. and gives usage message on stderr");
43 # Now try it against a cached dump
45 Installcheck::Dumpcache::load("multi");
47 like(run_get('amoverview', 'TESTCONF'),
48 # this pattern is pretty loose, but that's OK
52 localhos\s+/.*\s+00\s+
55 "amoverview of the 'multi' dump looks good");
57 Installcheck::Run::cleanup();
60 # And some cached catalogs
62 my $testconf = Installcheck::Run::setup();
65 my $cat = Installcheck::Catalogs::load("bigdb");
68 like(run_get('amoverview', 'TESTCONF', '--skipmissed'),
70 \s* date \s+ 01\s+02\s+03\s+03\s+04\s+05\s+05\s+06\s+07 \s+
71 \s* host \s+ disk \s+ 11\s+22\s+11\s+13\s+14\s+11\s+15\s+16\s+22 \s+
73 \s* lovelace\s+ /home/ada \s+ -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ 3 \s+
74 \s* otherbox\s+ /direct \s+ -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ 0\s+ -\s+ - \s+
75 \s* otherbox\s+ /lib \s+ -\s+ -\s+ -\s+ 0\s+1E\s+ 0\s+ -\s+ -\s+ - \s+
76 \s* otherbox\s+ /usr/bin \s+ -\s+ -\s+00\s+ -\s+ -\s+ 0\s+ -\s+ -\s+ - \s+
77 \s* somebox \s+ /lib \s+ 0\s+ 0\s+ -\s+ 0\s+ -\s+ -\s+ 0\s+ E\s+ - \s+
78 \s* somebox \s+ /usr/bin \s+ -\s+ -\s+ -\s+ 1\s+ -\s+ -\s+ 1\s+ 1\s+ -
80 "amoverview of the bigdb catalog looks right");