1 # Copyright (c) 2007-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::Config;
25 use Installcheck::Dumpcache;
26 use Installcheck::Catalogs;
27 use Installcheck::Run qw(run run_get run_err $diskname);
31 Amanda::Debug::dbopen("installcheck");
34 # First, try amoverview without a config
36 ok(!run('amoverview'),
37 "amoverview with no arguments returns an error exit status");
38 like($Installcheck::Run::stderr, qr/\AUSAGE:/i,
39 ".. and gives usage message on stderr");
42 # Now try it against a cached dump
44 Installcheck::Dumpcache::load("multi");
46 like(run_get('amoverview', 'TESTCONF'),
47 # this pattern is pretty loose, but that's OK
51 localhos\s+/.*\s+00\s+
54 "amoverview of the 'multi' dump looks good");
56 Installcheck::Run::cleanup();
59 # And some cached catalogs
61 my $testconf = Installcheck::Run::setup();
64 my $cat = Installcheck::Catalogs::load("bigdb");
67 like(run_get('amoverview', 'TESTCONF', '--skipmissed'),
69 \s* date \s+ 01\s+02\s+03\s+03\s+04\s+05\s+05\s+06\s+07 \s+
70 \s* host \s+ disk \s+ 11\s+22\s+11\s+13\s+14\s+11\s+15\s+16\s+22 \s+
72 \s* lovelace\s+ /home/ada \s+ -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ 3 \s+
73 \s* otherbox\s+ /direct \s+ -\s+ -\s+ -\s+ -\s+ -\s+ -\s+ 0\s+ -\s+ - \s+
74 \s* otherbox\s+ /lib \s+ -\s+ -\s+ -\s+ 0\s+1E\s+ 0\s+ -\s+ -\s+ - \s+
75 \s* otherbox\s+ /usr/bin \s+ -\s+ -\s+00\s+ -\s+ -\s+ 0\s+ -\s+ -\s+ - \s+
76 \s* somebox \s+ /lib \s+ 0\s+ 0\s+ -\s+ 0\s+ -\s+ -\s+ 0\s+ E\s+ - \s+
77 \s* somebox \s+ /usr/bin \s+ -\s+ -\s+ -\s+ 1\s+ -\s+ -\s+ 1\s+ 1\s+ -
79 "amoverview of the bigdb catalog looks right");