Imported Upstream version 3.3.1
[debian/amanda] / installcheck / Amanda_Changer_robot.pl
index bed28ba7c4ffb39bed9f3d0a318b9b8bdc3525f6..7eadaa25e9e3d6462728f1972e55e4890faa7472 100644 (file)
@@ -466,18 +466,23 @@ sub test_changer {
        check_inventory($chg, $mtx_config->{'barcodes'} > 0, $steps->{'load_slot_1'}, [
            { slot => 1, state => Amanda::Changer::SLOT_FULL,
              barcode => '11111', current => 1,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 2, state => Amanda::Changer::SLOT_FULL,
              barcode => '22222',
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 3, state => Amanda::Changer::SLOT_FULL,
              barcode => '33333',
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 4, state => Amanda::Changer::SLOT_FULL,
              barcode => '44444',
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 5, state => Amanda::Changer::SLOT_EMPTY,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
        ], "$pfx: inventory is correct on start-up");
     };
 
@@ -556,18 +561,25 @@ sub test_changer {
        check_inventory($chg, $mtx_config->{'barcodes'} > 0, $steps->{'load_slot_3'}, [
            { slot => 1, state => Amanda::Changer::SLOT_FULL,
              barcode => '11111', reserved => 1, loaded_in => 0, current => 1,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => $DEVICE_STATUS_VOLUME_UNLABELED,
+             device_error => undef,
+             f_type => undef, label => undef },
            { slot => 2, state => Amanda::Changer::SLOT_FULL,
              barcode => '22222', reserved => 1, loaded_in => 1,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => $DEVICE_STATUS_VOLUME_UNLABELED,
+             device_error => undef,
+             f_type => undef, label => undef },
            { slot => 3, state => Amanda::Changer::SLOT_FULL,
              barcode => '33333',
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 4, state => Amanda::Changer::SLOT_FULL,
              barcode => '44444',
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 5, state => Amanda::Changer::SLOT_EMPTY,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
        ], "$pfx: inventory is updated when slots are loaded");
     };
 
@@ -656,20 +668,23 @@ sub test_changer {
        check_inventory($chg, $mtx_config->{'barcodes'} > 0, $steps->{'check_state_after_release1'}, [
            { slot => 1, state => Amanda::Changer::SLOT_FULL,
              barcode => '11111', reserved => 1, loaded_in => 0, current => 1,
-             device_status => $DEVICE_STATUS_SUCCESS,
+             device_status => $DEVICE_STATUS_SUCCESS, device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1' },
            { slot => 2, state => Amanda::Changer::SLOT_FULL,
              barcode => '22222', loaded_in => 1,
-             device_status => $DEVICE_STATUS_SUCCESS,
+             device_status => $DEVICE_STATUS_SUCCESS, device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-2' },
            { slot => 3, state => Amanda::Changer::SLOT_FULL,
              barcode => '33333',
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 4, state => Amanda::Changer::SLOT_FULL,
              barcode => '44444',
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 5, state => Amanda::Changer::SLOT_EMPTY,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
        ], "$pfx: inventory is still up to date");
     };
 
@@ -752,22 +767,24 @@ sub test_changer {
        check_inventory($chg, $mtx_config->{'barcodes'} > 0, $steps->{'release2'}, [
            { slot => 1, state => Amanda::Changer::SLOT_FULL,
              barcode => '11111',
-             device_status => $DEVICE_STATUS_SUCCESS,
+             device_status => $DEVICE_STATUS_SUCCESS, device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1',
              reserved => 1, loaded_in => 0 },
            { slot => 2, state => Amanda::Changer::SLOT_FULL,
              barcode => '22222',
-             device_status => $DEVICE_STATUS_SUCCESS,
+             device_status => $DEVICE_STATUS_SUCCESS, device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-2' },
            { slot => 3, state => Amanda::Changer::SLOT_FULL,
              barcode => '33333',
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 4, state => Amanda::Changer::SLOT_FULL,
              barcode => '44444', reserved => 1, loaded_in => 1, current => 1,
-             device_status => $DEVICE_STATUS_SUCCESS,
+             device_status => $DEVICE_STATUS_SUCCESS, device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
            { slot => 5, state => Amanda::Changer::SLOT_EMPTY,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
        ], "$pfx: inventory is up to date after more labelings");
     };
 
@@ -993,21 +1010,23 @@ sub test_changer {
        check_inventory($chg, $mtx_config->{'barcodes'} > 0, $steps->{'try_update'}, [
            { slot => 1, state => Amanda::Changer::SLOT_FULL,
              barcode => '11111', loaded_in => 1,
-             device_status => $DEVICE_STATUS_SUCCESS,
+             device_status => $DEVICE_STATUS_SUCCESS, device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1' },
            { slot => 2, state => Amanda::Changer::SLOT_FULL,
              barcode => '22222', loaded_in => 0,
-             device_status => $DEVICE_STATUS_SUCCESS,
+             device_status => $DEVICE_STATUS_SUCCESS, device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-2' },
            { slot => 3, state => Amanda::Changer::SLOT_FULL,
              barcode => '33333',
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 4, state => Amanda::Changer::SLOT_FULL,
              barcode => '44444', current => 1,
-             device_status => $DEVICE_STATUS_SUCCESS,
+             device_status => $DEVICE_STATUS_SUCCESS, device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
            { slot => 5, state => Amanda::Changer::SLOT_EMPTY,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
        ], "$pfx: inventory still accurate");
     };
 
@@ -1107,20 +1126,26 @@ sub test_changer {
            { slot => 1, state => Amanda::Changer::SLOT_FULL,
              barcode => '11111',
              device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1' },
            { slot => 2, state => Amanda::Changer::SLOT_FULL,
              barcode => '22222',
              device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'SURPRISE!' },
            { slot => 3, state => Amanda::Changer::SLOT_FULL,
              barcode => '33333', loaded_in => 1,
-             device_status => undef, f_type => undef, label => 'TAPE-3' },
+             device_status => $DEVICE_STATUS_SUCCESS, 
+             device_error => undef,
+             f_type => undef, label => 'TAPE-3' },
            { slot => 4, state => Amanda::Changer::SLOT_FULL,
              barcode => '44444', loaded_in => 0, current => 1,
              device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
            { slot => 5, state => Amanda::Changer::SLOT_EMPTY,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
        ], "$pfx: inventory reflects updates");
     };
 
@@ -1207,19 +1232,25 @@ sub test_changer {
            { slot => 1, state => Amanda::Changer::SLOT_FULL,
              barcode => '11111',
              device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1' },
            { slot => 2, state => Amanda::Changer::SLOT_EMPTY,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 3, state => Amanda::Changer::SLOT_FULL,
              barcode => '33333', loaded_in => 1,
-             device_status => undef, f_type => undef, label => 'TAPE-3' },
+             device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
+             f_type => undef, label => 'TAPE-3' },
            { slot => 4, state => Amanda::Changer::SLOT_FULL,
              barcode => '22222', current => 1,
              device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'SURPRISE!' },
            { slot => 5, state => Amanda::Changer::SLOT_FULL,
              barcode => '44444',
              device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
        ], "$pfx: inventory reflects the move");
     };
@@ -1268,19 +1299,25 @@ sub test_changer {
            { slot => 1, state => Amanda::Changer::SLOT_FULL,
              barcode => '11111', loaded_in => 1,
              device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1' },
            { slot => 2, state => Amanda::Changer::SLOT_EMPTY,
-             device_status => undef, f_type => undef, label => undef },
+             device_status => undef, device_error => undef,
+             f_type => undef, label => undef },
            { slot => 3, state => Amanda::Changer::SLOT_FULL,
              barcode => '33333', loaded_in => 0,
-             device_status => undef, f_type => undef, label => 'TAPE-3' },
+             device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
+             f_type => undef, label => 'TAPE-3' },
            { slot => 4, state => Amanda::Changer::SLOT_FULL,
              barcode => '22222', current => 1,
              device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-2' },
            { slot => 5, state => Amanda::Changer::SLOT_FULL,
              barcode => '44444',
              device_status => $DEVICE_STATUS_SUCCESS,
+             device_error => undef,
              f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
        ], "$pfx: inventory before updates with unknown state");
     };
@@ -1298,19 +1335,25 @@ sub test_changer {
                { slot => 1, state => Amanda::Changer::SLOT_FULL,
                  barcode => '11111', loaded_in => 1,
                  device_status => $DEVICE_STATUS_SUCCESS,
+                 device_error => undef,
                  f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1' },
                { slot => 2, state => Amanda::Changer::SLOT_EMPTY,
-                 device_status => undef, f_type => undef, label => undef },
+                 device_status => undef, device_error => undef,
+                 f_type => undef, label => undef },
                { slot => 3, state => Amanda::Changer::SLOT_FULL,
                  barcode => '33333', loaded_in => 0,
-                 device_status => undef, f_type => undef, label => 'TAPE-3' },
+                 device_status => $DEVICE_STATUS_SUCCESS,
+                 device_error => undef,
+                 f_type => undef, label => 'TAPE-3' },
                { slot => 4, state => Amanda::Changer::SLOT_FULL,
                  barcode => '22222', current => 1,
                  device_status => $DEVICE_STATUS_SUCCESS,
+                 device_error => undef,
                  f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-2' },
                { slot => 5, state => Amanda::Changer::SLOT_FULL,
                  barcode => '44444',
                  device_status => $DEVICE_STATUS_SUCCESS,
+                 device_error => undef,
                  f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
            ], "$pfx: inventory reflects updates with unknown state with barcodes");
        } else {
@@ -1318,18 +1361,23 @@ sub test_changer {
                { slot => 1, state => Amanda::Changer::SLOT_FULL,
                  barcode => '11111', loaded_in => 1,
                  device_status => $DEVICE_STATUS_SUCCESS,
+                 device_error => undef,
                  f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-1' },
                { slot => 2, state => Amanda::Changer::SLOT_EMPTY,
-                 device_status => undef, f_type => undef, label => undef },
+                 device_status => undef, device_error => undef,
+                 f_type => undef, label => undef },
                { slot => 3, state => Amanda::Changer::SLOT_FULL,
                  barcode => '33333', loaded_in => 0,
-                 device_status => undef, f_type => undef, label => undef },
+                 device_status => undef, device_error => undef,
+                 f_type => undef, label => undef },
                { slot => 4, state => Amanda::Changer::SLOT_FULL,
                  barcode => '22222', current => 1,
-                 device_status => undef, f_type => undef, label => undef },
+                 device_status => undef, device_error => undef,
+                 f_type => undef, label => undef },
                { slot => 5, state => Amanda::Changer::SLOT_FULL,
                  barcode => '44444',
                  device_status => $DEVICE_STATUS_SUCCESS,
+                 device_error => undef,
                  f_type => $Amanda::Header::F_TAPESTART, label => 'TAPE-4' },
            ], "$pfx: inventory reflects updates with unknown state without barcodes");
        }