fix apt-source test cases to run (or skip) in buildd environment
Bug #1589174 reported by
Scott Moser
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Medium
|
Christian Ehrhardt |
Bug Description
Christian added a bunch of tests under https:/
Those failed to buidl first at [1] and then i patched a few of them under revno 1226 which made them work in my local sbuild environment. But they still failed in buildd environment at [2].
I'm going to just skip the last failing test so i can get an upload, but want to fix these tests to either mock more or disable/skip conditionally if that is right.
[1] https:/
[2] https:/
Related branches
lp:~paelzer/cloud-init/bug-1589174-fix-tests-in-adt-env
- cloud-init Commiters: Pending requested
-
Diff: 727 lines (+205/-179)5 files modifiedcloudinit/config/cc_apt_configure.py (+16/-40)
cloudinit/gpg.py (+76/-0)
packages/bddeb (+6/-0)
tests/unittests/test_handler/test_handler_apt_configure_sources_list.py (+37/-24)
tests/unittests/test_handler/test_handler_apt_source.py (+70/-115)
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
To post a comment you must log in.
Hi,
sorry - I missed to test in that kind of isolated environments on the merge.
Thanks for faking the get_release, as you have seen in test_handler_ apt_configure_ sources_ list.py I already cared about being release independent (but only thought on release independence, not unavailability of lsb_release back then).
To summarize what we have to cover now: ubuntu. com (Note that I already avoided to use non .ubuntu.com addresses in the test)
1. getkeybyid will only work in network enabled environments that can reach keyserver.
=> We need to restore (undo the mocking of getkeybyid) in a way that it will work in network capable environments, but gracefully skip in others.
2. The capability to make the tests independent to a underlying ubuntu/debian environment. That in my opinion is a bit special, as all of the feature that it tests is debian/ubuntu special (apt / apt-key)
=> still it should detect and fail gracefully in those cases.
First I had to try recreate without bothering LP each time, I chose - if I go into it I can make it better anyway - and added a test for a third party keyserver.
Using that with a bad KS intentionally I had a test for failing network.
Also this was the right time to re-include the improvements we made when thinking through the same thing on the curtin side of things.