Merge lp:~sil2100/update-manager/fix-test-failure-origin into lp:update-manager
| Status: | Merged |
|---|---|
| Merged at revision: | 2792 |
| Proposed branch: | lp:~sil2100/update-manager/fix-test-failure-origin |
| Merge into: | lp:update-manager |
| Diff against target: |
27 lines (+9/-0) 1 file modified
tests/test_update_origin.py (+9/-0) |
| To merge this branch: | bzr merge lp:~sil2100/update-manager/fix-test-failure-origin |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Ubuntu Core Development Team | 2017-09-08 | Pending | |
|
Review via email:
|
|||
Commit Message
Fix the testOriginMatch
Description of the Change
Fix the testOriginMatch
The test was supposed to check the case of when there's an update in -updates that's higher version than in -security. There is a check to make sure we're not adding packages to the test set if they have the same version in both -updates and -security, but things start to fail if a package has a more than 2 versions in xenial and none in -security. e.g. in the case of having 3 versions, one in xenial and 2 in xenial-updates, the package was instantly marked as 'good' for the test case. And the test is failing as it fails to mark the package as having a security update - since it doesn't have one.
Solution: when choosing packages to be used in the test, let's check if there is ANY version in -security. Otherwise it makes no sense to try and use the package for testing. This test-case seemed to work by sheer luck before.
| Łukasz Zemczak (sil2100) wrote : | # |
| Brian Murray (brian-murray) wrote : | # |
I wonder if there isn't a way to reduce the number of checks that we are doing here, pkg.candidate.
| Łukasz Zemczak (sil2100) wrote : | # |
In theory we could do it in one loop, but I don't think that would look any better or be any more efficient. The first loop over pkg.candidate.
Let me merge it as is in that case.

This change fixes the current artful autopkgtest failure which started happening when we released a new packagekit SRU to xenial-updates.
https:/ /objectstorage. prodstack4- 5.canonical. com/v1/ AUTH_77e2ada1e7 a84929a74ba3b87 153c0ac/ autopkgtest- artful/ artful/ armhf/u/ update- manager/ 20170907_ 003254_ 8b9e0@/ log.gz