Skip to content

Commit

Permalink
t/nvmept_fdp: add a test(402)
Browse files Browse the repository at this point in the history
A test(402) checks whether dataplacement(fdp) works fine while replaying iologs

Signed-off-by: Hyunwoo Park <dshw.park@samsung.com>
  • Loading branch information
parkvibes committed May 27, 2024
1 parent f082667 commit e6a96fa
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion t/nvmept_fdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def setup(self, parameters):
'size', 'rate', 'bs', 'bssplit', 'bsrange', 'randrepeat',
'buffer_pattern', 'verify_pattern', 'offset', 'fdp',
'fdp_pli', 'fdp_pli_select', 'dataplacement', 'plid_select',
'plids', 'dp_scheme', 'number_ios']:
'plids', 'dp_scheme', 'number_ios', 'read_iolog']:
if opt in self.fio_opts:
option = f"--{opt}={self.fio_opts[opt]}"
fio_args.append(option)
Expand Down Expand Up @@ -148,6 +148,18 @@ def setup(self, parameters):
with open(scheme_path, mode='w') as f:
for i in range(mapping['nios_for_scheme']):
f.write(f'{mapping["hole_size"] * 2 * i}, {mapping["hole_size"] * 2 * (i+1)}, {i}\n')

if 'read_iolog' in self.fio_opts:
read_iolog_path = os.path.join(self.paths['test_dir'], self.fio_opts['read_iolog'])
with open(read_iolog_path, mode='w') as f:
f.write('fio version 2 iolog\n')
f.write(f'{self.fio_opts["filename"]} add\n')
f.write(f'{self.fio_opts["filename"]} open\n')

for i in range(mapping['nios_for_scheme']):
f.write(f'{self.fio_opts["filename"]} write {mapping["hole_size"] * 2 * i} {mapping["hole_size"]}\n')

f.write(f'{self.fio_opts["filename"]} close')

def _check_result(self):
if 'fdp_pli' in self.fio_opts:
Expand Down Expand Up @@ -789,6 +801,22 @@ def check_all_ruhs(dut):
},
"test_class": FDPMultiplePLIDTest,
},
# check whether dataplacement works while replaying iologs
{
"test_id": 402,
"fio_opts": {
"rw": "write:{hole_size}",
"bs": "{hole_size}",
"number_ios": "{nios_for_scheme}",
"verify": "crc32c",
"read_iolog": "iolog",
"dataplacement": "fdp",
"plid_select": "scheme",
"dp_scheme": "lba.scheme",
"output-format": "json",
},
"test_class": FDPMultiplePLIDTest,
},
]

def parse_args():
Expand Down

0 comments on commit e6a96fa

Please sign in to comment.