[ACT][PATCH 2/4] UBUNTU: SAUCE: ubuntu_performance_lkp: always cleanup previous lkp-tests

Krzysztof Kozlowski krzysztof.kozlowski at canonical.com
Mon Jun 7 11:11:15 UTC 2021


Already cloned repository with lkp-tests could change between test
invocation, so always remove it in setup() before cloning.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski at canonical.com>
---
 ubuntu_performance_lkp/ubuntu_performance_lkp.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ubuntu_performance_lkp/ubuntu_performance_lkp.py b/ubuntu_performance_lkp/ubuntu_performance_lkp.py
index b1e23f22a7ee..b48800c1a3a2 100644
--- a/ubuntu_performance_lkp/ubuntu_performance_lkp.py
+++ b/ubuntu_performance_lkp/ubuntu_performance_lkp.py
@@ -6,6 +6,7 @@ from math import sqrt
 import platform
 import time
 import json
+import shutil
 import socket
 import subprocess
 import resource
@@ -122,9 +123,8 @@ class ubuntu_performance_lkp(test.test):
             os.environ["http_proxy"] = "http://squid.internal:3128"
 
         os.chdir(self.srcdir)
-
-        if not os.path.isdir("lkp-tests"):
-            self.results += utils.system_output('git clone https://github.com/intel/lkp-tests', retain_output=True)
+        shutil.rmtree('lkp-tests', ignore_errors=True)
+        self.results += utils.system_output('git clone https://github.com/intel/lkp-tests', retain_output=True)
 
         os.chdir(os.path.join(self.srcdir, 'lkp-tests'))
 
-- 
2.27.0




More information about the kernel-team mailing list