NebulousLabs / Sia

Blockchain-based marketplace for file storage. Project has moved to GitLab: https://gitlab.com/NebulousLabs/Sia
https://sia.tech
MIT License
2.71k stars 442 forks source link

Siatest persistence cleanup #3115

Closed ChrisSchinnerl closed 5 years ago

ChrisSchinnerl commented 6 years ago

This PR cleans up the madness in the /tmp/SiaTesting folder for the siatest framework. siatest- Tests will create the following folder structure in the /tmp/SiaTesting directory.

/tmp/SiaTesting/siatest/<packageName>/<testName>/<nodeName>

The is the the folder name specified in the Dir field of the NodeParams struct. If no Dir field is specified (e.g. when creating a whole group at once) the node name will be an encoded string of the enabled modules plus a random 4 byte, hex-encoded suffix. So for example a renter node could have the name gctwr-deadbeef.

One exception to this structure is the /tmp/SiaTesting/siatest/data folder. It contains all the randomly generated files of all siatest tests. The files follow the encoding <sizeInBytes>bytes-<4byte-hex-suffix>. e.g. 100bytes-deadbeef

DavidVorick commented 6 years ago

Different data is generated for each test, right? Is there any reason you can't add a data subfolder to the tmp/SiaTesting/siatest/<packageName>/<testName> folder?

DavidVorick commented 6 years ago

We can break some of this into another PR if you prefer, namely the NewFile stuff