Code review comment for lp:~canonical-platform-qa/ubuntu-ota-tests/dbus-upgrade

Revision history for this message
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_ota_tests/upgrade.py'
--- ubuntu_ota_tests/upgrade.py 2015-03-24 11:01:07 +0000
+++ ubuntu_ota_tests/upgrade.py 2015-03-24 18:06:41 +0000
@@ -39,10 +39,15 @@
 def upgrade_with_system_image_dbus():
     if systemimage.service.__version__.startswith('3.0'):
         _write_adt_apply_config()
+ config_dir = _get_system_image_config_dir()
+ command = 'system-image-dbus -v -C {}'.format(config_dir)
+ print('Starting system-image with', command)
+ for filename in sorted(os.listdir(config_dir)):
+ print('=====', filename, '=====')
+ with open(os.path.join(config_dir, filename), 'r',
+ encoding='utf-8') as fp:
+ print(fp.read())
         services.ensure_system_image_dbus_not_running()
- command = 'system-image-dbus -v -C {config_dir}'.format(
- config_dir=_get_system_image_config_dir())
- print('Starting system-image with', command)
         subprocess.Popen(command.split())
         # 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_image_config_dir() is not working as expected.

Starting system-image with system-image-dbus -v -C /tmp/adt-run.dGsx3q/ota-dbus-upgrade-artifacts
===== 99_adt_apply.ini =====
[hooks]
apply: ubuntu_ota_tests.hooks.ADTRebootToRecovery

See? 99_adt_apply.ini appears to be the *only* .ini file in
/tmp/adt-run.dGsx3q/ota-dbus-upgrade-artifacts. Now the log message:

[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-dbus-upgrade, and which I ran, does
correctly set up /etc/systemimage-config.d from /etc/system-iamge, but the
$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-image/config.d to $ADT_ARTIFACTS, and then add
99_adt_apply.ini

I haven't investigated, but I wonder if this is the same reason that
test_download_update() times out for me.

« Back to merge proposal