From 20df3fa4f9f2ec830086f48fa8a2eb1663bf86bd Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Fri, 17 Jun 2022 21:26:36 +0200 Subject: [PATCH] Add test for memory allocation flags --- test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test.py b/test.py index 1836655..0412baf 100755 --- a/test.py +++ b/test.py @@ -172,6 +172,11 @@ class TestInBrowser(TestBase): self.assertEqual(trigger_proc_name.text, 'sed', 'Unexpected trigger process name') trigger_proc_pid = self.driver.find_element(By.CLASS_NAME, 'trigger_proc_pid') self.assertEqual(trigger_proc_pid.text, '29481', 'Unexpected trigger process pid') + trigger_proc_gfp_mask = self.driver.find_element(By.CLASS_NAME, 'trigger_proc_gfp_mask') + self.assertEqual(trigger_proc_gfp_mask.text, + '0x201da (GFP_KERNEL | GFP_USER | GFP_HIGHUSER | ' + 'GFP_HIGHUSER_MOVABLE | __GFP_RECLAIMABLE | __GFP_COLD)', + 'Unexpected GFP Mask') killed_proc_score = self.driver.find_element(By.CLASS_NAME, 'killed_proc_score') self.assertEqual(killed_proc_score.text, '651', 'Unexpected OOM score of killed process') @@ -206,6 +211,9 @@ class TestInBrowser(TestBase): def check_results_ubuntu2110(self): """Check the results of the analysis of the Ubuntu example""" + trigger_proc_gfp_mask = self.driver.find_element(By.CLASS_NAME, 'trigger_proc_gfp_mask') + self.assertEqual(trigger_proc_gfp_mask.text, '0xcc0 (GFP_KERNEL)', 'Unexpected GFP Mask') + dirty_pages = self.driver.find_element(By.CLASS_NAME, 'dirty_pages') self.assertEqual(dirty_pages.text, '633 pages', 'Unexpected number of dirty pages')