# Copyright (c) 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
# and disable Debug's die() and warn() overrides
Amanda::Debug::disable_die_override();
-my $tapelist = "$Installcheck::TMP/tapelist";
+my $tapelist_filename = "$Installcheck::TMP/tapelist";
+my $tapelist = Amanda::Tapelist->new($tapelist_filename);
sub set_tapelist {
my ($content) = @_;
- open(my $fh, ">", $tapelist) or die("opening '$tapelist': $!");
+ open(my $fh, ">", $tapelist_filename) or die("opening '$tapelist_filename': $!");
print $fh $content;
close($fh);
}
# methods are never invoked in this test.
my $taperscan = Amanda::Taper::Scan->new(
algorithm => "traditional",
- changer => {}, # (not used)
- tapelist_filename => $tapelist,
+ changer => undef, # (not used)
+ tapelist => $tapelist,
tapecycle => 1, # will be changed periodically below
labelstr => "TEST-[0-9]",
autolabel => { 'template' => "TEST-%",
20090424173002 TEST-2 reuse
20090424173003 TEST-3 reuse
20090424173004 TEST-4 reuse
+20090424172000 CONF-4 reuse
EOF
$taperscan->read_tapelist();
ok(!$taperscan->is_reusable_volume(label => "TEST-3", new_label_ok => 0), " TEST-3 not reusable");
ok(!$taperscan->is_reusable_volume(label => "TEST-4", new_label_ok => 0), " TEST-4 not reusable");
+$taperscan->quit();
+