teuthology 1.1.0__py3-none-any.whl → 1.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. scripts/describe.py +1 -0
  2. scripts/dispatcher.py +55 -26
  3. scripts/exporter.py +18 -0
  4. scripts/lock.py +1 -1
  5. scripts/node_cleanup.py +58 -0
  6. scripts/openstack.py +9 -9
  7. scripts/results.py +12 -11
  8. scripts/schedule.py +4 -0
  9. scripts/suite.py +57 -16
  10. scripts/supervisor.py +44 -0
  11. scripts/update_inventory.py +10 -4
  12. teuthology/__init__.py +24 -26
  13. teuthology/beanstalk.py +4 -3
  14. teuthology/config.py +16 -6
  15. teuthology/contextutil.py +18 -14
  16. teuthology/describe_tests.py +25 -18
  17. teuthology/dispatcher/__init__.py +210 -35
  18. teuthology/dispatcher/supervisor.py +140 -58
  19. teuthology/exceptions.py +43 -0
  20. teuthology/exporter.py +347 -0
  21. teuthology/kill.py +76 -81
  22. teuthology/lock/cli.py +3 -3
  23. teuthology/lock/ops.py +135 -61
  24. teuthology/lock/query.py +61 -44
  25. teuthology/ls.py +1 -1
  26. teuthology/misc.py +61 -75
  27. teuthology/nuke/__init__.py +12 -353
  28. teuthology/openstack/__init__.py +4 -3
  29. teuthology/openstack/openstack-centos-7.0-user-data.txt +1 -1
  30. teuthology/openstack/openstack-centos-7.1-user-data.txt +1 -1
  31. teuthology/openstack/openstack-centos-7.2-user-data.txt +1 -1
  32. teuthology/openstack/openstack-debian-8.0-user-data.txt +1 -1
  33. teuthology/openstack/openstack-opensuse-42.1-user-data.txt +1 -1
  34. teuthology/openstack/openstack-teuthology.cron +0 -1
  35. teuthology/orchestra/cluster.py +49 -7
  36. teuthology/orchestra/connection.py +17 -4
  37. teuthology/orchestra/console.py +111 -50
  38. teuthology/orchestra/daemon/cephadmunit.py +15 -2
  39. teuthology/orchestra/daemon/state.py +8 -1
  40. teuthology/orchestra/daemon/systemd.py +4 -4
  41. teuthology/orchestra/opsys.py +30 -11
  42. teuthology/orchestra/remote.py +405 -338
  43. teuthology/orchestra/run.py +3 -3
  44. teuthology/packaging.py +19 -16
  45. teuthology/provision/__init__.py +30 -10
  46. teuthology/provision/cloud/openstack.py +12 -6
  47. teuthology/provision/cloud/util.py +1 -2
  48. teuthology/provision/downburst.py +4 -3
  49. teuthology/provision/fog.py +68 -20
  50. teuthology/provision/openstack.py +5 -4
  51. teuthology/provision/pelagos.py +1 -1
  52. teuthology/repo_utils.py +43 -13
  53. teuthology/report.py +57 -35
  54. teuthology/results.py +5 -3
  55. teuthology/run.py +13 -14
  56. teuthology/run_tasks.py +27 -43
  57. teuthology/schedule.py +4 -3
  58. teuthology/scrape.py +28 -22
  59. teuthology/suite/__init__.py +74 -45
  60. teuthology/suite/build_matrix.py +34 -24
  61. teuthology/suite/fragment-merge.lua +105 -0
  62. teuthology/suite/matrix.py +31 -2
  63. teuthology/suite/merge.py +175 -0
  64. teuthology/suite/placeholder.py +6 -9
  65. teuthology/suite/run.py +175 -100
  66. teuthology/suite/util.py +64 -218
  67. teuthology/task/__init__.py +1 -1
  68. teuthology/task/ansible.py +101 -32
  69. teuthology/task/buildpackages.py +2 -2
  70. teuthology/task/ceph_ansible.py +13 -6
  71. teuthology/task/cephmetrics.py +2 -1
  72. teuthology/task/clock.py +33 -14
  73. teuthology/task/exec.py +18 -0
  74. teuthology/task/hadoop.py +2 -2
  75. teuthology/task/install/__init__.py +29 -7
  76. teuthology/task/install/bin/adjust-ulimits +16 -0
  77. teuthology/task/install/bin/daemon-helper +114 -0
  78. teuthology/task/install/bin/stdin-killer +263 -0
  79. teuthology/task/install/deb.py +1 -1
  80. teuthology/task/install/rpm.py +17 -5
  81. teuthology/task/install/util.py +3 -3
  82. teuthology/task/internal/__init__.py +41 -10
  83. teuthology/task/internal/edit_sudoers.sh +10 -0
  84. teuthology/task/internal/lock_machines.py +2 -9
  85. teuthology/task/internal/redhat.py +31 -1
  86. teuthology/task/internal/syslog.py +31 -8
  87. teuthology/task/kernel.py +152 -145
  88. teuthology/task/lockfile.py +1 -1
  89. teuthology/task/mpi.py +10 -10
  90. teuthology/task/pcp.py +1 -1
  91. teuthology/task/selinux.py +16 -8
  92. teuthology/task/ssh_keys.py +4 -4
  93. teuthology/timer.py +3 -3
  94. teuthology/util/loggerfile.py +19 -0
  95. teuthology/util/scanner.py +159 -0
  96. teuthology/util/sentry.py +52 -0
  97. teuthology/util/time.py +52 -0
  98. teuthology-1.2.1.data/scripts/adjust-ulimits +16 -0
  99. teuthology-1.2.1.data/scripts/daemon-helper +114 -0
  100. teuthology-1.2.1.data/scripts/stdin-killer +263 -0
  101. teuthology-1.2.1.dist-info/METADATA +88 -0
  102. teuthology-1.2.1.dist-info/RECORD +168 -0
  103. {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/WHEEL +1 -1
  104. {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/entry_points.txt +3 -2
  105. scripts/nuke.py +0 -47
  106. scripts/worker.py +0 -37
  107. teuthology/lock/test/__init__.py +0 -0
  108. teuthology/lock/test/test_lock.py +0 -7
  109. teuthology/nuke/actions.py +0 -456
  110. teuthology/openstack/test/__init__.py +0 -0
  111. teuthology/openstack/test/openstack-integration.py +0 -286
  112. teuthology/openstack/test/test_config.py +0 -35
  113. teuthology/openstack/test/test_openstack.py +0 -1695
  114. teuthology/orchestra/test/__init__.py +0 -0
  115. teuthology/orchestra/test/integration/__init__.py +0 -0
  116. teuthology/orchestra/test/integration/test_integration.py +0 -94
  117. teuthology/orchestra/test/test_cluster.py +0 -240
  118. teuthology/orchestra/test/test_connection.py +0 -106
  119. teuthology/orchestra/test/test_console.py +0 -217
  120. teuthology/orchestra/test/test_opsys.py +0 -404
  121. teuthology/orchestra/test/test_remote.py +0 -185
  122. teuthology/orchestra/test/test_run.py +0 -286
  123. teuthology/orchestra/test/test_systemd.py +0 -54
  124. teuthology/orchestra/test/util.py +0 -12
  125. teuthology/task/tests/__init__.py +0 -110
  126. teuthology/task/tests/test_locking.py +0 -25
  127. teuthology/task/tests/test_run.py +0 -40
  128. teuthology/test/__init__.py +0 -0
  129. teuthology/test/fake_archive.py +0 -107
  130. teuthology/test/fake_fs.py +0 -92
  131. teuthology/test/integration/__init__.py +0 -0
  132. teuthology/test/integration/test_suite.py +0 -86
  133. teuthology/test/task/__init__.py +0 -205
  134. teuthology/test/task/test_ansible.py +0 -624
  135. teuthology/test/task/test_ceph_ansible.py +0 -176
  136. teuthology/test/task/test_console_log.py +0 -88
  137. teuthology/test/task/test_install.py +0 -337
  138. teuthology/test/task/test_internal.py +0 -57
  139. teuthology/test/task/test_kernel.py +0 -243
  140. teuthology/test/task/test_pcp.py +0 -379
  141. teuthology/test/task/test_selinux.py +0 -35
  142. teuthology/test/test_config.py +0 -189
  143. teuthology/test/test_contextutil.py +0 -68
  144. teuthology/test/test_describe_tests.py +0 -316
  145. teuthology/test/test_email_sleep_before_teardown.py +0 -81
  146. teuthology/test/test_exit.py +0 -97
  147. teuthology/test/test_get_distro.py +0 -47
  148. teuthology/test/test_get_distro_version.py +0 -47
  149. teuthology/test/test_get_multi_machine_types.py +0 -27
  150. teuthology/test/test_job_status.py +0 -60
  151. teuthology/test/test_ls.py +0 -48
  152. teuthology/test/test_misc.py +0 -391
  153. teuthology/test/test_nuke.py +0 -290
  154. teuthology/test/test_packaging.py +0 -763
  155. teuthology/test/test_parallel.py +0 -28
  156. teuthology/test/test_repo_utils.py +0 -225
  157. teuthology/test/test_report.py +0 -77
  158. teuthology/test/test_results.py +0 -155
  159. teuthology/test/test_run.py +0 -239
  160. teuthology/test/test_safepath.py +0 -55
  161. teuthology/test/test_schedule.py +0 -45
  162. teuthology/test/test_scrape.py +0 -167
  163. teuthology/test/test_timer.py +0 -80
  164. teuthology/test/test_vps_os_vers_parameter_checking.py +0 -84
  165. teuthology/test/test_worker.py +0 -303
  166. teuthology/worker.py +0 -354
  167. teuthology-1.1.0.dist-info/METADATA +0 -76
  168. teuthology-1.1.0.dist-info/RECORD +0 -213
  169. {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/LICENSE +0 -0
  170. {teuthology-1.1.0.dist-info → teuthology-1.2.1.dist-info}/top_level.txt +0 -0
@@ -1,286 +0,0 @@
1
- #
2
- # Copyright (c) 2015, 2016 Red Hat, Inc.
3
- #
4
- # Author: Loic Dachary <loic@dachary.org>
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the "Software"), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in
14
- # all copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
- # THE SOFTWARE.
23
- #
24
- import argparse
25
- import logging
26
- import json
27
- import os
28
- import subprocess
29
- import tempfile
30
- import shutil
31
-
32
- import teuthology.lock
33
- import teuthology.lock.cli
34
- import teuthology.lock.query
35
- import teuthology.lock.util
36
- import teuthology.nuke
37
- import teuthology.misc
38
- import teuthology.schedule
39
- import teuthology.suite
40
- import teuthology.openstack
41
- import scripts.schedule
42
- import scripts.lock
43
- import scripts.suite
44
- from teuthology.config import config as teuth_config
45
- from teuthology.config import set_config_attr
46
-
47
-
48
- class Integration(object):
49
-
50
- @classmethod
51
- def setup_class(self):
52
- teuthology.log.setLevel(logging.DEBUG)
53
- set_config_attr(argparse.Namespace())
54
- self.teardown_class()
55
-
56
- @classmethod
57
- def teardown_class(self):
58
- os.system("sudo /etc/init.d/beanstalkd restart")
59
- # if this fails it will not show the error but some weird
60
- # INTERNALERROR> IndexError: list index out of range
61
- # move that to def tearDown for debug and when it works move it
62
- # back in tearDownClass so it is not called on every test
63
- ownedby = "ownedby='" + teuth_config.openstack['ip']
64
- all_instances = teuthology.openstack.OpenStack().run(
65
- "server list -f json --long")
66
- for instance in json.loads(all_instances):
67
- if ownedby in instance['Properties']:
68
- teuthology.openstack.OpenStack().run(
69
- "server delete --wait " + instance['ID'])
70
-
71
- def setup_worker(self):
72
- self.logs = self.d + "/log"
73
- os.mkdir(self.logs, 0o755)
74
- self.archive = self.d + "/archive"
75
- os.mkdir(self.archive, 0o755)
76
- self.worker_cmd = ("teuthology-worker --tube openstack " +
77
- "-l " + self.logs + " "
78
- "--archive-dir " + self.archive + " ")
79
- logging.info(self.worker_cmd)
80
- self.worker = subprocess.Popen(self.worker_cmd,
81
- stdout=subprocess.PIPE,
82
- stderr=subprocess.PIPE,
83
- shell=True)
84
-
85
- def wait_worker(self):
86
- if not self.worker:
87
- return
88
-
89
- (stdoutdata, stderrdata) = self.worker.communicate()
90
- stdoutdata = stdoutdata.decode('utf-8')
91
- stderrdata = stderrdata.decode('utf-8')
92
- logging.info(self.worker_cmd + ":" +
93
- " stdout " + stdoutdata +
94
- " stderr " + stderrdata + " end ")
95
- assert self.worker.returncode == 0
96
- self.worker = None
97
-
98
- def get_teuthology_log(self):
99
- # the archive is removed before each test, there must
100
- # be only one run and one job
101
- run = os.listdir(self.archive)[0]
102
- job = os.listdir(os.path.join(self.archive, run))[0]
103
- path = os.path.join(self.archive, run, job, 'teuthology.log')
104
- return open(path, 'r').read()
105
-
106
- class TestSuite(Integration):
107
-
108
- def setup(self):
109
- self.d = tempfile.mkdtemp()
110
- self.setup_worker()
111
- logging.info("TestSuite: done worker")
112
-
113
- def teardown(self):
114
- self.wait_worker()
115
- shutil.rmtree(self.d)
116
-
117
- def test_suite_noop(self):
118
- cwd = os.getcwd()
119
- os.mkdir(self.d + '/upload', 0o755)
120
- upload = 'localhost:' + self.d + '/upload'
121
- args = ['--suite', 'noop',
122
- '--suite-dir', cwd + '/teuthology/openstack/test',
123
- '--machine-type', 'openstack',
124
- '--archive-upload', upload,
125
- '--verbose']
126
- logging.info("TestSuite:test_suite_noop")
127
- scripts.suite.main(args)
128
- self.wait_worker()
129
- log = self.get_teuthology_log()
130
- assert "teuthology.run:pass" in log
131
- assert "Well done" in log
132
- upload_key = teuth_config.archive_upload_key
133
- if upload_key:
134
- ssh = "RSYNC_RSH='ssh -i " + upload_key + "'"
135
- else:
136
- ssh = ''
137
- assert 'teuthology.log' in teuthology.misc.sh(ssh + " rsync -av " + upload)
138
-
139
- def test_suite_nuke(self):
140
- cwd = os.getcwd()
141
- args = ['--suite', 'nuke',
142
- '--suite-dir', cwd + '/teuthology/openstack/test',
143
- '--machine-type', 'openstack',
144
- '--verbose']
145
- logging.info("TestSuite:test_suite_nuke")
146
- scripts.suite.main(args)
147
- self.wait_worker()
148
- log = self.get_teuthology_log()
149
- assert "teuthology.run:FAIL" in log
150
- locks = teuthology.lock.query.list_locks(locked=True)
151
- assert len(locks) == 0
152
-
153
- class TestSchedule(Integration):
154
-
155
- def setup(self):
156
- self.d = tempfile.mkdtemp()
157
- self.setup_worker()
158
-
159
- def teardown(self):
160
- self.wait_worker()
161
- shutil.rmtree(self.d)
162
-
163
- def test_schedule_stop_worker(self):
164
- job = 'teuthology/openstack/test/stop_worker.yaml'
165
- args = ['--name', 'fake',
166
- '--verbose',
167
- '--owner', 'test@test.com',
168
- '--worker', 'openstack',
169
- job]
170
- scripts.schedule.main(args)
171
- self.wait_worker()
172
-
173
- def test_schedule_noop(self):
174
- job = 'teuthology/openstack/test/noop.yaml'
175
- args = ['--name', 'fake',
176
- '--verbose',
177
- '--owner', 'test@test.com',
178
- '--worker', 'openstack',
179
- job]
180
- scripts.schedule.main(args)
181
- self.wait_worker()
182
- log = self.get_teuthology_log()
183
- assert "teuthology.run:pass" in log
184
- assert "Well done" in log
185
-
186
- def test_schedule_resources_hint(self):
187
- """It is tricky to test resources hint in a provider agnostic way. The
188
- best way seems to ask for at least 1GB of RAM and 10GB
189
- disk. Some providers do not offer a 1GB RAM flavor (OVH for
190
- instance) and the 2GB RAM will be chosen instead. It however
191
- seems unlikely that a 4GB RAM will be chosen because it would
192
- mean such a provider has nothing under that limit and it's a
193
- little too high.
194
-
195
- Since the default when installing is to ask for 7000 MB, we
196
- can reasonably assume that the hint has been taken into
197
- account if the instance has less than 4GB RAM.
198
- """
199
- try:
200
- teuthology.openstack.OpenStack().run("volume list")
201
- job = 'teuthology/openstack/test/resources_hint.yaml'
202
- has_cinder = True
203
- except subprocess.CalledProcessError:
204
- job = 'teuthology/openstack/test/resources_hint_no_cinder.yaml'
205
- has_cinder = False
206
- args = ['--name', 'fake',
207
- '--verbose',
208
- '--owner', 'test@test.com',
209
- '--worker', 'openstack',
210
- job]
211
- scripts.schedule.main(args)
212
- self.wait_worker()
213
- log = self.get_teuthology_log()
214
- assert "teuthology.run:pass" in log
215
- assert "RAM size ok" in log
216
- if has_cinder:
217
- assert "Disk size ok" in log
218
-
219
- class TestLock(Integration):
220
-
221
- def setup(self):
222
- self.options = ['--verbose',
223
- '--machine-type', 'openstack' ]
224
-
225
- def test_main(self):
226
- args = scripts.lock.parse_args(self.options + ['--lock'])
227
- assert teuthology.lock.cli.main(args) == 0
228
-
229
- def test_lock_unlock(self):
230
- default_archs = teuthology.openstack.OpenStack().get_available_archs()
231
- if 'TEST_IMAGES' in os.environ:
232
- images = os.environ['TEST_IMAGES'].split()
233
- else:
234
- images = teuthology.openstack.OpenStack.image2url.keys()
235
- for image in images:
236
- (os_type, os_version, arch) = image.split('-')
237
- if arch not in default_archs:
238
- logging.info("skipping " + image + " because arch " +
239
- " is not supported (" + str(default_archs) + ")")
240
- continue
241
- args = scripts.lock.parse_args(self.options +
242
- ['--lock-many', '1',
243
- '--os-type', os_type,
244
- '--os-version', os_version,
245
- '--arch', arch])
246
- assert teuthology.lock.cli.main(args) == 0
247
- locks = teuthology.lock.query.list_locks(locked=True)
248
- assert len(locks) == 1
249
- args = scripts.lock.parse_args(self.options +
250
- ['--unlock', locks[0]['name']])
251
- assert teuthology.lock.cli.main(args) == 0
252
-
253
- def test_list(self, capsys):
254
- args = scripts.lock.parse_args(self.options + ['--list', '--all'])
255
- teuthology.lock.cli.main(args)
256
- out, err = capsys.readouterr()
257
- assert 'machine_type' in out
258
- assert 'openstack' in out
259
-
260
- class TestNuke(Integration):
261
-
262
- def setup(self):
263
- self.options = ['--verbose',
264
- '--machine-type', 'openstack']
265
-
266
- def test_nuke(self):
267
- image = next(iter(teuthology.openstack.OpenStack.image2url.keys()))
268
-
269
- (os_type, os_version, arch) = image.split('-')
270
- args = scripts.lock.parse_args(self.options +
271
- ['--lock-many', '1',
272
- '--os-type', os_type,
273
- '--os-version', os_version])
274
- assert teuthology.lock.cli.main(args) == 0
275
- locks = teuthology.lock.query.list_locks(locked=True)
276
- logging.info('list_locks = ' + str(locks))
277
- assert len(locks) == 1
278
- ctx = argparse.Namespace(name=None,
279
- config={
280
- 'targets': { locks[0]['name']: None },
281
- },
282
- owner=locks[0]['locked_by'],
283
- teuthology_config={})
284
- teuthology.nuke.nuke(ctx, should_unlock=True)
285
- locks = teuthology.lock.query.list_locks(locked=True)
286
- assert len(locks) == 0
@@ -1,35 +0,0 @@
1
- from teuthology.config import config
2
-
3
-
4
- class TestOpenStack(object):
5
-
6
- def setup(self):
7
- self.openstack_config = config['openstack']
8
-
9
- def test_config_clone(self):
10
- assert 'clone' in self.openstack_config
11
-
12
- def test_config_user_data(self):
13
- os_type = 'rhel'
14
- os_version = '7.0'
15
- template_path = self.openstack_config['user-data'].format(
16
- os_type=os_type,
17
- os_version=os_version)
18
- assert os_type in template_path
19
- assert os_version in template_path
20
-
21
- def test_config_ip(self):
22
- assert 'ip' in self.openstack_config
23
-
24
- def test_config_machine(self):
25
- assert 'machine' in self.openstack_config
26
- machine_config = self.openstack_config['machine']
27
- assert 'disk' in machine_config
28
- assert 'ram' in machine_config
29
- assert 'cpus' in machine_config
30
-
31
- def test_config_volumes(self):
32
- assert 'volumes' in self.openstack_config
33
- volumes_config = self.openstack_config['volumes']
34
- assert 'count' in volumes_config
35
- assert 'size' in volumes_config