# Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
-use Test::More tests => 18;
+use Test::More tests => 19;
use File::Path;
use strict;
use warnings;
my $chg = Amanda::Changer->new("chg-multi:file:$taperoot/slot{0,1,2,3,4}");
die($chg) if $chg->isa("Amanda::Changer::Error");
+is($chg->have_inventory(), '1', "changer have inventory");
{
my @slots = ();
my @reservations = ();
f_type => undef, label => undef,
reserved => 0 },
{ slot => 2, state => Amanda::Changer::SLOT_FULL,
- device_status => ($DEVICE_STATUS_DEVICE_ERROR |
- $DEVICE_STATUS_VOLUME_UNLABELED |
- $DEVICE_STATUS_VOLUME_ERROR),
- f_type => undef, label => undef,
+ device_status => $DEVICE_STATUS_VOLUME_UNLABELED,
+ f_type => $Amanda::Header::F_EMPTY, label => undef,
reserved => 0 },
{ slot => 3, state => Amanda::Changer::SLOT_FULL,
- device_status => ($DEVICE_STATUS_DEVICE_ERROR |
- $DEVICE_STATUS_VOLUME_UNLABELED |
- $DEVICE_STATUS_VOLUME_ERROR),
- f_type => undef, label => undef,
+ device_status => $DEVICE_STATUS_VOLUME_UNLABELED,
+ f_type => $Amanda::Header::F_EMPTY, label => undef,
reserved => 0 },
{ slot => 4, state => Amanda::Changer::SLOT_FULL,
device_status => $DEVICE_STATUS_SUCCESS,
f_type => $Amanda::Header::F_TAPESTART, label => "FOO?BAR",
reserved => 0, current => 1 },
{ slot => 5, state => Amanda::Changer::SLOT_FULL,
- device_status => ($DEVICE_STATUS_DEVICE_ERROR |
- $DEVICE_STATUS_VOLUME_UNLABELED |
- $DEVICE_STATUS_VOLUME_ERROR),
- f_type => undef, label => undef,
+ device_status => $DEVICE_STATUS_VOLUME_UNLABELED,
+ f_type => $Amanda::Header::F_EMPTY, label => undef,
reserved => 0 },
], "inventory finds the labeled tape");
Amanda::MainLoop::run();
}
+$chg->quit();
rmtree($taperoot);