diff --git a/tests/data/bad-definition.data b/tests/data/bad-definition.data new file mode 100644 index 0000000..2cd728f --- /dev/null +++ b/tests/data/bad-definition.data @@ -0,0 +1,6 @@ +# A non-compressing DAT (DDS-1) +# The manufacturer, model, and revision strings can be obtained, +# from the file /proc/scsi/scsi (cat /proc/scsi/scsi). +manufacturer=XYZ model = "UVW1" { +mode1 blocksize= +} diff --git a/tests/data/incomplete-block.data b/tests/data/incomplete-block.data new file mode 100644 index 0000000..3a0d6f1 --- /dev/null +++ b/tests/data/incomplete-block.data @@ -0,0 +1,4 @@ +# A non-compressing DAT (DDS-1) +# The manufacturer, model, and revision strings can be obtained, +# from the file /proc/scsi/scsi (cat /proc/scsi/scsi). +manufacturer=XYZ model = "UVW1" { diff --git a/tests/data/large-units.data b/tests/data/large-units.data new file mode 100644 index 0000000..bab4f4b --- /dev/null +++ b/tests/data/large-units.data @@ -0,0 +1,7 @@ +# A non-compressing DAT (DDS-1) +# The manufacturer, model, and revision strings can be obtained, +# from the file /proc/scsi/scsi (cat /proc/scsi/scsi). +manufacturer=XYZ model = "UVW1" { +scsi2logical=1 can-bsr can-partitions auto-lock +mode1 blocksize=1k +mode2 blocksize=1M } diff --git a/tests/stinit-parsing.test b/tests/stinit-parsing.test index 6636fc6..671fd1d 100644 --- a/tests/stinit-parsing.test +++ b/tests/stinit-parsing.test @@ -12,3 +12,19 @@ >>> /No errors found./ >>>2 /Mode 1 definition: scsi2logical=1 can-bsr=1 auto-lock=0 two-fms=0 drive-buffering=1 buffer-writes read-ahead=1 async-writes=1 can-partitions=0 fast-eom=1 blocksize=0 sili=1 timeout=900 long-timeout=14400 density=0x44 compression=0/ >>>= 0 + +# Check units +./stinit -v -v -p -f tests/data/large-units.data +>>> /No errors found./ +>>>2 /blocksize=1(k|M)/ +>>>= 0 + +# Incomplete block +./stinit -p -v -f tests/data/incomplete-block.data +>>>2 /End of definition block not found for/ +>>>= 1 + +# Wrong definition +./stinit -p -v -f tests/data/bad-definition.data +>>>2 /Warning: errors in definition for/ +>>>= 1