[ACT][PATCH] UBUNTU: SAUCE: ubuntu_qrt_kernel_hardening: resolve lengthy git clones

Sean Feole sean.feole at canonical.com
Wed Jul 21 15:26:04 UTC 2021

BugLink: n/a

The ubuntu_qrt_kernel_hardening test has been failing during SRU testing
due to the the qa-regression-testing repo taking over 20+ minutes to
clone. In many cases, this will result in a timeout and cause the test
to fail.

The Following changes are to address a new feature added to ckct.
SUT-TEST will rsync+ssh the qa-regression-testing to the SUT, prior to
executing autotest.

If the qa-regression-testing directory exists in ($HOME/), then use
that as the source. If not then we git clone qa-regression-testing
as we have always done so.

Signed-off-by: Sean Feole <sean.feole at canonical.com>
  .../ubuntu_qrt_kernel_hardening.py                | 15 +++++++++++++--
  1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/ubuntu_qrt_kernel_hardening/ubuntu_qrt_kernel_hardening.py 
index 26e837b9..fcd69880 100644
--- a/ubuntu_qrt_kernel_hardening/ubuntu_qrt_kernel_hardening.py
+++ b/ubuntu_qrt_kernel_hardening/ubuntu_qrt_kernel_hardening.py
@@ -27,8 +27,19 @@ class ubuntu_qrt_kernel_hardening(test.test):
      def setup(self):
-        shutil.rmtree('qa-regression-testing', ignore_errors=True)
-        cmd = 'git clone --depth 1 
+        # Kernel QA Automation already copies the qa-regression-testing
+        # repo over to the SUT(system under test) via rsync+ssh.
+        # This resolves issues with extremely long git clones. Causing
+        # tests to fail.
+        # If qa-regression-testing exists in the SUT Homedir, just move
+        # it over to the autotest workarea. If not, then clone it
+        targetpath = os.path.expanduser("~") + "/qa-regression-testing"
+        if os.path.isdir(targetpath):
+            cmd = 'mv %s .' % targetpath
+        else:
+            # If the directory does not exist, then lets clone it as 
this test
+            # is probably being run outside of ckct.
+            cmd = 'git clone --depth 1 
          self.results = utils.system_output(cmd, retain_output=True)
          # Print test suite HEAD SHA1 commit id for future reference
          os.chdir(os.path.join(self.srcdir, 'qa-regression-testing'))

More information about the kernel-team mailing list