~ps-jenkins/ubuntu-system-image/ubuntu-utopic-proposed

« back to all changes in this revision

Viewing changes to systemimage/testing/controller.py

  • Committer: CI bot
  • Date: 2014-09-17 17:56:35 UTC
  • mfrom: (236.1.3 citrain-24.0u1)
  • Revision ID: ps-jenkins@lists.canonical.com-20140917175635-vinboezbdhcojvh9
* New upstream release.
  - LP: #1353178 - The channel.ini file can override the device name by
    setting `[service]device`.
  - LP: #1324241 - Add optional instrumentation to collect code coverage
    data during test suite run via tox.
  - LP: #1279970 - When an exception occurs in a `system-image-dbus`
    D-Bus method, signal, or callback, this exception is logged in the
    standard log file, and the process exits.  Also, `[system]loglevel`
    can now take an optional ":level" prefix which can be used to set
    the log level for the D-Bus API methods.  By default, they log at
    `ERROR` level, but can be set lower for debugging purposes.
  - LP: #1365646 - Don't crash when releasing an unacquired checking lock.
  - LP: #1365761 - When checking files for `last_update_date()` ignore
    PermissionErrors and just keep checking the fall backs.
  - LP: #1369714 - `system-image-cli --dbus` has been deprecated and
    will be removed in the future.
* d/control: Remove tox as a build dependency to avoid having to MIR tox,
  virtualenv, and pip.
* d/rules:
  - Call nose2 explicitly to avoid use of tox.
  - Remove unnecessary override_dh_auto_clean rule.
* d/system-image-common.post{inst,rm}: `set -e` to make lintian happy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
 
113
113
SERVICES = [
114
114
   ('com.canonical.SystemImage',
115
 
    '{python} -m systemimage.service -C {self.ini_path} --testing {self.mode}',
 
115
    '{python} -m {self.MODULE} -C {self.ini_path} --testing {self.mode}',
116
116
    start_system_image,
117
117
    stop_system_image,
118
118
   ),
128
128
class Controller:
129
129
    """Start and stop D-Bus service under test."""
130
130
 
131
 
    def __init__(self, logfile=None):
 
131
    MODULE = 'systemimage.testing.service'
 
132
 
 
133
    def __init__(self, logfile=None, loglevel='info'):
132
134
        # Non-public.
133
135
        self._stack = ExitStack()
134
136
        self._stoppers = []
158
160
        template = resource_bytes(
159
161
            'systemimage.tests.data', 'config_03.ini').decode('utf-8')
160
162
        with open(self.ini_path, 'w', encoding='utf-8') as fp:
161
 
            print(template.format(tmpdir=ini_tmpdir, vardir=ini_vardir,
162
 
                                  logfile=ini_logfile),
 
163
            print(template.format(tmpdir=ini_tmpdir,
 
164
                                  vardir=ini_vardir,
 
165
                                  logfile=ini_logfile,
 
166
                                  loglevel=loglevel),
163
167
                  file=fp)
164
168
 
165
169
    def _configure_services(self):