The other option would be to use (hijack) the SCSI ‘SEND DIAGNOSTIC’ / ‘RECEIVE DIAGNOSTIC RESULTS’ op codes.. Code up a list of useful fault-injection conditions within DIAGNOSTIC OP code.. Pass any metadata as part of the payload - such as block number(s), after x reads/writes, only fault on a block size of x, only error on barcode xyz, fail first n attempts on reading block. The RECEIVE DIAGNOSTIC could return any conditions already set.. Just a thought. Cheers Mark > On 9 Jan 2021, at 01:12, Michael Ablassmeier <abi@xxxxxxxxxx> wrote: > > hi, > > im searching for a way to be able to easily simulate faulty tape drives > for CI/Testing purposes. The VTL emulation in TGT seems to have all the > functionality required for my purpose and so i went on and implemented a > proof of concept. > > The POC uses the VTL Tapes MAM header to store information about which > errnous behavior should be simulated in case the tape is written. > Different tapes can as such simulate different fault behaviors. > > See following description for more details: > > https://github.com/abbbi/tgt/blob/fault_injection/doc/README.ssc-fault-injection > > Is there any interest in getting such a feature into TGT's VTL > emulation? Full diff here: > > https://github.com/fujita/tgt/compare/master...abbbi:fault_injection > > As the MAM header is probably not the best way for storing the > information, would it be a good solution to store a special file > alongside to the VTL file, including more meta information related to > this feature? > > bye, > - michael