From eaa357dd2880277967fd0fe76a8d75b16d3c11a2 Mon Sep 17 00:00:00 2001 From: Dhanuka Warusadura Date: Tue, 15 Aug 2023 21:22:13 +0530 Subject: [PATCH] zdtm: update check_pages_counts() to support memfd_secret dump stats These changes update `check_pages_counts()` to support `secmempages_written` stat. Signed-off-by: Dhanuka Warusadura --- test/zdtm.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/zdtm.py b/test/zdtm.py index 7a7cdfd3b6..b3b6f3c57a 100755 --- a/test/zdtm.py +++ b/test/zdtm.py @@ -1257,8 +1257,12 @@ def check_pages_counts(self): with open(self.__stats_file("dump"), 'rb') as stfile: stats = crpc.images.load(stfile) stent = stats['entries'][0]['dump'] - stats_written = int(stent['shpages_written']) + int( - stent['pages_written']) + if stent['secmempages_written']: + stats_written = int(stent['secmempages_written']) + int( + stent['pages_written']) + 1 + else: + stats_written = int(stent['shpages_written']) + int( + stent['pages_written']) if self.__stream: self.spawn_criu_image_streamer("extract")