Write an integration test for GH: #780

Bug #1922801 reported by Dan Watkins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Wishlist
Thomas Stringer

Bug Description

The code in https://github.com/canonical/cloud-init/pull/780 is in need of an integration test. Let's use this as a place to hash out the design of it and any framework changes, instead of the comments of a soon-to-be-landed PR.

Revision history for this message
Dan Watkins (oddbloke) wrote :

In #780, I mentioned some framework changes would be required. Specifically, I think we want to introduce a new mark[0] which allows us to configure the SSH keys that will be passed to the instance under test. An example of the introduction of a new mark is [1]: you can see that it uses `getter` to fetch the "lxd_config_dict" mark and then, with a cloud-specific guard, sets it in `launch_kwargs` (which is then passed to pycloudlib, our cloud library).

This would be similar, but would set `vm_params` in `launch_kwargs`: the provided `vm_params` is merged over the default config in [2] (so, yes, you're going to pass in a very deeply-nested dict): we can use that to pass in our non-standard key material. An important assumption by me here is that putting the non-standard key material here means that it will be presented to instances in a way that triggers this bug: please do confirm that!

I'm finishing my day here, please do ask follow-up questions: here or, as always, in #cloud-init!

[0] https://docs.pytest.org/en/stable/example/markers.html#mark-examples
[1] https://github.com/canonical/cloud-init/commit/05216aa37e1fad32433dbea102dc3ceae7d8565d#diff-fa8021f7704bd878dc75be40d940098cdc52657607b02fe6bf3acac60ff10694
[2] https://github.com/canonical/pycloudlib/blob/main/pycloudlib/azure/cloud.py#L337-L345

Revision history for this message
shixuantong (sxt1001) wrote :
Revision history for this message
shixuantong (sxt1001) wrote :

The problem seems to have been resolved,we can close it.

Revision history for this message
James Falcon (falcojr) wrote :

Where do you think it is resolved? This is an issue about writing a test. I'm not sure we have the coverage requested here.

Revision history for this message
James Falcon (falcojr) wrote :
Changed in cloud-init:
status: Triaged → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.