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.
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.
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' ota_tests/ upgrade. py 2015-03-24 11:01:07 +0000 ota_tests/ upgrade. py 2015-03-24 18:06:41 +0000 with_system_ image_dbus( ): service. __version_ _.startswith( '3.0'):
_write_ adt_apply_ config( ) image_config_ dir() config_ dir) os.listdir( config_ dir)): path.join( config_ dir, filename), 'r',
services. ensure_ system_ image_dbus_ not_running( ) dir}'.format( dir=_get_ system_ image_config_ dir())
subprocess. Popen(command. split() )
--- 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 image_config_ dir() is not working as expected.
_get_system_
Starting system-image with system-image-dbus -v -C /tmp/adt- run.dGsx3q/ ota-dbus- upgrade- artifacts ota_tests. hooks.ADTReboot ToRecovery
===== 99_adt_apply.ini =====
[hooks]
apply: ubuntu_
See? 99_adt_apply.ini appears to be the *only* .ini file in run.dGsx3q/ ota-dbus- upgrade- artifacts. Now the log message:
/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 dbus-upgrade, and which I ran, does e-config. d from /etc/system-iamge, but 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 image/config. d to $ADT_ARTIFACTS, and then add
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 update( ) times out for me.
test_download_