1 # Copyright (c) 2008,2009 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 => 3;
21 use lib "@amperldir@";
23 use Installcheck::Run qw( run run_get );
25 use Amanda::Constants;
27 my $input_filename = "$Installcheck::TMP/amservice_input.txt";
28 my $testconf = Installcheck::Run::setup();
32 sub write_input_file {
34 open my $fh, ">", $input_filename
35 or die("Could not write to $input_filename");
44 return 0 if not $output;
46 for (split /\n/, $output) {
49 diag "Got unexpected line: $_";
56 # a simple run of amservice to begin with
57 like(run_get('amservice', '-f', '/dev/null', 'localhost', 'local', 'noop'),
58 qr/^OPTIONS features=/,
59 "amservice runs noop successfully");
63 <program>GNUTAR</program>
64 <disk>$Installcheck::TMP</disk>
69 skip "GNUTAR not installed", 1 unless $Amanda::Constants::GNUTAR;
70 write_input_file($input);
72 run_get('amservice', '-f', $input_filename, 'localhost', 'local', 'selfcheck')),
73 "GNUTAR program selfchecks successfully");
76 # (can't test DUMP, since we don't have a device)
80 <program>APPLICATION</program>
82 <plugin>amgtar</plugin>
84 <disk>$Installcheck::TMP</disk>
89 skip "GNUTAR not installed", 1 unless $Amanda::Constants::GNUTAR;
90 write_input_file($input);
92 run_get('amservice', '-f', $input_filename, 'localhost', 'local', 'selfcheck')),
93 "amgtar application selfchecks successfully");
98 <program>APPLICATION</program>
100 <plugin>amstar</plugin>
102 <disk>$Installcheck::TMP</disk>
106 Installcheck::Run::cleanup();
107 unlink($input_filename);