Merge lp:~canonical-platform-qa/ubuntu-system-tests/add-new-packages into lp:ubuntu-system-tests

Proposed by Richard Huddie
Status: Merged
Approved by: Allan LeSage
Approved revision: 408
Merged at revision: 387
Proposed branch: lp:~canonical-platform-qa/ubuntu-system-tests/add-new-packages
Merge into: lp:ubuntu-system-tests
Diff against target: 768 lines (+306/-63)
28 files modified
README.rst (+80/-0)
debian/control (+52/-4)
debian/tests/control (+2/-0)
debian/ubuntu-system-tests-common.install (+2/-0)
debian/ubuntu-system-tests-helpers.install (+1/-0)
debian/ubuntu-system-tests-host.install (+9/-0)
debian/ubuntu-system-tests-suite.install (+3/-0)
setup.py (+3/-3)
ubuntu_system_tests/__init__.py (+19/-0)
ubuntu_system_tests/common/__init__.py (+24/-0)
ubuntu_system_tests/common/config.py (+1/-1)
ubuntu_system_tests/common/ssh.py (+1/-1)
ubuntu_system_tests/helpers/file_system.py (+5/-13)
ubuntu_system_tests/helpers/ssh.py (+1/-1)
ubuntu_system_tests/helpers/testbed.py (+1/-1)
ubuntu_system_tests/host/__init__.py (+19/-0)
ubuntu_system_tests/host/command_line.py (+26/-7)
ubuntu_system_tests/run.py (+31/-0)
ubuntu_system_tests/selftests/__init__.py (+1/-1)
ubuntu_system_tests/selftests/test_command_line.py (+6/-8)
ubuntu_system_tests/selftests/test_config.py (+5/-7)
ubuntu_system_tests/selftests/test_results.py (+3/-5)
ubuntu_system_tests/selftests/test_testbed_commands.py (+1/-1)
ubuntu_system_tests/selftests/test_tests_to_run.py (+3/-3)
ubuntu_system_tests/systemtests/__init__.py (+4/-4)
ubuntu_system_tests/tests/base_telephony.py (+1/-1)
ubuntu_system_tests/tests/perf/__init__.py (+1/-1)
ubuntu_system_tests/tests/test_settings_wizard.py (+1/-1)
To merge this branch: bzr merge lp:~canonical-platform-qa/ubuntu-system-tests/add-new-packages
Reviewer Review Type Date Requested Status
Allan LeSage (community) Approve
platform-qa-bot continuous-integration Approve
Review via email: mp+294378@code.launchpad.net

Commit message

Create packaging to allow ubuntu-system-tests installation and execution from installed location.

Description of the change

Creates new deb packages:
- ubuntu-system-tests-host - This is the test runner scripts for the host
- ubuntu-system-tests-helpers - This is the helpers
- ubuntu-system-tests-suite - This is the test cases and test data
- ubuntu-system-tests-common - This is shared scripts
- ubuntu-system-tests - This includes all of the above

To test installing the packages for this change you need to install my own ppa on the device and host. This is required only before the MP lands in trunk, after which the packages will automatically be published in canonical-platform-qa/ppa.

To add my ppa do the following on both the host and device:
sudo add-apt-repository ppa:rhuddie/ust && sudo apt-get update

To install the host scripts to run the tests from the host:
sudo apt-get install ubuntu-system-tests-host

run "ubuntu-system-tests --help" to make sure its working ok.

Then you can run some tests on the device using "ubuntu-system-tests" with whatever normal command options you use. When running the tests from installed location you should see autopilot log "Loading tests from: /usr/lib/python3/dist-packages", rather than a local source dir.

You can also install everything on the host and list the tests by doing:
sudo apt-get install ubuntu-system-tests
autopilot3 list ubuntu_system_tests.tests

This MP makes some changes to the structure of the project. So there are now common and host folders added under ubuntu_system_tests. The previous command_line.py file is now moved to host folder, and replaced by run.py under the main folder.

Other changes include updating import paths to use the new folder structure and fixing the selftests.

Once this change lands then any jenkins scripts referencing ubuntu_system_tests.command_line will need to be updated to use ubuntu_system_tests.run. See additional MP for that:
https://code.launchpad.net/~canonical-platform-qa/qa-jenkins-jobs/use-ubuntu-system-tests-run/+merge/294620

To post a comment you must log in.
Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Needs Fixing (continuous-integration)
406. By Richard Huddie

Remove config dir.

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Santiago Baldassin (sbaldassin) wrote :

Thanks for the patch Richard. I've just added a minor comment to refactor the clen_dir using os.walk

