create_test_checksums.py

The NLA test system copies a number of files to an area of disk, which it then treats as an emulated version of the StorageD system. Files on StorageD have checksums associated with them that are created during the archive to tape process: files have their checksum calculated, are archived to tape, restored from tape (into a different area) and the checksum calculated again. If the checksums match then the file on tape is taken to be a legitimate copy and the file on disk can be deleted.

The NLA system uses the output from this checksumming process to determine if a file that has been marked for archive has been successfully stored on tape. For the test system these checksum logs do not exist. This script creates those checksum logs in the test system. They have the same format as the logs produced by StorageD when archiving to tape.

nla_control.scripts.create_test_checksums.create_checksum_files(calc_checksum_list, CHKSUMSDIR)

Create a file containing the checksums. This is used by the test system as there are no checksums from the backup process. We could copy the checksum files over but the file paths in the checksum files would be incorrect - so easier to just recompute.

Parameters
  • calc_checksum_list (List[Tuple(string,string)]) -- List of files to calculate checksums for. Each Tuple in the list contains (spot_name, spot_path)

  • CHKSUMDIR (string) -- Location of the check sum logs - i.e. the output directory

nla_control.scripts.create_test_checksums.run()

Function picked up by django-extensions. Calculate the checksums for each file that has been added to the NLA test system.