diff mbox series

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

Message ID 20210607111117.43251-2-krzysztof.kozlowski@canonical.com
State New
Headers show
Series [ACT,1/4] UBUNTU: SAUCE: fix git clone failures and setups not being idempotent | expand

Commit Message

Krzysztof Kozlowski June 7, 2021, 11:11 a.m. UTC
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@canonical.com>
---
 ubuntu_performance_lkp/ubuntu_performance_lkp.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Po-Hsu Lin June 8, 2021, 1:17 p.m. UTC | #1
Acked-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Applied and pushed.

Thanks
Sam
diff mbox series

Patch

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'))