redhat-qe-security / SCAutolib

Library for automation of smart card testing
GNU General Public License v3.0
3 stars 10 forks source link

Fix backup of the files #33

Closed x00Pavel closed 2 years ago

x00Pavel commented 2 years ago

Previously backup of the file lead to rewriting the previous backup, so some tests were failing due to this behavior. Now each backup file has a unique name with a number of copy in the end of the file name.

mahavrila commented 2 years ago

I would consider this solution as a Hotfix. As proper solution, I would suggest:

Make logging independent on backups. It should be more simple and robust. 1) only original config file is backed up and optionally restored at the end of the test. 1.1) in case more changes are being added to already modified config file, this modified config file is not backed up (check that backup exists and do not rewrite it) 2) edit_config writes a copy of current (edited) config file to certain location; no need to make diff. 2.1) copy of edited config file is unambiguously specified - for example name of file can contain time at which the copy was made. (this would help user to see exact content of config file present during the test)

x00Pavel commented 2 years ago

ok, will update it