Merge lp:~jamesodhunt/ubuntu/wily/ubuntu-core-upgrader/call-upgrader-directly into lp:ubuntu/wily/ubuntu-core-upgrader
Proposed by
James Hunt
Status: | Work in progress |
---|---|
Proposed branch: | lp:~jamesodhunt/ubuntu/wily/ubuntu-core-upgrader/call-upgrader-directly |
Merge into: | lp:ubuntu/wily/ubuntu-core-upgrader |
Diff against target: |
241 lines (+99/-15) 3 files modified
debian/changelog (+13/-0) functional/test_upgrader.py (+85/-15) ubuntucoreupgrader/upgrader.py (+1/-0) |
To merge this branch: | bzr merge lp:~jamesodhunt/ubuntu/wily/ubuntu-core-upgrader/call-upgrader-directly |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu branches | Pending | ||
Review via email: mp+259481@code.launchpad.net |
To post a comment you must log in.
Unmerged revisions
- 33. By James Hunt
-
* functional/
test_upgrader. py:
- prepare(): Set cache dir to the root dir if '--root-dir' specified.
* ubuntucoreupgrader/upgrader. py:
- If the real upgrader exists, use it rather than creating an Upgrader
object. This will eventually allow the upgrader to be replaced (but
these tests to be retained, atleast for the medium term).
- Renamed call_upgrader() to call_upgrader_object( ).
- Removed unused update argument for call_upgrader_object( ).
I put some python code comments inline, I am not sure about the approach to test the python object and the executable in two different code paths. I think it would be preferable to convert the call_upgrader_ object to use the in-tree binary to avoid having two code paths. Once the code calls a external executable (the bin/ubuntu- core-upgrader from this source tree) it will be trivial to convert to call a different one once the need arises (i.e. once there is a external one that needs testing).
So instead of call_upgrader_ {object, command} maybe something like: command_ file, root_dir): normpath( os.path. join(os. path.dirname( __file_ _), "..")) os.environ) "PYTHONPATH" ] = pyroot check_call(
[os.path. join(pyroot, "bin", "ubuntu- core-upgrade" ),
'--root- dir', root_dir,
'--leave- files',
command_ file],
"""
def call_upgrader(
pyroot = os.path.
env = copy.copy(
env[
subprocess.
'--debug', '1',
# don't delete the archive and command files.
# The tests clean up after themselves so they will get removed then,
# but useful to have them around to diagnose test failures.
env=env)
"""