summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/asf/asfframework.py2
-rw-r--r--test/asf/test_api_trace.py3
-rw-r--r--test/framework.py2
-rw-r--r--test/vpp_pg_interface.py3
4 files changed, 6 insertions, 4 deletions
diff --git a/test/asf/asfframework.py b/test/asf/asfframework.py
index b662042bc4a..5c64454df9f 100644
--- a/test/asf/asfframework.py
+++ b/test/asf/asfframework.py
@@ -855,7 +855,7 @@ class VppTestCase(CPUInterface, unittest.TestCase):
vpp_api_trace_log = "%s/%s" % (self.tempdir, api_trace)
self.logger.info(self.vapi.ppcli("api trace save %s" % api_trace))
self.logger.info("Moving %s to %s\n" % (tmp_api_trace, vpp_api_trace_log))
- os.rename(tmp_api_trace, vpp_api_trace_log)
+ shutil.move(tmp_api_trace, vpp_api_trace_log)
except VppTransportSocketIOError:
self.logger.debug(
"VppTransportSocketIOError: Vpp dead. Cannot log show commands."
diff --git a/test/asf/test_api_trace.py b/test/asf/test_api_trace.py
index 35fb3c0261a..e38b81a4c7d 100644
--- a/test/asf/test_api_trace.py
+++ b/test/asf/test_api_trace.py
@@ -3,6 +3,7 @@ import unittest
from asfframework import VppTestCase, VppTestRunner
from vpp_papi import VppEnum
import json
+import shutil
class TestJsonApiTrace(VppTestCase):
@@ -28,7 +29,7 @@ class TestJsonApiTrace(VppTestCase):
tmp_api_trace = "/tmp/%s" % fname
fpath = "%s/%s" % (self.tempdir, fname)
self.vapi.cli("api trace save-json {}".format(fname))
- os.rename(tmp_api_trace, fpath)
+ shutil.move(tmp_api_trace, fpath)
with open(fpath, encoding="utf-8") as f:
s = f.read()
trace = json.loads(s)
diff --git a/test/framework.py b/test/framework.py
index a7a3e2fdea7..f90aa43c9f2 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -931,7 +931,7 @@ class VppTestCase(CPUInterface, unittest.TestCase):
vpp_api_trace_log = "%s/%s" % (self.tempdir, api_trace)
self.logger.info(self.vapi.ppcli("api trace save %s" % api_trace))
self.logger.info("Moving %s to %s\n" % (tmp_api_trace, vpp_api_trace_log))
- os.rename(tmp_api_trace, vpp_api_trace_log)
+ shutil.move(tmp_api_trace, vpp_api_trace_log)
except VppTransportSocketIOError:
self.logger.debug(
"VppTransportSocketIOError: Vpp dead. Cannot log show commands."
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))