From 71d02aa63183a513dbca98fa53719f7e29271faa Mon Sep 17 00:00:00 2001 From: Dmitry Valter Date: Fri, 27 Jan 2023 12:49:55 +0000 Subject: tests: support tmp-dir on different filesystem Support running tests with `--tmp-dir` on a filesystem different from /tmp. os.rename withs only within a single FS whereas shutil.move works accross different filesystems. Type: improvement Signed-off-by: Dmitry Valter Change-Id: I5371f5d75386bd2b82a75b3e6c1f2c850bc62356 --- test/vpp_pg_interface.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/vpp_pg_interface.py') diff --git a/test/vpp_pg_interface.py b/test/vpp_pg_interface.py index 2682774caab..0fd5df4f345 100644 --- a/test/vpp_pg_interface.py +++ b/test/vpp_pg_interface.py @@ -1,4 +1,5 @@ import os +import shutil import socket from socket import inet_pton, inet_ntop import struct @@ -168,7 +169,7 @@ class VppPGInterface(VppInterface): filename, ) self.test.logger.debug("Renaming %s->%s" % (path, name)) - os.rename(path, name) + shutil.move(path, name) except OSError: self.test.logger.debug("OSError: Could not rename %s %s" % (path, filename)) -- cgit 1.2.3-korg