1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Copyright (c) 2015-2016 Western Digital Corporation or its affiliates.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# Author: Chaitanya Kulkarni <chaitanya.kulkarni@hgst.com>
#
"""
NVMe Write Zeros:-
1. Issue a write command to block of data.
2. Read from same block to verify data pattern.
3. Issue write zeros to the block of data.
4. Read from same block, should be all zeroes.
"""
"""
Represents NVMe Write Zero Testcase.
- Attributes:
- zero_file : file with all '\0' to compare the zero data.
- data_size : data size to perform IO.
- start_block : starting block of to perform IO.
- block_count: Number of blocks to use in IO.
- test_log_dir : directory for logs, temp files.
"""
""" Pre Section for TestNVMeWriteZeros """
= 1023
= 0
= + +
= + +
= + +
""" Post Section for TestNVMeWriteZeros """
""" Wrapper for nvme write-zeroe
- Args:
- None
- Returns:
- return code for nvme write command.
"""
= + + \
+ + \
+
return
""" Validate the file which had been read from the device
- Args:
- None
- Returns:
- 0 on success, 1 on failure
"""
return 0
"""
Validate the data which is zeroed out via write-zeroes
- Args:
- None
- Returns:
- 0 on success, 1 on failure
"""
return 0
""" Testcae main """