Merge lp://staging/~barry/ubuntu-ota-tests/check-for-update into lp://staging/ubuntu-ota-tests

Proposed by Barry Warsaw
Status: Superseded
Proposed branch: lp://staging/~barry/ubuntu-ota-tests/check-for-update
Merge into: lp://staging/ubuntu-ota-tests
Diff against target: 154 lines (+126/-0) (has conflicts)
5 files modified
debian/changelog (+5/-0)
debian/control (+1/-0)
debian/tests/check_for_update (+84/-0)
debian/tests/control (+2/-0)
debian/tests/current_version_number (+34/-0)
Conflict adding file debian.  Moved existing file to debian.moved.
To merge this branch: bzr merge lp://staging/~barry/ubuntu-ota-tests/check-for-update
Reviewer Review Type Date Requested Status
Christopher Lee (community) Needs Information
Review via email: mp+252047@code.staging.launchpad.net

This proposal has been superseded by a proposal from 2015-03-06.

Description of the change

Adds a check-for-update script as per trello card.

To post a comment you must log in.
Revision history for this message
Christopher Lee (veebers) wrote :

(as mentioned in inline comments) I think we should have a better method for having support scripts and functionality, I've suggested something in my branch[1] (as well as posed the question there re: packaging the scripts).

[1] https://code.launchpad.net/~canonical-platform-qa/ubuntu-ota-tests/check-for-running-service/+merge/252057

review: Needs Information
Revision history for this message
Barry Warsaw (barry) wrote :

On Mar 06, 2015, at 04:44 AM, Christopher Lee wrote:

>(as mentioned in inline comments) I think we should have a better method for
>having support scripts and functionality, I've suggested something in my
>branch[1] (as well as posed the question there re: packaging the scripts).

Yep, commented there. TL;DR: I like create a package for shared
functionality, and debian/tests/ubuntu_ota_tests is fine for now, but later
they should be refactored out into a normal Python 3 package.

>> === added directory 'debian'
>> === renamed directory 'debian' => 'debian.moved'
>> === added file 'debian/changelog'
>> --- debian/changelog 1970-01-01 00:00:00 +0000
>> +++ debian/changelog 2015-03-06 00:20:09 +0000
>> @@ -0,0 +1,5 @@
>> +ubuntu-ota-tests (1.0-1) UNRELEASED; urgency=medium
>> +
>> + * Initial release.
>> +
>> + -- Christopher Lee <email address hidden> Tue, 03 Mar 2015 14:32:30 +1300
>
>This seems odd to be in the diff, it should be in trunk. Either something has
>gone wrong here or trunk needs to be fixed.

Nope, the branch was submitted against a prerequisite branch because at the
time, trunk didn't have the necessary infrastructure. It does now, so I'll
resubmit this branch against trunk, after taking into consideration all the
comments here.

>> +class CheckingReactor(Reactor):
>> + def __init__(self, bus):
>> + super().__init__(bus)
>> + self.signals = []
>> +
>> + def _do_UpdateAvailableStatus(self, signal, path, *args):
>> + self.signals.append(UASRecord(*args))
>> + self.quit()
>> +
>> + def run(self, timeout=None):
>> + super().run(timeout)
>> + if self.timed_out:
>> + raise TimeoutError
>
>These are cool :-) Will they be useful in other tests/scripts? If so it will
>be worth moving them into a support module (as per other comment).

Yep! Will do.

>> +
>> +
>> +def check_for_update():
>> + # Since we'll be receiving signals, we have to first define the default
>> + # D-Bus main loop.
>> + DBusGMainLoop(set_as_default=True)
>> + # Boilerplate for making calls to the system service.
>> + system_bus = dbus.SystemBus()
>> + service = system_bus.get_object('com.canonical.SystemImage', '/Service')
>> + iface = dbus.Interface(service, 'com.canonical.SystemImage')
>
>I imagine the boilerplate code will be used a lot so should live somewhere
>communal, I've comment in the big comment box re: how I've copied this code
>of yours into support modules :-)
>(https://code.launchpad.net/~canonical-platform-qa/ubuntu-ota-tests/check-for-running-service/+merge/252057)

Yep, definitely should be shared. See my comments in your mp. :)

Unmerged revisions

4. By Barry Warsaw

The check-for-update script.

3. By Barry Warsaw

check for updates

2. By Barry Warsaw

Merge current-version-number branch

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches