tests: make lttng_live_server.py write temp port filename in same directory
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 18 Sep 2023 18:47:44 +0000 (14:47 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 20 Oct 2023 23:29:14 +0000 (19:29 -0400)
commita0a92e790c59dbe2483a54a1b7cb62fa0ed57bd8
treed2f470e7f7a0d0297e754bca5eea4e4ff44a02e5
parent2439d12bc9f08af6e5c6ab71556e50b824c3dca6
tests: make lttng_live_server.py write temp port filename in same directory

When running lttng_live_server.py with `--port-filename yoyoyo`, I get:

    Traceback (most recent call last):
      File "lttng_live_server.py", line 1982, in <module>
        LttngLiveServer(port, port_filename, sessions, max_query_data_response_size)
      File "lttng_live_server.py", line 1716, in __init__
        self._write_port_to_file(port_filename)
      File "lttng_live_server.py", line 1839, in _write_port_to_file
        os.replace(tmp_port_file.name, port_filename)
    OSError: [Errno 18] Invalid cross-device link: '/tmp/tmpe70085jz' -> 'yoyoyo'

Fix this by placing the temporary file in the same directory as its
final location.

Change-Id: Ibe6fee5dc99860ab3cd4464a2f490e05c65df1eb
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10901
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/data/plugins/src.ctf.lttng-live/lttng_live_server.py
This page took 0.025301 seconds and 4 git commands to generate.