move to modern source package format
[debian/amanda] / installcheck / Amanda_Changer_single.pl
index 80da868e38ca9f63d0e17263af0a0948659a3427..1f876d69f1e643f2ed3d0f60592a89456a6054ec 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+# Copyright (c) 2008, 2009, 2010 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
@@ -19,6 +19,7 @@
 use Test::More tests => 6;
 use File::Path;
 use strict;
+use warnings;
 
 use lib "@amperldir@";
 use Installcheck::Config;
@@ -46,7 +47,8 @@ if ($cfg_result != $CFGERR_OK) {
     die(join "\n", @errors);
 }
 
-my $chg = Amanda::Changer->new("chg-single:tape:/foo");
+my $chg = Amanda::Changer->new("chg-single:null:/foo");
+die "$chg" if $chg->isa("Amanda::Changer::Error");
 
 {
     my ($held_res);
@@ -72,7 +74,7 @@ my $chg = Amanda::Changer->new("chg-single:tape:/foo");
        my ($err, $res) = @_;
        ok(!$err, "no error loading relative slot 'current'")
            or diag($err);
-       is($res->{'device'}->device_name(), 'tape:/foo',
+       is($res->{'device'}->device_name(), 'null:/foo',
            "returns correct device name");
 
        $held_res = $res; # hang onto it while loading another slot
@@ -84,7 +86,7 @@ my $chg = Amanda::Changer->new("chg-single:tape:/foo");
     $got_second_res = make_cb('got_second_res' => sub {
        my ($err, $res) = @_;
        chg_err_like($err,
-           { message => qr{'tape:/foo' is already reserved},
+           { message => qr{'null:/foo' is already reserved},
              type => 'failed',
              reason => 'volinuse' },
            "second simultaneous reservation rejected");
@@ -102,8 +104,10 @@ my $chg = Amanda::Changer->new("chg-single:tape:/foo");
     $get_info->();
     Amanda::MainLoop::run();
 }
+$chg->quit();
 
 $chg = Amanda::Changer->new("chg-single:bogus:device");
 is("$chg",
     "chg-single: error opening device 'bogus:device': Device type bogus is not known.",
     "bogus device name detected early");
+$chg->quit();