Merge lp:~psusi/landscape-client/correct-free-mem into lp:~landscape/landscape-client/trunk
Proposed by
Phillip Susi
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Chris Glass | ||||
Approved revision: | 594 | ||||
Merged at revision: | 602 | ||||
Proposed branch: | lp:~psusi/landscape-client/correct-free-mem | ||||
Merge into: | lp:~landscape/landscape-client/trunk | ||||
Diff against target: |
77 lines (+12/-10) 4 files modified
landscape/lib/sysstats.py (+4/-2) landscape/lib/tests/test_sysstats.py (+4/-4) landscape/monitor/tests/test_memoryinfo.py (+3/-3) landscape/sysinfo/tests/test_memory.py (+1/-1) |
||||
To merge this branch: | bzr merge lp:~psusi/landscape-client/correct-free-mem | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jerry Seutter (community) | Approve | ||
Geoff Teale (community) | Approve | ||
Review via email: mp+140541@code.launchpad.net |
This proposal supersedes a proposal from 2012-12-06.
Commit message
landscape-sysinfo was reporting memory usage values that
were entirely incorrect. This was because it was calculating free
memory to be all memory not on the active list. Changed to use
free + cached + buffers, just like the free command does.
Description of the change
Corrected test suite.
To post a comment you must log in.
There are a bunch of test failures, can you take a look at those?
[FAIL] andreas/ canonical/ source/ landscape- client/ psusi/correct- free-mem/ landscape/ tests/mocker. py", line 146, in test_method_wrapper andreas/ canonical/ source/ landscape- client/ psusi/correct- free-mem/ landscape/ lib/tests/ test_sysstats. py", line 42, in test_get_ memory_ info assertEqual( memstats. free_memory, 503) python2. 7/dist- packages/ twisted/ trial/unittest. py", line 271, in assertEqual trial.unittest. FailTest: not equal:
Traceback (most recent call last):
File "/home/
result = test_method()
File "/home/
self.
File "/usr/lib/
% (msg, pformat(first), pformat(second)))
twisted.
a = 852
b = 503
landscape. lib.tests. test_sysstats. MemoryStatsTest .test_get_ memory_ info ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= == andreas/ canonical/ source/ landscape- client/ psusi/correct- free-mem/ landscape/ tests/mocker. py", line 146, in test_method_wrapper andreas/ canonical/ source/ landscape- client/ psusi/correct- free-mem/ landscape/ monitor/ tests/test_ memoryinfo. py", line 154, in test_exchange_ messages andreas/ canonical/ source/ landscape- client/ psusi/correct- free-mem/ landscape/ tests/helpers. py", line 82, in assertMessages assertMessage( obtained_ message, expected_message) andreas/ canonical/ source/ landscape- client/ psusi/correct- free-mem/ landscape/ tests/helpers. py", line 76, in assertMessage pformat( obtained) )) trial.unittest. FailTest: Messages don't match.
=======
[FAIL]
Traceback (most recent call last):
File "/home/
result = test_method()
File "/home/
(step_size * 2, 503, 1567)]}])
File "/home/
self.
File "/home/
pprint.
twisted.
Expected:
{'memory-info': [(300, 503, 1567), (600, 503, 1567)], 'type': 'memory-info'}
Obtained:
{'memory-info': [(300, 852, 1567), (600, 852, 1567)], 'type': 'memory-info'}
landscape. monitor. tests.test_ memoryinfo. MemoryInfoTest. test_exchange_ messages ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= == andreas/ canonical/ source/ landscape- client/ psusi/correct- free-mem/ landscape/ tests/mocker. py", line 146, in test_method_wrapper andreas/ canonical/ source/ landscape- client/ psusi/correct- free-mem/ landscape/ monitor/ tests/test_ memoryinfo. py", line 78, in test_read_ sample_ data assertEqual( message[ "memory- info"][ 0], (step_size, 503, 1567)) python2. 7/dist- packages/ twisted/ trial/unittest. py", line 271, in assertEqual trial.unittest. FailTest: not equal:
=======
[FAIL]
Traceback (most recent call last):
File "/home/
result = test_method()
File "/home/
self.
File "/usr/lib/
% (msg, pformat(first), pformat(second)))
twisted.
a = (300, 852, 1567)
b = (300, 503, 1567)
landscape. monitor. tests.test_ memoryinfo. MemoryInfoTest. test_read_ sample_ data ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= == andreas/ canonical/ source/ landscape- client/ psusi/correct- free-mem/ landscape/ tests/mocker. py", line 146, in test_method_wrapper andreas/ canonical/ source/ landscape- client/ psusi/correct- free-mem/ landscape/ sysinfo/ tests/test_ memory. py", line 53, in test_run_ adds_header
=======
[FAIL]
Traceback (most recent call last):
File "/home/
result = test_method()
File "/home/
("Swap usage", "39%")])
File...