407. By Richard Huddie

Use os.walk in clean_dir, move remove_dir back into file_system helpers as no longer needed in common.

408. By Richard Huddie

Merge from trunk.

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Richard Huddie (rhuddie) wrote :

> Thanks for the patch Richard. I've just added a minor comment to refactor the
> clen_dir using os.walk

Thanks Santiago, I've made that change.

Revision history for this message
platform-qa-bot (platform-qa-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Allan LeSage (allanlesage) wrote :

We'll attempt to land this presently.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README.rst'
2--- README.rst 2016-05-03 19:04:34 +0000
3+++ README.rst 2016-05-13 10:11:11 +0000
4@@ -3,6 +3,86 @@
5
6 Project to automate the existing system test suite for the Ubuntu Touch images.
7
8+Project packages
9+----------------
10+
11+The ubuntu-system-tests project is split into 4 main packages:
12+ubuntu-system-tests-host
13+ubuntu-system-tests-helpers
14+ubuntu-system-tests-suite
15+ubuntu-system-tests-common
16+
17+ubuntu-system-tests-host package contains all the scripts neccessary to run the
18+tests from a host machine on a connected device. This package should be
19+installed on the host.
20+
21+ubuntu-system-tests-helpers package contains all the autopilot custom proxy
22+object helpers used by the tests. This package is installed automatically
23+on the device being tested.
24+
25+ubuntu-system-tests-suite package contains all the test cases and test data
26+required for running the tests. This package is installed automatically on
27+the device being tested.
28+
29+ubuntu-system-tests-common package contains common scripts shared by the other
30+packages and is installed automatically.
31+
32+The ubuntu-system-tests package includes all of the 4 above packages.
33+
34+
35+Installing on host
36+------------------
37+
38+To install ubuntu-system-tests-host scripts on the host machine:
39+
40+::
41+
42+ $ sudo add-apt-repository ppa:canonical-platform-qa/ppa
43+ $ sudo apt-get update
44+ $ sudo apt-get install ubuntu-system-tests-host
45+
46+This will install the test runner scripts only.
47+
48+To see command options run:
49+
50+::
51+
52+ $ ubuntu-system-tests --help
53+
54+
55+Listing all available tests
56+---------------------------
57+
58+If you wish to list all available tests on the host machine install the
59+ubuntu-system-tests package:
60+
61+::
62+
63+ $ sudo apt-get install ubuntu-system-tests
64+
65+This will install all test cases onto the host machine so they can be listed.
66+
67+To list the tests run:
68+
69+::
70+
71+ $ autopilot3 list ubuntu_system_tests.tests
72+
73+
74+Branching the project
75+---------------------
76+
77+In order to debug and develop new tests for ubuntu-system-tests the code must
78+be branched locally. Tests will then be run against the branched version
79+of the code rather than the installed version. To branch the code run:
80+
81+::
82+
83+ $ bzr branch lp:ubuntu-system-tests
84+
85+The remainder of the document assumes that code is branched locally.
86+
87+
88 Run the project self tests
89 --------------------------
90
91
92=== modified file 'debian/control'
93--- debian/control 2016-04-28 09:51:01 +0000
94+++ debian/control 2016-05-13 10:11:11 +0000
95@@ -1,7 +1,7 @@
96 Source: ubuntu-system-tests
97 Section: python
98 Priority: optional
99-Maintainer: Christopher Lee <chris.lee@canonical.com>
100+Maintainer: Canonical Platform QA Team <qa-team@lists.canonical.com>
101 Build-Depends: debhelper (>= 9),
102 dh-python,
103 openssh-server,
104@@ -20,9 +20,57 @@
105 Architecture: all
106 Depends: ${misc:Depends},
107 ${python3:Depends},
108+ ubuntu-system-tests-helpers,
109+ ubuntu-system-tests-host,
110+ ubuntu-system-tests-suite,
111+Description: Automated system test suite for UEQA.
112+ Provides the whole ubuntu-system-tests package. Includes the host package to
113+ run the tests on a target device from host machine, helpers package which
114+ includes the autopilot custom proxy object helpers for each application, and
115+ suite package which provides the test cases and test data.
116+
117+Package: ubuntu-system-tests-host
118+Architecture: all
119+Depends: ${misc:Depends},
120+ ${python3:Depends},
121+ subunit,
122+ ubuntu-system-tests-common,
123+Description: Host test runner
124+ This package contains scripts for running ubuntu-system-tests on a target
125+ device from a host machine.
126+
127+Package: ubuntu-system-tests-helpers
128+Architecture: all
129+Depends: ${misc:Depends},
130+ ${python3:Depends},
131+ ubuntu-system-tests-common,
132+Description: Ubuntu-system-tests autopilot helpers
133+ This package contains all of the autopilot custom proxy object helpers for
134+ each application used within ubuntu-system-tests.
135+
136+Package: ubuntu-system-tests-common
137+Architecture: all
138+Depends: ${misc:Depends},
139+ ${python3:Depends},
140 python3-dbus,
141+ python3-debian,
142+ python3-gi,
143+ python3-paramiko,
144+ python3-pexpect,
145+ python3-requests,
146+ python3-retrying,
147 python3-testtools,
148- subunit,
149+ python3-warlock,
150+Description: Ubuntu-system-tests common scripts
151+ This package contains common scripts used by the ubuntu-system-tests host,
152+ helpers and suite packages.
153+
154+Package: ubuntu-system-tests-suite
155+Architecture: all
156+Depends: ${misc:Depends},
157+ ${python3:Depends},
158+ python3-autopilot,
159+ ubuntu-system-tests-common,
160 unity8-autopilot,
161-Description: Automation for UEQA system test-suite
162- Automation for UEQA Ubuntu Touch image system test-suite.
163+Description: Ubuntu-system-tests test suite and test data
164+ This package contains test suites and test data for ubuntu-system-tests.
165
166=== modified file 'debian/tests/control'
167--- debian/tests/control 2016-04-20 15:18:49 +0000
168+++ debian/tests/control 2016-05-13 10:11:11 +0000
169@@ -32,6 +32,8 @@
170 ubuntuone-credentials-autopilot, # OPTIONAL
171 ubuntu-system-settings,
172 ubuntu-system-settings-autopilot (>=0.3+15.04.20150223-0ubuntu1), # OPTIONAL
173+ ubuntu-system-tests-helpers, # OPTIONAL
174+ ubuntu-system-tests-suite, # OPTIONAL
175 unity8,
176 unity8-autopilot (>=8.02+15.04.20150224-0ubuntu1), # OPTIONAL
177 unity-scope-click,
178
179=== added file 'debian/ubuntu-system-tests-common.install'
180--- debian/ubuntu-system-tests-common.install 1970-01-01 00:00:00 +0000
181+++ debian/ubuntu-system-tests-common.install 2016-05-13 10:11:11 +0000
182@@ -0,0 +1,2 @@
183+usr/lib/python3*/*/ubuntu_system_tests/__init__.py
184+usr/lib/python3*/*/ubuntu_system_tests/common/
185
186=== added file 'debian/ubuntu-system-tests-helpers.install'
187--- debian/ubuntu-system-tests-helpers.install 1970-01-01 00:00:00 +0000
188+++ debian/ubuntu-system-tests-helpers.install 2016-05-13 10:11:11 +0000
189@@ -0,0 +1,1 @@
190+usr/lib/python3*/*/ubuntu_system_tests/helpers/
191
192=== added file 'debian/ubuntu-system-tests-host.install'
193--- debian/ubuntu-system-tests-host.install 1970-01-01 00:00:00 +0000
194+++ debian/ubuntu-system-tests-host.install 2016-05-13 10:11:11 +0000
195@@ -0,0 +1,9 @@
196+usr/bin/ubuntu-system-tests /usr/bin/
197+usr/lib/python3*/*/ubuntu_system_tests*.egg-info
198+usr/lib/python3*/*/ubuntu_system_tests/run.py
199+usr/lib/python3*/*/ubuntu_system_tests/host/
200+debian/control /usr/share/ubuntu-system-tests/debian/
201+debian/changelog /usr/share/ubuntu-system-tests/debian/
202+debian/tests/ /usr/share/ubuntu-system-tests/debian/
203+test_lists/ /usr/share/ubuntu-system-tests/
204+README.rst /usr/share/ubuntu-system-tests/
205
206=== added file 'debian/ubuntu-system-tests-suite.install'
207--- debian/ubuntu-system-tests-suite.install 1970-01-01 00:00:00 +0000
208+++ debian/ubuntu-system-tests-suite.install 2016-05-13 10:11:11 +0000
209@@ -0,0 +1,3 @@
210+usr/lib/python3*/*/ubuntu_system_tests/systemtests/
211+usr/lib/python3*/*/ubuntu_system_tests/tests/
212+ubuntu_system_tests/external_tests/ /usr/lib/python3/dist-packages/ubuntu_system_tests/
213
214=== modified file 'setup.py'
215--- setup.py 2016-05-05 17:37:44 +0000
216+++ setup.py 2016-05-13 10:11:11 +0000
217@@ -31,8 +31,8 @@
218 name='ubuntu-system-tests',
219 version=VERSION,
220 description='Automated tests for Ubuntu Touch images.',
221- author='Christopher Lee',
222- author_email='chris.lee@canonical.com',
223+ author='Canonical Platform QA Team',
224+ author_email='qa-team@lists.canonical.com',
225 url='https://launchpad.net/ubuntu-system-tests',
226 license='GPLv3',
227 packages=find_packages(),
228@@ -45,7 +45,7 @@
229 ],
230 entry_points={
231 'console_scripts': [
232- 'ubuntu-system-tests = ubuntu_system_tests.command_line:main'
233+ 'ubuntu-system-tests = ubuntu_system_tests.run:main'
234 ]
235 },
236 test_suite='ubuntu_system_tests.selftests',
237
238=== added file 'ubuntu_system_tests/__init__.py'
239--- ubuntu_system_tests/__init__.py 1970-01-01 00:00:00 +0000
240+++ ubuntu_system_tests/__init__.py 2016-05-13 10:11:11 +0000
241@@ -0,0 +1,19 @@
242+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
243+
244+#
245+# Ubuntu System Tests
246+# Copyright (C) 2016 Canonical
247+#
248+# This program is free software: you can redistribute it and/or modify
249+# it under the terms of the GNU General Public License as published by
250+# the Free Software Foundation, either version 3 of the License, or
251+# (at your option) any later version.
252+#
253+# This program is distributed in the hope that it will be useful,
254+# but WITHOUT ANY WARRANTY; without even the implied warranty of
255+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
256+# GNU General Public License for more details.
257+#
258+# You should have received a copy of the GNU General Public License
259+# along with this program. If not, see <http://www.gnu.org/licenses/>.
260+#
261
262=== added directory 'ubuntu_system_tests/common'
263=== renamed file 'ubuntu_system_tests/__init__.py' => 'ubuntu_system_tests/common/__init__.py'
264--- ubuntu_system_tests/__init__.py 2016-05-03 16:20:19 +0000
265+++ ubuntu_system_tests/common/__init__.py 2016-05-13 10:11:11 +0000
266@@ -20,6 +20,30 @@
267
268 import inspect
269 import os
270+import random
271+import string
272+
273+
274+def clean_dir(dir_path):
275+ """Delete all the content of the directory"""
276+ for root, dirs, files in os.walk(dir_path, topdown=False):
277+ for name in files:
278+ os.remove(os.path.join(root, name))
279+ for name in dirs:
280+ os.rmdir(os.path.join(root, name))
281+
282+
283+def delete_file(file_name):
284+ """Delete the file passed as parameter. In case the file does not
285+ exist, the deletion is skipped"""
286+ if os.path.isfile(file_name):
287+ os.unlink(file_name)
288+
289+
290+def get_random_string(length=10):
291+ """Get a string with random content"""
292+ return ''.join(random.choice(string.ascii_uppercase) for i in
293+ range(length))
294
295
296 def get_tests_ids_to_run(tests_module=None, testsuite_list_filepath=None):
297
298=== renamed file 'ubuntu_system_tests/config/__init__.py' => 'ubuntu_system_tests/common/config.py'
299--- ubuntu_system_tests/config/__init__.py 2016-05-06 10:18:32 +0000
300+++ ubuntu_system_tests/common/config.py 2016-05-13 10:11:11 +0000
301@@ -22,7 +22,7 @@
302 import logging
303 import os
304
305-from ubuntu_system_tests.config import options
306+from ubuntu_system_tests.common import options
307
308 logger = logging.getLogger(__name__)
309 config_stack = None
310
311=== renamed file 'ubuntu_system_tests/config/options.py' => 'ubuntu_system_tests/common/options.py'
312=== renamed file 'ubuntu_system_tests/ssh.py' => 'ubuntu_system_tests/common/ssh.py'
313--- ubuntu_system_tests/ssh.py 2016-05-04 10:26:05 +0000
314+++ ubuntu_system_tests/common/ssh.py 2016-05-13 10:11:11 +0000
315@@ -27,7 +27,7 @@
316 import stat
317 import subprocess
318
319-from ubuntu_system_tests.helpers.file_system import (
320+from ubuntu_system_tests.common import (
321 get_random_string,
322 delete_file
323 )
324
325=== removed directory 'ubuntu_system_tests/config'
326=== modified file 'ubuntu_system_tests/helpers/file_system.py'
327--- ubuntu_system_tests/helpers/file_system.py 2016-05-10 14:11:19 +0000
328+++ ubuntu_system_tests/helpers/file_system.py 2016-05-13 10:11:11 +0000
329@@ -23,12 +23,12 @@
330 import glob
331 import hashlib
332 import logging
333-import random
334 import os
335 import shutil
336-import string
337 import subprocess
338
339+from ubuntu_system_tests import common
340+
341 logger = logging.getLogger(__name__)
342
343 FILE_PREFIX = 'file://'
344@@ -125,8 +125,7 @@
345 def delete_file(file_name):
346 """Delete the file passed as parameter. In case the file does not
347 exist, the deletion is skipped"""
348- if os.path.isfile(file_name):
349- os.unlink(file_name)
350+ common.delete_file(file_name)
351
352
353 def create_directory_if_not_exists(directory):
354@@ -171,13 +170,7 @@
355
356 def clean_dir(dir_path):
357 """Delete all the content of the directory"""
358- if os.path.isdir(dir_path):
359- for obj in os.listdir(dir_path):
360- obj_path = os.path.join(dir_path, obj)
361- if os.path.isfile(obj_path):
362- os.remove(obj_path)
363- else:
364- remove_dir(obj_path)
365+ common.clean_dir(dir_path)
366
367
368 def move_folder_contents(src_root, dst_root):
369@@ -218,8 +211,7 @@
370
371 def get_random_string(length=10):
372 """Get a string with random content"""
373- return ''.join(random.choice(string.ascii_uppercase) for i in
374- range(length))
375+ return common.get_random_string(length)
376
377
378 def compare_files(file_1, file_2):
379
380=== modified file 'ubuntu_system_tests/helpers/ssh.py'
381--- ubuntu_system_tests/helpers/ssh.py 2016-05-04 10:09:48 +0000
382+++ ubuntu_system_tests/helpers/ssh.py 2016-05-13 10:11:11 +0000
383@@ -21,7 +21,7 @@
384 import os
385 import paramiko
386
387-from ubuntu_system_tests import ssh as ssh_config
388+from ubuntu_system_tests.common import ssh as ssh_config
389
390 logger = logging.getLogger(__name__)
391
392
393=== modified file 'ubuntu_system_tests/helpers/testbed.py'
394--- ubuntu_system_tests/helpers/testbed.py 2016-05-03 14:17:46 +0000
395+++ ubuntu_system_tests/helpers/testbed.py 2016-05-13 10:11:11 +0000
396@@ -25,7 +25,7 @@
397
398 from subprocess import check_call
399
400-from ubuntu_system_tests import config
401+from ubuntu_system_tests.common import config
402
403 NM_PATH = '/etc/NetworkManager/system-connections/'
404 ASKPASS_PATH = '/tmp/askpass.sh'
405
406=== added directory 'ubuntu_system_tests/host'
407=== added file 'ubuntu_system_tests/host/__init__.py'
408--- ubuntu_system_tests/host/__init__.py 1970-01-01 00:00:00 +0000
409+++ ubuntu_system_tests/host/__init__.py 2016-05-13 10:11:11 +0000
410@@ -0,0 +1,19 @@
411+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
412+
413+#
414+# Ubuntu System Tests
415+# Copyright (C) 2016 Canonical
416+#
417+# This program is free software: you can redistribute it and/or modify
418+# it under the terms of the GNU General Public License as published by
419+# the Free Software Foundation, either version 3 of the License, or
420+# (at your option) any later version.
421+#
422+# This program is distributed in the hope that it will be useful,
423+# but WITHOUT ANY WARRANTY; without even the implied warranty of
424+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
425+# GNU General Public License for more details.
426+#
427+# You should have received a copy of the GNU General Public License
428+# along with this program. If not, see <http://www.gnu.org/licenses/>.
429+#
430
431=== renamed file 'ubuntu_system_tests/command_line.py' => 'ubuntu_system_tests/host/command_line.py'
432--- ubuntu_system_tests/command_line.py 2016-05-09 18:32:36 +0000
433+++ ubuntu_system_tests/host/command_line.py 2016-05-13 10:11:11 +0000
434@@ -29,14 +29,15 @@
435 import tempfile
436
437 from argparse import ArgumentParser
438-from ubuntu_system_tests import (
439+from ubuntu_system_tests.host import (
440+ results,
441+ testdesc
442+)
443+from ubuntu_system_tests.common import (
444+ clean_dir,
445 config,
446- results,
447 ssh,
448- testdesc
449 )
450-from ubuntu_system_tests.helpers.file_system import clean_dir
451-
452
453 logger = logging.getLogger(__name__)
454 _ADT_RUN_SHORT_TIMEOUT = 600 # 10 minutes.
455@@ -53,6 +54,11 @@
456 EXT_LOG_DIR = '/userdata/apt-cacher-ng/logs'
457 PERMISSION = '755'
458
459+# Installation path for shared files
460+INSTALLED_SHARE_DIR = '/usr/share/ubuntu-system-tests'
461+# Installation path for installed python scripts
462+INSTALLED_PYTHON_DIR = '/usr/lib/python'
463+
464
465 def main(argv=None):
466 if argv is None:
467@@ -382,6 +388,19 @@
468 return content.rstrip()
469
470
471+def _is_installed():
472+ """Return True if the suite is running from installed location."""
473+ return os.path.realpath(__file__).startswith(INSTALLED_PYTHON_DIR)
474+
475+
476+def _get_debian_path():
477+ """Return the path of the debian folder.
478+ This will depend on whether tests are running from installed location
479+ or local source directory.
480+ """
481+ return INSTALLED_SHARE_DIR if _is_installed() else os.getcwd()
482+
483+
484 def _build_basic_adt_run_test_command(config_stack, extra_depends, verbose):
485 """ Build and return the first part of the adt-run """
486 output_dir = config_stack.get('output_dir')
487@@ -399,7 +418,7 @@
488 # Regression tests can take up to 8 hours, no reason to cut short.
489 '--timeout-test={}'.format(_ADT_RUN_TEST_TIMEOUT),
490 '-B',
491- '--unbuilt-tree={}'.format(os.getcwd()),
492+ '--unbuilt-tree={}'.format(_get_debian_path()),
493 '--output-dir',
494 output_dir,
495 # Even if the config file on the host has a different name, on the
496@@ -657,7 +676,7 @@
497 when the apt-get install does not install any package, the device is set
498 as ro and exit, otherwise it is rebooted and will start as ro
499 """
500- dir_name = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
501+ dir_name = _get_debian_path()
502 if install_tests:
503 dependencies = testdesc.get_all_dependencies(dir_name, 'TMPINSTALL')
504 else:
505
506=== renamed file 'ubuntu_system_tests/results.py' => 'ubuntu_system_tests/host/results.py'
507=== renamed file 'ubuntu_system_tests/testdesc.py' => 'ubuntu_system_tests/host/testdesc.py'
508=== added file 'ubuntu_system_tests/run.py'
509--- ubuntu_system_tests/run.py 1970-01-01 00:00:00 +0000
510+++ ubuntu_system_tests/run.py 2016-05-13 10:11:11 +0000
511@@ -0,0 +1,31 @@
512+# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
513+
514+#
515+# Ubuntu System Tests
516+# Copyright (C) 2016 Canonical
517+#
518+# This program is free software: you can redistribute it and/or modify
519+# it under the terms of the GNU General Public License as published by
520+# the Free Software Foundation, either version 3 of the License, or
521+# (at your option) any later version.
522+#
523+# This program is distributed in the hope that it will be useful,
524+# but WITHOUT ANY WARRANTY; without even the implied warranty of
525+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
526+# GNU General Public License for more details.
527+#
528+# You should have received a copy of the GNU General Public License
529+# along with this program. If not, see <http://www.gnu.org/licenses/>.
530+#
531+
532+import sys
533+
534+from ubuntu_system_tests.host import command_line
535+
536+
537+def main(argv=None):
538+ return command_line.main(argv)
539+
540+
541+if __name__ == '__main__':
542+ sys.exit(main())
543
544=== modified file 'ubuntu_system_tests/selftests/__init__.py'
545--- ubuntu_system_tests/selftests/__init__.py 2016-05-03 18:41:35 +0000
546+++ ubuntu_system_tests/selftests/__init__.py 2016-05-13 10:11:11 +0000
547@@ -24,7 +24,7 @@
548 import unittest
549 from unittest import mock
550
551-from ubuntu_system_tests import config
552+from ubuntu_system_tests.common import config
553
554 DEFAULT_SECTION = '[{}]\n'.format(config.KEY_DEFAULT)
555 ISOLATED_ENVIRON = {'HOME': None}
556
557=== modified file 'ubuntu_system_tests/selftests/test_command_line.py'
558--- ubuntu_system_tests/selftests/test_command_line.py 2016-05-03 15:58:08 +0000
559+++ ubuntu_system_tests/selftests/test_command_line.py 2016-05-13 10:11:11 +0000
560@@ -26,11 +26,9 @@
561
562 import testscenarios
563
564-from ubuntu_system_tests import (
565- config,
566- command_line,
567- selftests
568-)
569+from ubuntu_system_tests import selftests
570+from ubuntu_system_tests.host import command_line
571+from ubuntu_system_tests.common import config
572
573
574 def check_any_item_in_list_contains_value(list, value):
575@@ -198,7 +196,7 @@
576 'dep2']
577 # Mock _read_dependency_files
578 with mock.patch(
579- 'ubuntu_system_tests.command_line._read_dependency_files'
580+ 'ubuntu_system_tests.host.command_line._read_dependency_files'
581 ) as mock_read_depends:
582 mock_read_depends.return_value = {
583 'app2.tests': 'dep1',
584@@ -297,7 +295,7 @@
585 super().setUp()
586 self.config_stack = config.UbuntuSystemTestsConfig()
587
588- @mock.patch('ubuntu_system_tests.command_line.generate_user_report')
589+ @mock.patch('ubuntu_system_tests.host.command_line.generate_user_report')
590 def test_run_system_tests_commands(self, mock_generate_user_report):
591 def get_command_from_call(call):
592 """Return the name of the command, without the arguments."""
593@@ -535,7 +533,7 @@
594 }),
595 ]
596
597- @mock.patch('ubuntu_system_tests.command_line.run_system_tests')
598+ @mock.patch('ubuntu_system_tests.host.command_line.run_system_tests')
599 def test_main_must_pass_command_line_arguments_to_run_system_tests(
600 self, mock_run_system_tests):
601 command_line.main(self.command_line_arguments)
602
603=== modified file 'ubuntu_system_tests/selftests/test_config.py'
604--- ubuntu_system_tests/selftests/test_config.py 2016-05-03 16:20:19 +0000
605+++ ubuntu_system_tests/selftests/test_config.py 2016-05-13 10:11:11 +0000
606@@ -25,11 +25,9 @@
607 import fixtures
608 from autopilot.introspection import ProxyBase
609
610-from ubuntu_system_tests import (
611- config,
612- selftests,
613-)
614-from ubuntu_system_tests.config.options import Option
615+from ubuntu_system_tests import selftests
616+from ubuntu_system_tests.common import config
617+from ubuntu_system_tests.common.options import Option
618 from ubuntu_system_tests.helpers.autopilot import override_proxy_timeout
619
620
621@@ -186,8 +184,8 @@
622 return config_stack
623
624 def test_alternative_store_location(self):
625- get_user_config_dir = 'ubuntu_system_tests.config.get_user_config_dir'
626- with mock.patch(get_user_config_dir) as mock_config_dir:
627+ config_dir = 'ubuntu_system_tests.common.config.get_user_config_dir'
628+ with mock.patch(config_dir) as mock_config_dir:
629 mock_config_dir.return_value = self.uniq_dir
630 config_stack = config.UbuntuSystemTestsConfig('alternative.conf')
631
632
633=== modified file 'ubuntu_system_tests/selftests/test_results.py'
634--- ubuntu_system_tests/selftests/test_results.py 2016-04-29 15:51:06 +0000
635+++ ubuntu_system_tests/selftests/test_results.py 2016-05-13 10:11:11 +0000
636@@ -22,11 +22,9 @@
637 import os
638 from unittest import mock
639
640-from ubuntu_system_tests import (
641- config,
642- results,
643- selftests
644-)
645+from ubuntu_system_tests import selftests
646+from ubuntu_system_tests.host import results
647+from ubuntu_system_tests.common import config
648
649
650 class ResultsTestCase(selftests.ConfigBaseTestCase):
651
652=== modified file 'ubuntu_system_tests/selftests/test_testbed_commands.py'
653--- ubuntu_system_tests/selftests/test_testbed_commands.py 2016-04-28 18:50:20 +0000
654+++ ubuntu_system_tests/selftests/test_testbed_commands.py 2016-05-13 10:11:11 +0000
655@@ -19,10 +19,10 @@
656 #
657
658 from ubuntu_system_tests import (
659- config,
660 systemtests,
661 selftests
662 )
663+from ubuntu_system_tests.common import config
664
665
666 class AutopilotCommandsTestCase(selftests.ConfigBaseTestCase):
667
668=== modified file 'ubuntu_system_tests/selftests/test_tests_to_run.py'
669--- ubuntu_system_tests/selftests/test_tests_to_run.py 2016-05-03 15:58:08 +0000
670+++ ubuntu_system_tests/selftests/test_tests_to_run.py 2016-05-13 10:11:11 +0000
671@@ -28,11 +28,11 @@
672 import fixtures
673 import testscenarios
674
675-import ubuntu_system_tests
676 from ubuntu_system_tests import (
677 external_tests,
678 selftests,
679 )
680+from ubuntu_system_tests.common import get_tests_ids_to_run
681
682
683 class ExternalTestsListFile(fixtures.Fixture):
684@@ -175,7 +175,7 @@
685 def test_get_tests_with_no_internal_tests_module(self):
686 external_tests = ['external_test_1']
687 with ExternalTestsListFile(external_tests) as test_lists_file:
688- tests_to_run = ubuntu_system_tests.get_tests_ids_to_run(
689+ tests_to_run = get_tests_ids_to_run(
690 tests_module='not a module',
691 testsuite_list_filepath=test_lists_file.path)
692
693@@ -187,7 +187,7 @@
694 tests_module = types.ModuleType('internal_tests_module')
695
696 with ExternalTestsListFile(external_tests) as test_lists_file:
697- tests_to_run = ubuntu_system_tests.get_tests_ids_to_run(
698+ tests_to_run = get_tests_ids_to_run(
699 tests_module, test_lists_file.path)
700
701 expected_tests = external_tests + ['internal_tests_module']
702
703=== added directory 'ubuntu_system_tests/systemtests'
704=== renamed file 'ubuntu_system_tests/systemtests.py' => 'ubuntu_system_tests/systemtests/__init__.py'
705--- ubuntu_system_tests/systemtests.py 2016-05-03 14:52:27 +0000
706+++ ubuntu_system_tests/systemtests/__init__.py 2016-05-13 10:11:11 +0000
707@@ -21,10 +21,10 @@
708 import os
709 import subprocess
710
711-import ubuntu_system_tests
712-from ubuntu_system_tests import (
713+from ubuntu_system_tests import external_tests
714+from ubuntu_system_tests.common import (
715 config,
716- external_tests,
717+ get_tests_ids_to_run,
718 ssh
719 )
720
721@@ -36,7 +36,7 @@
722 config_stack = config.get_device_config_stack()
723 ssh.prepare_device_keys()
724
725- test_ids = ubuntu_system_tests.get_tests_ids_to_run()
726+ test_ids = get_tests_ids_to_run()
727 result = run_autopilot_tests(config_stack, artifacts_directory, *test_ids)
728 ensure_keyfile_deleted()
729
730
731=== modified file 'ubuntu_system_tests/tests/base_telephony.py'
732--- ubuntu_system_tests/tests/base_telephony.py 2016-03-10 17:35:10 +0000
733+++ ubuntu_system_tests/tests/base_telephony.py 2016-05-13 10:11:11 +0000
734@@ -20,7 +20,7 @@
735
736 from threading import Event
737
738-from ubuntu_system_tests import config
739+from ubuntu_system_tests.common import config
740 from ubuntu_system_tests.helpers import ofono
741 from ubuntu_system_tests.helpers.addressbook import (
742 fixture_setup as address_book_fixture)
743
744=== modified file 'ubuntu_system_tests/tests/perf/__init__.py'
745--- ubuntu_system_tests/tests/perf/__init__.py 2016-03-15 03:11:03 +0000
746+++ ubuntu_system_tests/tests/perf/__init__.py 2016-05-13 10:11:11 +0000
747@@ -21,7 +21,7 @@
748 import logging
749
750
751-from ubuntu_system_tests import config
752+from ubuntu_system_tests.common import config
753 from ubuntu_system_tests.helpers import file_system as fs
754 from ubuntu_system_tests.helpers.platform import (
755 get_channel_name, get_device_name, get_build_number)
756
757=== modified file 'ubuntu_system_tests/tests/test_settings_wizard.py'
758--- ubuntu_system_tests/tests/test_settings_wizard.py 2016-02-29 21:51:29 +0000
759+++ ubuntu_system_tests/tests/test_settings_wizard.py 2016-05-13 10:11:11 +0000
760@@ -16,7 +16,7 @@
761 # You should have received a copy of the GNU General Public License
762 # along with this program. If not, see <http://www.gnu.org/licenses/>
763
764-from ubuntu_system_tests.config import get_device_config_stack
765+from ubuntu_system_tests.common.config import get_device_config_stack
766 from ubuntu_system_tests.helpers import ofono
767 from ubuntu_system_tests.helpers.platform import (
768 is_agps_supported, is_wifi_supported

Subscribers

People subscribed via source and target branches

to all changes: