-# amtapetype demands far more resources than we can allow it to use in a
-# test situation, so for now this is the best we can do.
+##
+# Set up a small vtape to write to
+
+my $testconf = Installcheck::Run::setup();
+$testconf->add_device("smallvtape", [
+ "tapedev" => '"file:' . vtape_dir() . '"',
+ "device_property" => '"MAX_VOLUME_USAGE" "2m"', # need at least 1M
+]);
+$testconf->write();
+
+like(run_get('amtapetype', 'TESTCONF', 'smallvtape'),
+ qr/define tapetype unknown-tapetype.*blocksize 32 kbytes/s,
+ "amtapetype runs successfully on a small vtape");
+
+ok(run_err('amtapetype', 'TESTCONF', 'smallvtape'),
+ "a second run on the same device fails because -f isn't used") or die;
+
+like(run_get('amtapetype', 'TESTCONF', '-f', '-b', '33000', 'smallvtape'),
+ qr/add device-property/,
+ "with a non-kilobyte block size, directs user to add a device_property");