Skip to content

Unit test for DriveHandler and CleanerSession

Summary

Add a class for unit testing of triggering of the cleaner session at the end of failed data transfer session. It's implementation contains some questionable solutions:

  • add the feedback in DriveHandlerProxy: reportHeartbeat() will listen for the client's messages and echo them to the parent process (DriveHandler). This is needed by the unit test to be able to send state change messages to the parent process. Normally the client process (DataTransferSession) doesn't need it.
  • add reportHeartbeat() to DataTransferSession during down-up transition loop. Data transfer session doesn't go further, because there is no real work. In the unit test I deal only with state change messages without starting any mounts. The reason for this is that it's impossible to instantiate the tape drive because InMemory catalogue has a bug that prevents of using the same catalogue instance in the unit test and the drive handler process.

Moreover, there is one more case to cover: I was unable to test triggering the cleaner session when the transfer session was killed. I simply couldn't kill the child process because of lack of control. For this reason CleanerSession cannot run. It will only tell that it will start, and this is what is tested.

References

#61 (closed)

Edited by Volodymyr Yurchenko

Merge request reports