@@ -45,22 +45,29 @@ def get_rss_from_pmap():
45
45
46
46
def make_guest_dirty_memory (ssh_connection , should_oom = False , amount = 8192 ):
47
47
"""Tell the guest, over ssh, to dirty `amount` pages of memory."""
48
+ logger = logging .getLogger ("make_guest_dirty_memory" )
49
+
48
50
amount_in_mbytes = amount / MB_TO_PAGES
49
51
50
- exit_code , _ , _ = ssh_connection .execute_command (
51
- "/sbin/fillmem {}" .format (amount_in_mbytes )
52
- )
52
+ cmd = f"/sbin/fillmem { amount_in_mbytes } "
53
+ exit_code , stdout , stderr = ssh_connection .execute_command (cmd )
54
+ # add something to the logs for troubleshooting
55
+ if exit_code != 0 :
56
+ logger .error ("while running: %s" , cmd )
57
+ logger .error ("stdout: %s" , stdout .read ())
58
+ logger .error ("stderr: %s" , stderr .read ())
53
59
54
60
cmd = "cat /tmp/fillmem_output.txt"
55
61
_ , stdout , _ = ssh_connection .execute_command (cmd )
56
62
if should_oom :
57
63
assert (
58
- exit_code == 0
59
- and ("OOM Killer stopped the program with " "signal 9, exit code 0" )
60
- in stdout .read ()
64
+ "OOM Killer stopped the program with "
65
+ "signal 9, exit code 0" in stdout .read ()
61
66
)
62
67
else :
63
- assert exit_code == 0 and ("Memory filling was " "successful" ) in stdout .read ()
68
+ assert exit_code == 0 , stderr .read ()
69
+ stdout_txt = stdout .read ()
70
+ assert "Memory filling was successful" in stdout_txt , stdout_txt
64
71
65
72
66
73
def build_test_matrix (network_config , bin_cloner_path , logger ):
0 commit comments