Merge ~canonical-kernel-team/+git/autotest-client-tests:phlin/cyclictest-build into ~canonical-kernel-team/+git/autotest-client-tests:master

Proposed by Po-Hsu Lin
Status: Merged
Merge reported by: Po-Hsu Lin
Merged at revision: a9a29c0fc4ea3b26e5196fa2a8f27d39a51bfdb6
Proposed branch: ~canonical-kernel-team/+git/autotest-client-tests:phlin/cyclictest-build
Merge into: ~canonical-kernel-team/+git/autotest-client-tests:master
Diff against target: 54 lines (+25/-2)
2 files modified
cyclictest/control (+3/-1)
cyclictest/cyclictest.py (+22/-1)
Reviewer Review Type Date Requested Status
Sean Feole Approve
Review via email: mp+455127@code.launchpad.net

Commit message

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

This test will need gcc to run. Also add a setup task to separate
test build phase and actual test phase.

To post a comment you must log in.
Revision history for this message
Sean Feole (sfeole) wrote :

+1

review: Approve
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

Applied and pushed, thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/cyclictest/control b/cyclictest/control
index 51ce596..45ffc4c 100644
--- a/cyclictest/control
+++ b/cyclictest/control
@@ -10,4 +10,6 @@ TEST_CLASS = 'kernel'
10TEST_CATEGORY = 'Functional'10TEST_CATEGORY = 'Functional'
11TEST_TYPE = 'client'11TEST_TYPE = 'client'
1212
13job.run_test('cyclictest')13result = job.run_test_detail('cyclictest', test_name='setup', tag='setup', timeout=60*5)
14if result == 'GOOD':
15 job.run_test('cyclictest', test_name='cyclictest', tag='cyclictest')
diff --git a/cyclictest/cyclictest.py b/cyclictest/cyclictest.py
index 29bb48b..eabc6fe 100644
--- a/cyclictest/cyclictest.py
+++ b/cyclictest/cyclictest.py
@@ -1,4 +1,5 @@
1import os1import os
2import platform
2from autotest.client import test3from autotest.client import test
3from autotest.client.shared import utils4from autotest.client.shared import utils
45
@@ -11,10 +12,30 @@ class cyclictest(test.test):
11 def initialize(self):12 def initialize(self):
12 pass13 pass
1314
15 def install_required_pkgs(self):
16 arch = platform.processor()
17 try:
18 series = platform.dist()[2]
19 except AttributeError:
20 import distro
21 series = distro.codename()
22
23 pkgs = [
24 'build-essential',
25 ]
26 gcc = 'gcc' if arch in ['ppc64le', 'aarch64', 's390x', 'riscv64'] else 'gcc-multilib'
27 pkgs.append(gcc)
28
29 cmd = 'yes "" | DEBIAN_FRONTEND=noninteractive apt-get install --yes --force-yes ' + ' '.join(pkgs)
30 self.results = utils.system_output(cmd, retain_output=True)
31
14 def setup(self):32 def setup(self):
33 self.install_required_pkgs()
15 self.job.require_gcc()34 self.job.require_gcc()
16 os.chdir(self.srcdir)35 os.chdir(self.srcdir)
17 utils.make()36 utils.make()
1837
19 def execute(self, args='-t 10 -l 100000'):38 def run_once(self, test_name, args='-t 10 -l 100000'):
39 if test_name == 'setup':
40 return
20 utils.system(self.srcdir + '/cyclictest ' + args)41 utils.system(self.srcdir + '/cyclictest ' + args)

Subscribers

People subscribed via source and target branches

to all changes: