tests: use os.rename instead of os.replace in lttng_live_server.py
On Windows, os.rename fails if the destination file exists, which is the
case for the port file in lttng_live_server.py. The file is created by
the bash test script.
This results in the following error:
# Starting LTTng live server mockup
Traceback (most recent call last):
File "C:/Users/smarchi/babeltrace/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py", line 1449, in <module>
args.port_filename, args.sessions, args.max_query_data_response_size
File "C:/Users/smarchi/babeltrace/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py", line 1229, in __init__
self._write_port_to_file(port_filename)
File "C:/Users/smarchi/babeltrace/tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py", line 1342, in _write_port_to_file
os.rename(tmp_port_file.name, port_filename)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:/Users/smarchi/AppData/Local/Temp/tmpi8ihb0ck' -> 'test_live_list_sessions_server_port.5iod4m'
Use os.replace instead.
Change-Id: I8d7a28da66f11975bb0e2d355084a8a336500cc0
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2113
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
This page took 0.025502 seconds and 4 git commands to generate.