1 # Copyright (c) 2008-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 => 3;
23 use lib "@amperldir@";
25 use Installcheck::Run qw( run run_get );
27 use Amanda::Constants;
29 my $input_filename = "$Installcheck::TMP/amservice_input.txt";
30 my $testconf = Installcheck::Run::setup();
34 sub write_input_file {
36 open my $fh, ">", $input_filename
37 or die("Could not write to $input_filename");
46 return 0 if not $output;
48 for (split /\n/, $output) {
51 diag "Got unexpected line: $_";
58 # a simple run of amservice to begin with
59 like(run_get('amservice', '-f', '/dev/null', 'localhost', 'local', 'noop'),
60 qr/^OPTIONS features=/,
61 "amservice runs noop successfully");
65 <program>GNUTAR</program>
66 <disk>$Installcheck::TMP</disk>
71 skip "GNUTAR not installed", 1 unless $Amanda::Constants::GNUTAR;
72 write_input_file($input);
74 run_get('amservice', '-f', $input_filename, 'localhost', 'local', 'selfcheck')),
75 "GNUTAR program selfchecks successfully");
78 # (can't test DUMP, since we don't have a device)
82 <program>APPLICATION</program>
84 <plugin>amgtar</plugin>
86 <disk>$Installcheck::TMP</disk>
91 skip "GNUTAR not installed", 1 unless $Amanda::Constants::GNUTAR;
92 write_input_file($input);
94 run_get('amservice', '-f', $input_filename, 'localhost', 'local', 'selfcheck')),
95 "amgtar application selfchecks successfully");
100 <program>APPLICATION</program>
102 <plugin>amstar</plugin>
104 <disk>$Installcheck::TMP</disk>
108 Installcheck::Run::cleanup();
109 unlink($input_filename);