Add a few more test for error paths

Since there's no virtual tape device, we can only test error paths,
sadly.
This commit is contained in:
Iustin Pop
2025-01-07 21:52:50 +01:00
parent d4c8e67be0
commit ba46d54458
2 changed files with 15 additions and 0 deletions

View File

View File

@@ -2,3 +2,18 @@
./mt -f /dev/no-such-tape rewind ./mt -f /dev/no-such-tape rewind
>>>2 /no-such-tape: No such file or directory/ >>>2 /no-such-tape: No such file or directory/
>>>= 1 >>>= 1
# Wrong file in show options
./mt -f tests/data/not-a-char-device stshowoptions
>>>2 /mt: not a character device/
>>>= 1
# /dev/null is not a tape device. Error message is ugly, though.
./mt -f /dev/null stshowoptions
>>>2 /Can't read the sysfs file '\/sys\/class\/scsi_tape/
>>>= 2
# /dev/null is not a tape device, so status fails.
./mt -f /dev/null status
>>>2 /Inappropriate ioctl for device/
>>>= 2