diff mbox series

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

Message ID 9b258004-38e3-99c9-62c0-a6271a1a2c5f@canonical.com
State New
Headers show
Series [ACT] UBUNTU: SAUCE: ubuntu_qrt_kernel_hardening: resolve lengthy git clones | expand

Commit Message

Sean Feole July 21, 2021, 3:26 p.m. UTC
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@canonical.com>
---
  .../ubuntu_qrt_kernel_hardening.py                | 15 +++++++++++++--
  1 file changed, 13 insertions(+), 2 deletions(-)

          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'))
diff mbox series

Patch

diff --git a/ubuntu_qrt_kernel_hardening/ubuntu_qrt_kernel_hardening.py 
b/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):
          self.install_required_pkgs()
          os.chdir(self.srcdir)
-        shutil.rmtree('qa-regression-testing', ignore_errors=True)
-        cmd = 'git clone --depth 1 
https://git.launchpad.net/qa-regression-testing'
+        # 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 
https://git.launchpad.net/qa-regression-testing'