[PATCH 2/2][autotest-client-tests] UBUNTU: SAUCE: ubuntu_performance_fio: Change value of FIO global file_size_mb

Ian May ian.may at canonical.com
Fri Dec 4 15:59:52 UTC 2020


The new FIO tests use multiple file sizes, ubuntu_performance_fio.py does a check
of available RAM before starting the tests.  By initializing to the largest size used,
the check will still be valid.

Instead of inserting the global file size into the test file, changed to extracting the
file size out of the test file for display output.

Signed-off-by: Ian May <ian.may at canonical.com>
---
 ubuntu_performance_fio/ubuntu_performance_fio.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ubuntu_performance_fio/ubuntu_performance_fio.py b/ubuntu_performance_fio/ubuntu_performance_fio.py
index 8ee68367..39750702 100644
--- a/ubuntu_performance_fio/ubuntu_performance_fio.py
+++ b/ubuntu_performance_fio/ubuntu_performance_fio.py
@@ -22,7 +22,7 @@ test_iterations = 3
 #
 # Size of FIO files in MB
 #
-file_size_mb=2048
+file_size_mb=32768
 #
 # Max size of ramfs image (16GB)
 #
@@ -285,14 +285,14 @@ class ubuntu_performance_fio(test.test):
         file = testname + ".fio"
         fin = open(os.path.join(self.bindir, file), "r")
         fout = open(os.path.join(self.srcdir, file), "w")
-        file_size = "%dM" % (file_size_mb)
 
         for line in fin:
             if TEST_FILESYSTEM == None or TEST_DRIVE_DEV == None:
                 line = line.replace("DIRECTORY", test_dir)
             else:
                 line = line.replace("DIRECTORY", TEST_MNT)
-            line = line.replace("SIZE", file_size)
+	    if line.startswith("size="):
+	        file_size_mb = line.split("size=", 1)[1].rstrip('\n')
             #
             #  zfs and ramdisk can't do O_DIRECT, so skip this
             #
-- 
2.25.1




More information about the kernel-team mailing list