JorisHerbots / vegvisir

Vegvisir is an automated testing framework for orchestrating prototypical QUIC-HTTP/3 client-server communications using simulated network conditions.
Other
17 stars 3 forks source link

Space characters in log dir #6

Closed VandersandenMike closed 1 year ago

VandersandenMike commented 1 year ago

A directory structure is made to store all log files on line: https://github.com/JorisHerbots/vegvisir/blob/d93f97610815a7a21e77f53e19b9b28920e6add8/vegvisir/runner.py#L313 When doing so, a number of parameters are used, many based on docker image repositories and docker image names, however, some use JSON keys that can be found in implementations.json.

JSON allows keys with space characters https://github.com/JorisHerbots/vegvisir/blob/d93f97610815a7a21e77f53e19b9b28920e6add8/implementations.json#L58 ⇾ spaces in directory names can cause errors in commands. Example: cat /logs/first test/file.json, this will result in an error.

When running vegvisir, the spaces can occur within environment variables and parameters, causing errors.

A possible solution would be to add the following line after creating the directory structure: log_dir = log_dir.replace(" ", "_"), replacing spaces with underscores (or another character) Example: cat /logs/first test/file.jsoncat /logs/first_test/file.json only whitespace have to be replaced, other character should not cause any problem