python-registry icon indicating copy to clipboard operation
python-registry copied to clipboard

Is RegTester.py up2date?

Open NiKiZe opened this issue 11 years ago • 9 comments

RegTester does not seem to be updated to work with current code. Is it used to test changes to make sure everything works? Is there any archive with Hive files and corresponding .reg files that can be used for regression testing? Would it be appropriate to have small file sets in the repo for testing?

Have some work on an updated version and will prepare a PR after some sleep.

NiKiZe avatar Feb 01 '15 02:02 NiKiZe

There's no collection of hives and associated .reg files at the moment. Its a great idea though! Do you have access to any examples that you'd be willing to share?

williballenthin avatar Feb 02 '15 16:02 williballenthin

For now only minimal set of BCD files, but it is better then nothing. These should be collected when issues are found to prevent regressions. a resources subdirectory in test is my suggestion.

NiKiZe avatar Feb 02 '15 17:02 NiKiZe

Sounds good. I'll collect a set of files that I don't mind exposing to the web and upload them as you suggested.

williballenthin avatar Feb 02 '15 20:02 williballenthin

Willi we should make the hives part of our unified testing

EricZimmerman avatar Feb 02 '15 20:02 EricZimmerman

Yes, I agree. I'd like to collect the .reg and original hives, and export them test dump format for all of them, too.

williballenthin avatar Feb 02 '15 20:02 williballenthin

I agree as well, an automated unit test for all available hive/reg combos. Are there any good unit testing frameworks available for Python that can serve this purpose?

NiKiZe avatar Feb 02 '15 20:02 NiKiZe

let me know when you are ready and i can make sure you have the latest versions of the updated export format. it should be on google drive as well.

EricZimmerman avatar Feb 02 '15 21:02 EricZimmerman

@NiKiZe surely there are some, but i'm not familiar with any enough to instinctively pick one. I'd welcome suggestions.

williballenthin avatar Feb 02 '15 21:02 williballenthin

Sorry, I have not yet had time (or maybe it's more a lack of ideas) to do much on this :/

However came across some interesting things in reg.exe REG SAVESaves registry key as hive file REG RESTORERestores a hive file to reg key It should be possible to use this to only export "problematic" parts of the hives and that way only expose non sensitive data publicly.

a python script running on windows could be used to automate an multitude of tests (or even an cmd script in windows to collect data and then running the python part on any OS)

I think what we have suggested for now is walking all .hive files in testing/resources, and using (same named) .reg files call RegTester and make sure the result is as expected. I would also suggest that there is sha256 checksums for all files to eliminate problems caused by corruption.

NiKiZe avatar Feb 15 '15 22:02 NiKiZe