[PATCH v2 1/1] ubuntu_lxc: lxc-tests is deprecated - fetch tests from origin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH v2 1/1] ubuntu_lxc: lxc-tests is deprecated - fetch tests from origin

Khaled Elmously
From: Khalid El Mously <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1772507

The lxc-tests package doesn't exist in Bionic and later. For those releases, clone the 'lxc' repo from github and copy the tests to /usr/bin

Tested on Xenial and Bionic


Signed-off-by: Khalid Elmously <[hidden email]>
---
 ubuntu_lxc/ubuntu_lxc.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/ubuntu_lxc/ubuntu_lxc.py b/ubuntu_lxc/ubuntu_lxc.py
index 7bdd1996..38aaf829 100644
--- a/ubuntu_lxc/ubuntu_lxc.py
+++ b/ubuntu_lxc/ubuntu_lxc.py
@@ -7,19 +7,26 @@ class ubuntu_lxc(test.test):
     version = 1
 
     def install_required_pkgs(self):
-        arch   = platform.processor()
         series = platform.dist()[2]
 
         pkgs = [
-            'lxc-tests',
             'liblxc1'
         ]
 
-        cmd = 'apt-get install --yes --force-yes ' + ' '.join(pkgs)
+        if series in ['precise', 'trusty', 'xenial', 'artful']:
+            pkgs.append('lxc-tests')
+        else:
+            pkgs.append('lxc-utils')
+
+        cmd = 'apt-get install --yes ' + ' '.join(pkgs)
         self.results = utils.system_output(cmd, retain_output=True)
 
     def initialize(self):
         self.install_required_pkgs()
+        series = platform.dist()[2]
+        if series not in ['precise', 'trusty', 'xenial', 'artful']:
+            self.results = utils.system_output('git clone https://github.com/lxc/lxc.git', retain_output=True)
+            self.results = utils.system_output('sudo find lxc/src/tests -type f -name "lxc-test-*" -executable -exec cp {} /usr/bin/ \;', retain_output=True)
 
     def run_once(self, test_name):
         cmd = '/bin/sh %s/exercise' % self.bindir
--
2.17.0


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK/cmnt: [PATCH v2 1/1] ubuntu_lxc: lxc-tests is deprecated - fetch tests from origin

Po-Hsu Lin (Sam)
This patch is good, but I just found that not all test binaries were
pre-built there.

Compare the test result from Artful, there are 39 tests shipped by the
lxc-test package, but only 10 pre-built executables from the repo.

Consider this can be fixed in the next step, I will give my ack here.
Thanks.

Acked-by: Po-Hsu Lin <[hidden email]>

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Applied: [PATCH v2 1/1] ubuntu_lxc: lxc-tests is deprecated - fetch tests from origin

brad.figg
In reply to this post by Khaled Elmously