~nskaggs/autopilot/add-isolation-apparmor-rules

« back to all changes in this revision

Viewing changes to autopilot/testcase.py

  • Committer: CI bot
  • Author(s): Tarmac
  • Date: 2014-05-09 00:48:06 UTC
  • mfrom: (483.2.19 temp-dev)
  • Revision ID: ps-jenkins@lists.canonical.com-20140509004806-8528si3da584w57j
Initial release of 1.5. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
    def setUp(self):
137
137
        super(AutopilotTestCase, self).setUp()
138
138
        on_test_started(self)
139
 
        self.useFixture(get_debug_profile_fixture()(self.addDetail))
 
139
        self.useFixture(get_debug_profile_fixture()(self.addDetailUniqueName))
140
140
 
141
141
        _lttng_trace_test_started(self.id())
142
142
        self.addCleanup(_lttng_trace_test_ended, self.id())
258
258
            ' '.join(arguments)
259
259
        )
260
260
        launcher = self.useFixture(
261
 
            NormalApplicationLauncher(self.addDetail, **kwargs)
 
261
            NormalApplicationLauncher(self.addDetailUniqueName, **kwargs)
262
262
        )
263
263
 
264
264
        return self._launch_test_application(launcher, application, *arguments)
307
307
            ','.join(app_uris)
308
308
        )
309
309
        launcher = self.useFixture(
310
 
            ClickApplicationLauncher(self.addDetail, **kwargs)
 
310
            ClickApplicationLauncher(self.addDetailUniqueName, **kwargs)
311
311
        )
312
312
        return self._launch_test_application(launcher, package_id, app_name,
313
313
                                             app_uris)
339
339
            ','.join(uris)
340
340
        )
341
341
        launcher = self.useFixture(
342
 
            UpstartApplicationLauncher(self.addDetail, **kwargs)
 
342
            UpstartApplicationLauncher(self.addDetailUniqueName, **kwargs)
343
343
        )
344
344
        return self._launch_test_application(launcher, application_name, uris)
345
345
 
352
352
            self.patch_environment("DBUS_SESSION_BUS_ADDRESS", dbus_bus)
353
353
 
354
354
        pid = launcher_instance.launch(application, *args)
355
 
        process = getattr(launcher_instance, 'process', None)
356
355
        application_name = getattr(
357
356
            launcher_instance,
358
357
            'dbus_application_name',
359
358
            None
360
359
        )
 
360
        process = getattr(launcher_instance, 'process', None)
361
361
 
362
 
        proxy_obj = get_proxy_object_for_existing_process(
 
362
        search_params = dict(
363
363
            pid=pid,
364
 
            process=process,
365
364
            dbus_bus=dbus_bus,
366
 
            emulator_base=launcher_instance.emulator_base,
367
 
            application_name=application_name,
 
365
            emulator_base=launcher_instance.emulator_base
368
366
        )
 
367
        if application_name is not None:
 
368
            search_params['application_name'] = application_name
 
369
        if process is not None:
 
370
            search_params['process'] = process
 
371
 
 
372
        proxy_obj = get_proxy_object_for_existing_process(**search_params)
369
373
        proxy_obj.set_process(process)
370
374
 
371
375
        return proxy_obj