Merge ~kevinbecker/+git/autotest-client-tests:kevinbecker/pi into ~canonical-kernel-team/+git/autotest-client-tests:master

Proposed by Kevin Becker
Status: Merged
Merged at revision: 69af931e518166716d5ca870d575e3d3bfa00b2b
Proposed branch: ~kevinbecker/+git/autotest-client-tests:kevinbecker/pi
Merge into: ~canonical-kernel-team/+git/autotest-client-tests:master
Diff against target: 216 lines (+192/-0)
4 files modified
rt_tests_pi_stress/control (+21/-0)
rt_tests_pi_stress/rt_tests_pi_stress.py (+74/-0)
rt_tests_pip_stress/control (+21/-0)
rt_tests_pip_stress/rt_tests_pip_stress.py (+76/-0)
Reviewer Review Type Date Requested Status
Francis Ginther Approve
Sean Feole Pending
Canonical Kernel Team Pending
Review via email: mp+463206@code.launchpad.net

Commit message

UBUNTU: SAUCE: Added pip_stress and pi_stress tests from upstream

Signed-off-by: Kevin Becker <email address hidden>

To post a comment you must log in.
Revision history for this message
Francis Ginther (fginther) wrote :

New tests, look reasonable.
+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/rt_tests_pi_stress/control b/rt_tests_pi_stress/control
2new file mode 100644
3index 0000000..267a1cf
4--- /dev/null
5+++ b/rt_tests_pi_stress/control
6@@ -0,0 +1,21 @@
7+AUTHOR = '''
8+Authors:
9+Clark Williams <williams@redhat.com>
10+John Kacur <jkacur@redhat.com>
11+ '''
12+NAME = "pi_stress"
13+DOC = '''
14+description rt test utils
15+URL https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
16+'''
17+SUITE = "None"
18+TIME = "MEDIUM"
19+TEST_CLASS = 'kernel'
20+TEST_CATEGORY = 'Functional'
21+TEST_TYPE = 'client'
22+
23+result = job.run_test_detail('rt_tests_pi_stress', test_name='setup', tag='setup', timeout=60*5)
24+if result == 'GOOD':
25+ job.run_test('rt_tests_pi_stress', test_name='rt_tests_pi_stress', tag='rt_tests_pi_stress')
26+else:
27+ print("ERROR: test failed to build")
28diff --git a/rt_tests_pi_stress/rt_tests_pi_stress.py b/rt_tests_pi_stress/rt_tests_pi_stress.py
29new file mode 100644
30index 0000000..a35ec32
31--- /dev/null
32+++ b/rt_tests_pi_stress/rt_tests_pi_stress.py
33@@ -0,0 +1,74 @@
34+import multiprocessing
35+import os
36+import platform
37+import re
38+import shutil
39+from autotest.client import canonical, test, utils
40+from autotest.client.shared import error
41+
42+class rt_tests_pi_stress(test.test):
43+ version = 1
44+
45+ def initialize(self):
46+ self.flavour = re.split('-\d*-', platform.uname()[2])[-1]
47+ self.arch = platform.processor()
48+
49+ def install_required_pkgs(self):
50+ try:
51+ series = platform.dist()[2]
52+ except AttributeError:
53+ import distro
54+ series = distro.codename()
55+
56+ pkgs = [
57+ 'build-essential',
58+ 'git',
59+ 'libnuma-dev',
60+ ]
61+ gcc = 'gcc' if self.arch in ['ppc64le', 'aarch64', 's390x', 'riscv64'] else 'gcc-multilib'
62+ pkgs.append(gcc)
63+
64+ cmd = 'yes "" | DEBIAN_FRONTEND=noninteractive apt-get install --yes --force-yes ' + ' '.join(pkgs)
65+ self.results = utils.system_output(cmd, retain_output=True)
66+
67+ # setup
68+ #
69+ # Automatically run when there is no autotest/client/tmp/<test-suite> directory
70+ #
71+ def setup(self):
72+ self.install_required_pkgs()
73+ self.job.require_gcc()
74+ os.chdir(self.srcdir)
75+ shutil.rmtree('rt-tests', ignore_errors=True)
76+ canonical.setup_proxy()
77+ branch = 'main'
78+ cmd = 'git clone -b {} https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git'.format(branch)
79+ utils.system_output(cmd, retain_output=True)
80+
81+ # Print test suite HEAD SHA1 commit id for future reference
82+ os.chdir(os.path.join(self.srcdir, 'rt-tests'))
83+ title_local = utils.system_output("git log --oneline -1 | sed 's/(.*)//'", retain_output=False, verbose=False)
84+ title_upstream = utils.system_output("git log --oneline | grep -v SAUCE | head -1", retain_output=False, verbose=False)
85+ print("Latest commit in '{}' branch: {}".format(branch, title_local))
86+ print("Latest upstream commit: {}".format(title_upstream))
87+
88+ try:
89+ nprocs = '-j' + str(multiprocessing.cpu_count())
90+ except:
91+ nprocs = ''
92+ utils.make(nprocs)
93+
94+
95+ # run_once
96+ #
97+ # Driven by the control file for each individual test.
98+ #
99+ # Runs pi_stress for 60 seconds. This is just for data gathering purposes for now.
100+ #
101+ def run_once(self, test_name, args=' -D 60 -m', exit_on_error=True):
102+ if test_name == 'setup':
103+ return
104+
105+ utils.system_output(self.srcdir + '/rt-tests/pi_stress ' + args, retain_output=True)
106+
107+ return
108diff --git a/rt_tests_pip_stress/control b/rt_tests_pip_stress/control
109new file mode 100644
110index 0000000..3da1561
111--- /dev/null
112+++ b/rt_tests_pip_stress/control
113@@ -0,0 +1,21 @@
114+AUTHOR = '''
115+Authors:
116+Clark Williams <williams@redhat.com>
117+John Kacur <jkacur@redhat.com>
118+ '''
119+NAME = "pip_stress"
120+DOC = '''
121+description rt test utils
122+URL https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git
123+'''
124+SUITE = "None"
125+TIME = "MEDIUM"
126+TEST_CLASS = 'kernel'
127+TEST_CATEGORY = 'Functional'
128+TEST_TYPE = 'client'
129+
130+result = job.run_test_detail('rt_tests_pip_stress', test_name='setup', tag='setup', timeout=60*5)
131+if result == 'GOOD':
132+ job.run_test('rt_tests_pip_stress', test_name='rt_tests_pip_stress', tag='rt_tests_pip_stress')
133+else:
134+ print("ERROR: test failed to build")
135diff --git a/rt_tests_pip_stress/rt_tests_pip_stress.py b/rt_tests_pip_stress/rt_tests_pip_stress.py
136new file mode 100644
137index 0000000..483828d
138--- /dev/null
139+++ b/rt_tests_pip_stress/rt_tests_pip_stress.py
140@@ -0,0 +1,76 @@
141+import multiprocessing
142+import os
143+import platform
144+import re
145+import shutil
146+from autotest.client import canonical, test, utils
147+from autotest.client.shared import error
148+
149+class rt_tests_pip_stress(test.test):
150+ version = 1
151+
152+ def initialize(self):
153+ self.flavour = re.split('-\d*-', platform.uname()[2])[-1]
154+ self.arch = platform.processor()
155+
156+ def install_required_pkgs(self):
157+ try:
158+ series = platform.dist()[2]
159+ except AttributeError:
160+ import distro
161+ series = distro.codename()
162+
163+ pkgs = [
164+ 'build-essential',
165+ 'git',
166+ 'libnuma-dev',
167+ ]
168+ gcc = 'gcc' if self.arch in ['ppc64le', 'aarch64', 's390x', 'riscv64'] else 'gcc-multilib'
169+ pkgs.append(gcc)
170+
171+ cmd = 'yes "" | DEBIAN_FRONTEND=noninteractive apt-get install --yes --force-yes ' + ' '.join(pkgs)
172+ self.results = utils.system_output(cmd, retain_output=True)
173+
174+ # setup
175+ #
176+ # Automatically run when there is no autotest/client/tmp/<test-suite> directory
177+ #
178+ def setup(self):
179+ self.install_required_pkgs()
180+ self.job.require_gcc()
181+ os.chdir(self.srcdir)
182+ shutil.rmtree('rt-tests', ignore_errors=True)
183+ canonical.setup_proxy()
184+ branch = 'main'
185+ cmd = 'git clone -b {} https://git.kernel.org/pub/scm/utils/rt-tests/rt-tests.git'.format(branch)
186+ utils.system_output(cmd, retain_output=True)
187+
188+ # Print test suite HEAD SHA1 commit id for future reference
189+ os.chdir(os.path.join(self.srcdir, 'rt-tests'))
190+ title_local = utils.system_output("git log --oneline -1 | sed 's/(.*)//'", retain_output=False, verbose=False)
191+ title_upstream = utils.system_output("git log --oneline | grep -v SAUCE | head -1", retain_output=False, verbose=False)
192+ print("Latest commit in '{}' branch: {}".format(branch, title_local))
193+ print("Latest upstream commit: {}".format(title_upstream))
194+
195+ try:
196+ nprocs = '-j' + str(multiprocessing.cpu_count())
197+ except:
198+ nprocs = ''
199+ utils.make(nprocs)
200+
201+
202+ # run_once
203+ #
204+ # Driven by the control file for each individual test.
205+ #
206+ # Runs pip_stress. This is mainly for data gathering purposes for now,
207+ # but there is a pass/fail on execution time. The test should complete
208+ # almost immediately, so it has a timeout of 1s to show if there is a failure.
209+ #
210+ def run_once(self, test_name, args='', exit_on_error=True):
211+ if test_name == 'setup':
212+ return
213+
214+ utils.system_output(self.srcdir + '/rt-tests/pip_stress ' + args, timeout=1, retain_output=True)
215+
216+ return

Subscribers

People subscribed via source and target branches