I'm performing verification of this locally using the cloud-init integration testing framework. Specifically, I'm running test_upgrade_package[0] with the following diff applied (to trigger this bug):
@pytest.mark.ci
@pytest.mark.ubuntu
-def test_upgrade_package(session_cloud: IntegrationCloud):
- if get_validated_source(session_cloud) != CloudInitSource.DEB_PACKAGE:
- not_run_message = 'Test only supports upgrading to build deb'
+def test_subsequent_boot_of_upgraded_package(session_cloud: IntegrationCloud):
+ source = get_validated_source(session_cloud)
+ if not source.installs_new_version():
if os.environ.get('TRAVIS'):
# If this isn't running on CI, we should know
- pytest.fail(not_run_message)
+ pytest.fail(UNSUPPORTED_INSTALL_METHOD_MSG.format(source))
else:
- pytest.skip(not_run_message)
+ pytest.skip(UNSUPPORTED_INSTALL_METHOD_MSG.format(source))
+ return # type checking doesn't understand that skip raises
with session_cloud.launch(launch_kwargs=launch_kwargs) as instance:
- instance.install_deb()
+ instance.install_new_cloud_init(source, take_snapshot=False, clean=False) instance.restart()
assert instance.execute('cloud-init status --wait --long').ok
The important changes here are that I can run it against both the release pocket and -proposed, and that it doesn't perform a clean any longer. I'll propose these changes to cloud-init upstream after validation is complete.
I'm performing verification of this locally using the cloud-init integration testing framework. Specifically, I'm running test_upgrade_ package[ 0] with the following diff applied (to trigger this bug):
@@ -104,18 +104,19 @@ def test_upgrade( session_ cloud: IntegrationCloud):
@pytest.mark.ci mark.ubuntu package( session_ cloud: IntegrationCloud): source( session_ cloud) != CloudInitSource .DEB_PACKAGE: _boot_of_ upgraded_ package( session_ cloud: IntegrationCloud): source( session_ cloud) installs_ new_version( ): get('TRAVIS' ): fail(not_ run_message) fail(UNSUPPORTE D_INSTALL_ METHOD_ MSG.format( source) ) skip(not_ run_message) skip(UNSUPPORTE D_INSTALL_ METHOD_ MSG.format( source) )
@pytest.
-def test_upgrade_
- if get_validated_
- not_run_message = 'Test only supports upgrading to build deb'
+def test_subsequent
+ source = get_validated_
+ if not source.
if os.environ.
# If this isn't running on CI, we should know
- pytest.
+ pytest.
else:
- pytest.
+ pytest.
+ return # type checking doesn't understand that skip raises
launch_kwargs = {'image_id': session_ cloud.released_ image_id}
with session_ cloud.launch( launch_ kwargs= launch_ kwargs) as instance: install_ deb() install_ new_cloud_ init(source, take_snapshot= False, clean=False)
instance. restart( ) execute( 'cloud- init status --wait --long').ok
- instance.
+ instance.
assert instance.
The important changes here are that I can run it against both the release pocket and -proposed, and that it doesn't perform a clean any longer. I'll propose these changes to cloud-init upstream after validation is complete.
[0] https:/ /github. com/canonical/ cloud-init/ blob/master/ tests/integrati on_tests/ test_upgrade. py#L105- L121