Merge lp:~canonical-platform-qa/ubuntu-ota-tests/dbus-upgrade into lp:ubuntu-ota-tests
| Status: | Merged |
|---|---|
| Approved by: | Brendan Donegan on 2015-03-30 |
| Approved revision: | 68 |
| Merged at revision: | 15 |
| Proposed branch: | lp:~canonical-platform-qa/ubuntu-ota-tests/dbus-upgrade |
| Merge into: | lp:ubuntu-ota-tests |
| Prerequisite: | lp:~barry/ubuntu-ota-tests/packaging |
| Diff against target: |
237 lines (+127/-10) 7 files modified
debian/tests/control (+4/-2) debian/tests/ota-dbus-upgrade (+35/-0) ubuntu_ota_tests/hooks.py (+4/-0) ubuntu_ota_tests/reactors.py (+1/-0) ubuntu_ota_tests/selftests/test_services.py (+2/-1) ubuntu_ota_tests/tests/test_basic_upgrade.py (+27/-5) ubuntu_ota_tests/upgrade.py (+54/-2) |
| To merge this branch: | bzr merge lp:~canonical-platform-qa/ubuntu-ota-tests/dbus-upgrade |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| PS Jenkins bot | continuous-integration | Approve on 2015-03-30 | |
| Christopher Lee (community) | 2015-03-18 | Approve on 2015-03-27 | |
| Barry Warsaw (community) | Approve on 2015-03-19 | ||
|
Review via email:
|
|||
This proposal supersedes a proposal from 2015-03-17.
Commit Message
Added the upgrade through dbus.
Description of the Change
To get this working with si 3.0:
$ ubuntu-device-flash --revision=-1 touch --developer-mode --password 0000 --channel=
$ phablet-network
$ phablet-shell
phablet@
phablet@
phablet@
phablet@
phablet@
phablet@
$ adt-run -B --unbuilt-tree=. --testname command1 --- ssh -s ./adb-reboot-
| Barry Warsaw (barry) wrote : | # |
| Barry Warsaw (barry) wrote : | # |
A couple of minor comments, but nothing to hold up approval.
| Barry Warsaw (barry) wrote : | # |
Hmm, I am getting some test failures. My device is flashed to 154, but I hacked /etc/system-
=======
FAIL: test_basic_
-------
Traceback (most recent call last):
File "/tmp/adt-
self.upgrade()
File "/tmp/adt-
upgrade.
File "/tmp/adt-
assert status.
AssertionError: Update not available
I also see check-for-update failing on an ImportError, but that's probably because it doesn't do the PYTHONPATH workaround.
| Federico Gimenez (fgimenez) wrote : | # |
It seems that the command
system-image-dbus -v -C {config_dir}
in ubuntu_
Could anyone please confirm this? I'm running the tests with:
$ ubuntu-device-flash --revision=-1 touch --developer-mode --password 0000 --channel=
$ adt-run -B --unbuilt-tree=. --setup-commands 'mount -o remount,rw /' --setup-commands 'apt-add-repository -y ppa:barry/
| Barry Warsaw (barry) wrote : | # |
On Mar 24, 2015, at 11:33 AM, Federico Gimenez wrote:
>It seems that the command
>
> system-image-dbus -v -C {config_dir}
>
>in ubuntu_
>
>Could anyone please confirm this? I'm running the tests with:
>
>$ ubuntu-device-flash --revision=-1 touch --developer-mode --password 0000 --channel=
>
>$ adt-run -B --unbuilt-tree=. --setup-commands 'mount -o remount,rw /' --setup-commands 'apt-add-repository -y ppa:barry/
>
When I run the above adt-run command, I get this:
=======
FAIL: test_basic_
-------
Traceback (most recent call last):
File "/tmp/adt-
self.upgrade()
File "/tmp/adt-
upgrade.
File "/tmp/adt-
assert status.
AssertionError: Update not available
which is telling me that there's no upgrade available, possibly because a
previous test actually performed the update, such that the device is at the
current revision. This doesn't seem right though because:
root@ubuntu-
Upgrade path is 154:155:156:157:158
Target phase: 33%
Looking back through the logs though I see:
[systemimage] Mar 24 14:00:08 2015 (10604) no matching channel: daily
and yet:
root@ubuntu-
current build number: 153
device name: krillin
channel: ubuntu-
alias: ubuntu-
last update: 2015-03-19 18:27:46
version version: 153
version ubuntu: 20150319.1
version device: 20150310-ae1ddec
version custom: 20150319.1
I'm not sure where this 'daily' channel is coming from though.
| Federico Gimenez (fgimenez) wrote : | # |
Thanks Barry, yes, this seems to be the same behaviour that you described above, there's an update available but services.
Could you please replace the 'command' variable definition at [1] with:
command = 'system-image-dbus -v'
and run the test again, including the reflash? In that case, I'm seeing that the update is detected correctly and all seems to go well, but the apply hook is not defined. So it seems that when -C is passed to system-image-dbus (or when there's a .ini file like the one we are creating) the detection of the update doesn't work the same way, could you please confirm this?
Cheers!
| Barry Warsaw (barry) wrote : | # |
On Mar 24, 2015, at 02:40 PM, Federico Gimenez wrote:
>Could you please replace the 'command' variable definition at [1] with:
>
> command = 'system-image-dbus -v'
>
>and run the test again, including the reflash? In that case, I'm seeing that
>the update is detected correctly and all seems to go well, but the apply hook
>is not defined. So it seems that when -C is passed to system-image-dbus (or
>when there's a .ini file like the one we are creating) the detection of the
>update doesn't work the same way, could you please confirm this?
Before running the above, I made this change:
=== modified file 'ubuntu_
--- ubuntu_
+++ ubuntu_
@@ -39,10 +39,15 @@
def upgrade_
if systemimage.
+ config_dir = _get_system_
+ command = 'system-image-dbus -v -C {}'.format(
+ print('Starting system-image with', command)
+ for filename in sorted(
+ print('=====', filename, '=====')
+ with open(os.
+ encoding='utf-8') as fp:
+ print(fp.read())
- command = 'system-image-dbus -v -C {config_
- config_
- print('Starting system-image with', command)
# as Popen doesn't block without the following sleep this is printed:
# [systemimage] Mar 23 16:18:10 2015 (26139) Cannot get exclusive ownership of bus name.
Then I ran the test and watched the output. What I see makes me think that
_get_system_
Starting system-image with system-image-dbus -v -C /tmp/adt-
===== 99_adt_apply.ini =====
[hooks]
apply: ubuntu_
See? 99_adt_apply.ini appears to be the *only* .ini file in
/tmp/adt-
[systemimage] Mar 24 18:16:27 2015 (5682) no matching channel: daily
makes sense because 'daily' is the baked-in default channel when there is none
defined in an on-system config file.
So I think the test setup is not happening as you expect. Note that the
adt-run command described in d/t/ota-
correctly set up /etc/systemimag
$ADT_ARTIFACTS directory is *not* set up correctly.
I'm not sure what the intent of using $ADT_ARTIFACTS is, but if you really
want the -C config dir to point there, you should at least copy all the .ini
files from /etc/system-
99_adt_apply.ini
I haven't investigated, but I wonder if this is the same reason that
test_download_
| Federico Gimenez (fgimenez) wrote : | # |
Thanks Barry, with the default config files in the custom directory all goes fine. We are using this directory because during the test execution the filesystem is in ro mode, this way we can add the file for defining the apply hook there.
I'm now looking into the download timeout, the services' module download_update function seems to be broken. Anyway with a manual download from the device the reboot doesn't seem to apply it, it seems to boot into recovery mode without applying the update. I'll go for this once the timeout is fixed.
Cheers!
- 65. By Federico Gimenez on 2015-03-25
-
Disabled upgrade assertion for subtask
| Christopher Lee (veebers) wrote : | # |
Looking good to me, a couple of minor comments inline.
Ran it locally and it works fine.
- 66. By Federico Gimenez on 2015-03-26
-
Added bug references for test command comment and the required fix for apply upgrade
- 67. By Federico Gimenez on 2015-03-26
-
flake8
- 68. By Federico Gimenez on 2015-03-26
-
Better log message
| Federico Gimenez (fgimenez) wrote : | # |
Thanks Chris, added log messages describing the type of upgrade and references to the bugs, they are [1] and [2], I'll refer to them also from the trello cards.
I'll make another branch for the apply upgrade fix with this as a prerequisite.
Cheers!
[1] https:/
[2] https:/

After installing si 3.0:
$ sudo -s d/00_default. ini d/01_channel. ini
$ cd /etc/system-image
$ mkdir config.d
$ cp client.ini config.
$ cp channel.ini config.
$ exit
Eventually that wouldn't be needed.