1 # Copyright (c) 2005-2008 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 Mathlida Ave, Suite 300
17 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
19 use Test::More tests => 3;
21 use lib "@amperldir@";
22 use Installcheck::Run qw( run run_get );
24 use Amanda::Constants;
26 my $input_filename = "$AMANDA_TMPDIR/amservice_input.txt";
27 my $testconf = Installcheck::Run::setup();
30 sub write_input_file {
32 open my $fh, ">", $input_filename
33 or die("Could not write to $input_filename");
42 return 0 if not $output;
44 for (split /\n/, $output) {
47 diag "Got unexpected line: $_";
54 # a simple run of amservice to begin with
55 like(run_get('amservice', '-f', '/dev/null', 'localhost', 'local', 'noop'),
56 qr/^OPTIONS features=/,
57 "amservice runs noop successfully");
61 <program>GNUTAR</program>
62 <disk>$AMANDA_TMPDIR</disk>
67 skip "GNUTAR not installed", 1 unless $Amanda::Constants::GNUTAR;
68 write_input_file($input);
70 run_get('amservice', '-f', $input_filename, 'localhost', 'local', 'selfcheck')),
71 "GNUTAR program selfchecks successfully");
74 # (can't test DUMP, since we don't have a device)
78 <program>APPLICATION</program>
80 <plugin>amgtar</plugin>
82 <disk>$AMANDA_TMPDIR</disk>
87 skip "GNUTAR not installed", 1 unless $Amanda::Constants::GNUTAR;
88 write_input_file($input);
90 run_get('amservice', '-f', $input_filename, 'localhost', 'local', 'selfcheck')),
91 "amgtar application selfchecks successfully");
96 <program>APPLICATION</program>
98 <plugin>amstar</plugin>
100 <disk>$AMANDA_TMPDIR</disk>
104 Installcheck::Run::cleanup();
105 unlink($input_filename);