tests: Add support for getting corefile patterns on FreeBSD
[vpp.git] / test / asf / test_api_trace.py
index 35fb3c0..8776a79 100644 (file)
@@ -1,11 +1,10 @@
-import os
 import unittest
-from asfframework import VppTestCase, VppTestRunner
-from vpp_papi import VppEnum
+from asfframework import VppAsfTestCase, VppTestRunner
 import json
+import shutil
 
 
-class TestJsonApiTrace(VppTestCase):
+class TestJsonApiTrace(VppAsfTestCase):
     """JSON API trace related tests"""
 
     @classmethod
@@ -28,7 +27,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)