Merge lp:~mandel/ubuntu-download-manager/test-space-left into lp:ubuntu-download-manager
| Status: | Needs review |
|---|---|
| Proposed branch: | lp:~mandel/ubuntu-download-manager/test-space-left |
| Merge into: | lp:ubuntu-download-manager |
| Diff against target: |
1478 lines (+846/-85) 16 files modified
CMakeLists.txt (+1/-1) debian/control (+2/-0) src/common/priv/CMakeLists.txt (+2/-0) src/common/priv/ubuntu/transfers/system/file_manager.cpp (+24/-10) src/common/priv/ubuntu/transfers/system/file_manager.h (+9/-11) src/downloads/priv/ubuntu/downloads/file_download.cpp (+81/-11) src/downloads/priv/ubuntu/downloads/file_download.h (+3/-1) src/extractor/ubuntu/downloads/extractor/deflator.h (+3/-4) src/extractor/ubuntu/downloads/extractor/main.cpp (+8/-3) src/extractor/ubuntu/downloads/extractor/unzip.cpp (+58/-7) src/extractor/ubuntu/downloads/extractor/unzip.h (+5/-5) tests/common/CMakeLists.txt (+16/-14) tests/common/file_manager.h (+5/-6) tests/common/matchers.h (+15/-4) tests/downloads/daemon/test_download.cpp (+601/-4) tests/downloads/daemon/test_download.h (+13/-4) |
| To merge this branch: | bzr merge lp:~mandel/ubuntu-download-manager/test-space-left |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Michael Sheldon (community) | 2015-02-09 | Needs Fixing on 2015-02-27 | |
| PS Jenkins bot | continuous-integration | Approve on 2015-02-26 | |
| Ricardo Salveti | Needs Fixing on 2015-02-26 | ||
|
Review via email:
|
|||
Commit Message
Add a new check to ensure that there is enough space left in the device for unity8 to boot. This commit adds two new dependencies:
libboost-
libboost-system-dev
Description of the Change
This branch adds an extra test in the download manager that will ensure that files are not downloaded when the space left in the device is not enough for unity8 to start. If a file is downloaded and yet does not fit in the evice a file error is raised.
The check is done as lazy a possible in case the space was freed while the download was in progress.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:339
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 340. By Manuel de la Peña on 2015-02-10
-
Update code according to code review.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:340
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Michael Sheldon (michael-sheldon) wrote : | # |
It's still possible to run out of disk space if you download a large zipped album from 7 digital. I had 202MB free, I downloaded a 112MB album from 7 digital, download manager then unzipped it resulting in the system running out of space during the unzipping process.
- 341. By Manuel de la Peña on 2015-02-23
-
Check that when a file is unzip we do have enough space in the device.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:341
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Michael Sheldon (michael-sheldon) wrote : | # |
The fix doesn't appear to be working correctly, with 220MB left on the device I'm still able to download a 117MB zip file from 7digital and have download manager unpack it and leaving the device with 0MB free.
Should the --size option really be added to the args alongside --unzip? Shouldn't there be a call to the helper with just --size prior to --unzip being called? I suspect it might be unzipping whilst checking the size.
Also I spotted a small typo in one of the comments (unity3 -> unity8)
As a future improvement I think it'd be a handy if we use the Content-Length header if the server provides it to determine whether there'll be enough space prior to starting the download as well as doing it afterwards; that way we can save the user from wasting their data allowance on downloads that we know in advance we won't be able to save.
- 342. By Manuel de la Peña on 2015-02-25
-
Add missing tests for the unzip path. Ensure that we do parse the --size result correctly.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:342
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Michael Sheldon (michael-sheldon) wrote : | # |
Retested and it's still allowing the zip to be unpacked I'm afraid, it looks like the helper isn't reporting the correct size, I just tried running it manually via:
/usr/lib/
And its output was just "3" (the actual unpacked size is 114MB)
- 343. By Manuel de la Peña on 2015-02-26
-
Remember to just deal with the last line ot stdout from unzip.
| Manuel de la Peña (mandel) wrote : | # |
Fixed. Thx for the pointer.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:343
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 344. By Manuel de la Peña on 2015-02-26
-
Fix small typo.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:344
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Michael Sheldon (michael-sheldon) wrote : | # |
Still not working correctly I'm afraid, when the download completes a "Process Error" message is displayed briefly. Running the udm extractor manually on the file results in no output and a return code of 1 (presumably what triggers the process error).
Unmerged revisions
- 344. By Manuel de la Peña on 2015-02-26
-
Fix small typo.
- 343. By Manuel de la Peña on 2015-02-26
-
Remember to just deal with the last line ot stdout from unzip.
- 342. By Manuel de la Peña on 2015-02-25
-
Add missing tests for the unzip path. Ensure that we do parse the --size result correctly.
- 341. By Manuel de la Peña on 2015-02-23
-
Check that when a file is unzip we do have enough space in the device.
- 340. By Manuel de la Peña on 2015-02-10
-
Update code according to code review.
- 339. By Manuel de la Peña on 2015-02-09
-
Ensure that if the space left in the device is not enough that downloads will fail.

Raised a couple of small issues in the diff comments, but other than those this looks good to me. I've only done a code review so far though, haven't tested the functionality on a device yet.