X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=installcheck%2Famdevcheck.pl;h=25de41bb5448a6d7b58bc633421ea7605c80d677;hb=9b5cad4e0a168522f22bf66d35b28aaeb1cc93e0;hp=15cffe1c2102f1c1b9f082debbb0971fc0ee8b4b;hpb=d5853102f67d85d8e169f9dbe973ad573306c215;p=debian%2Famanda diff --git a/installcheck/amdevcheck.pl b/installcheck/amdevcheck.pl index 15cffe1..25de41b 100644 --- a/installcheck/amdevcheck.pl +++ b/installcheck/amdevcheck.pl @@ -1,8 +1,9 @@ -# Copyright (c) 2007, 2008, 2010 Zmanda, Inc. All Rights Reserved. +# Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved. # -# This program is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 as published -# by the Free Software Foundation. +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY @@ -17,6 +18,8 @@ # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com use Test::More tests => 17; +use strict; +use warnings; use lib "@amperldir@"; use Installcheck::Config; @@ -42,14 +45,14 @@ like(run_err('amdevcheck', 'this-probably-doesnt-exist'), qr(could not open conf # this is re-created for each test $testconf = Installcheck::Config->new(); -$testconf->add_param("tapedev", '"/dev/null"'); +$testconf->add_param("tapedev", '"null:null"'); $testconf->write(); # test some defaults -ok(run('amdevcheck', 'TESTCONF'), "run succeeds with a /dev/null tapedev"); +ok(run('amdevcheck', 'TESTCONF'), "run succeeds with a null tapedev"); is_deeply([ sort split "\n", $Installcheck::Run::stdout], - [ sort "MESSAGE File /dev/null is not a tape device", "DEVICE_ERROR"], - "Fail with correct message for a /dev/null tapedev"); + [ sort "MESSAGE Can't open NULL device for reading or appending.", "VOLUME_UNLABELED", "VOLUME_ERROR"], + "Fail with correct message for a null tapedev"); ## # Now use a config with a vtape @@ -62,7 +65,7 @@ $testconf->write(); ok(run('amdevcheck', 'TESTCONF'), "run succeeds with an unlabeled tape"); is_deeply([ sort split "\n", $Installcheck::Run::stdout], - [ sort "MESSAGE Error loading device header -- unlabeled volume?", "VOLUME_UNLABELED", "DEVICE_ERROR", "VOLUME_ERROR"], + [ sort "MESSAGE File 0 not found", "VOLUME_UNLABELED"], "..and output is correct"); ok(run('amdevcheck', 'TESTCONF', "--properties"), @@ -87,10 +90,10 @@ is_deeply([ sort split "\n", $Installcheck::Run::stdout], "CANONICAL_NAME=file:" . Installcheck::Run::vtape_dir() ], ".. with correct results"); -ok(run('amdevcheck', 'TESTCONF', '/dev/null'), +ok(run('amdevcheck', 'TESTCONF', 'null:null'), "can override device on the command line"); is_deeply([ sort split "\n", $Installcheck::Run::stdout], - [ sort "MESSAGE File /dev/null is not a tape device", "DEVICE_ERROR"], + [ sort "MESSAGE Can't open NULL device for reading or appending.", "VOLUME_UNLABELED", "VOLUME_ERROR"], ".. and produce a corresponding error message"); Installcheck::Dumpcache::load("basic"); @@ -101,5 +104,4 @@ is_deeply([ sort split "\n", run_get('amdevcheck', 'TESTCONF', 'file:'.$Installcheck::Run::taperoot) ], [ sort "SUCCESS" ], "used vtape described as SUCCESS"); - Installcheck::Run::cleanup();