import shutil
import logging
import argparse
+import re
from pathlib import Path
from statsmodels.sandbox.stats.runs import runstest_1samp
from fiotestlib import FioExeTest, FioJobFileTest, run_fio_tests
if self.json_data['jobs'][1]['read']['io_kbytes'] != 8:
self.passed = False
+class FioJobFileTest_t0033(FioJobFileTest):
+ """Test log file format"""
+ def check_result(self):
+ super().check_result()
+
+ if not self.passed:
+ return
+
+ patterns = {
+ 'log_bw.1.log': '\\d+, \\d+, \\d+, \\d+, 0x[\\da-f]+\\n',
+ 'log_clat.2.log': '\\d+, \\d+, \\d+, \\d+, 0, \\d+\\n',
+ 'log_iops.3.log': '\\d+, \\d+, \\d+, \\d+, \\d+, 0x[\\da-f]+\\n',
+ 'log_iops.4.log': '\\d+, \\d+, \\d+, \\d+, 0, 0, \\d+\\n',
+ }
+
+ for logfile in patterns.keys():
+ file_path = os.path.join(self.paths['test_dir'], logfile)
+ with open(file_path, "r") as f:
+ line = f.readline()
+ if not re.match(patterns[logfile], line):
+ self.passed = False
+ self.failure_reason = "wrong log file format: " + logfile
+ return
+
class FioJobFileTest_iops_rate(FioJobFileTest):
"""Test consists of fio test job t0011
Confirm that job0 iops == 1000
'pre_success': SUCCESS_DEFAULT,
'requirements': [Requirements.linux, Requirements.libaio],
},
+ {
+ 'test_id': 33,
+ 'test_class': FioJobFileTest_t0033,
+ 'job': 't0033.fio',
+ 'success': SUCCESS_DEFAULT,
+ 'pre_job': None,
+ 'pre_success': None,
+ 'pre_success': SUCCESS_DEFAULT,
+ 'requirements': [Requirements.linux, Requirements.libaio],
+ },
{
'test_id': 1000,
'test_class': FioExeTest,