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 => 3;
24 use lib "@amperldir@";
26 use Installcheck::Run qw( run run_get );
28 use Amanda::Constants;
30 my $input_filename = "$Installcheck::TMP/amservice_input.txt";
31 my $testconf = Installcheck::Run::setup();
35 sub write_input_file {
37 open my $fh, ">", $input_filename
38 or die("Could not write to $input_filename");
47 return 0 if not $output;
49 for (split /\n/, $output) {
52 diag "Got unexpected line: $_";
59 # a simple run of amservice to begin with
60 like(run_get('amservice', '-f', '/dev/null', 'localhost', 'local', 'noop'),
61 qr/^OPTIONS features=/,
62 "amservice runs noop successfully");
66 <program>GNUTAR</program>
67 <disk>$Installcheck::TMP</disk>
72 skip "GNUTAR not installed", 1 unless $Amanda::Constants::GNUTAR;
73 write_input_file($input);
75 run_get('amservice', '-f', $input_filename, 'localhost', 'local', 'selfcheck')),
76 "GNUTAR program selfchecks successfully");
79 # (can't test DUMP, since we don't have a device)
83 <program>APPLICATION</program>
85 <plugin>amgtar</plugin>
87 <disk>$Installcheck::TMP</disk>
92 skip "GNUTAR not installed", 1 unless $Amanda::Constants::GNUTAR;
93 write_input_file($input);
95 run_get('amservice', '-f', $input_filename, 'localhost', 'local', 'selfcheck')),
96 "amgtar application selfchecks successfully");
101 <program>APPLICATION</program>
103 <plugin>amstar</plugin>
105 <disk>$Installcheck::TMP</disk>
109 Installcheck::Run::cleanup();
110 unlink($input_filename);