Skip to content

Commit c5727bc

Browse files
committed
added test cases
Signed-off-by: Atanas Atanasov <a.v.atanasov98@gmail.com>
1 parent dd245a8 commit c5727bc

File tree

1 file changed

+175
-23
lines changed

1 file changed

+175
-23
lines changed

docs/test-plan/files-historic-persistence-e2e-test-plan.md

Lines changed: 175 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,16 @@ logic. Essentially, this test plan describes the intended behavior of the
4747
- **Files Historic Root Path**: This is the root path (configurable) where all
4848
blocks will be archived. Generally, the stored blocks are long-lived as this
4949
type of persistence is used for long-term storage of blocks.
50-
- **Scope**: The `Files Historic Persistence` will handle Persisted Notifications
51-
that are arriving via the node's messaging system. It will then proceed to
52-
determine if it can archive the next batch or not. If it can, it will
53-
proceed to archive the batch in a zip file, using the node's `Block Provision`
54-
facility to supply the blocks that need to be archived. Finally, it will
55-
publish the result of the archive operation to the node's messaging system
56-
as a Persisted Notification, only if the archive was successful.
50+
- **Scope**: The `Files Historic Persistence` will handle Persisted
51+
Notifications that are arriving via the node's messaging system. It will then
52+
proceed to determine if it can archive the next batch or not. If it can, it
53+
will proceed to archive the batch in a zip file, using the node's
54+
`Block Provision` facility to supply the blocks that need to be archived.
55+
Finally, it will publish the result of the archive operation to the node's
56+
messaging system as a Persisted Notification, only if the archive was
57+
successful. An important clarification is that the
58+
`Files Historic Persistence` will only batch and archive blocks that have
59+
been persisted by other plugins with higher priority!
5760
- **Persistence Results**: `Files Historic Persistence` publishes persistence
5861
results to the node's messaging system when a successful archive happens.
5962
These results will be pushed to subscribed handlers.
@@ -93,38 +96,49 @@ logic. Essentially, this test plan describes the intended behavior of the
9396
> compression algorithm set to `ZStandard` so the file extension for an archived
9497
> block will be `.blk.zstd`_
9598
96-
| Test Case ID | Test Name | Implemented (Y/N) |
97-
|----------------------------------:|:----------|:-----------------:|
98-
| [E2ETC_FHP_0001](#E2ETC_FHP_0001) | `TBD` | N |
99-
| [E2ETC_FHP_0002](#E2ETC_FHP_0002) | `TBD` | N |
99+
| Test Case ID | Test Name | Implemented (Y/N) |
100+
|----------------------------------:|:-------------------------------------|:-----------------:|
101+
| [E2ETC_FHP_0001](#E2ETC_FHP_0001) | `Verify Archived Batch Zip Location` | N |
102+
| [E2ETC_FHP_0002](#E2ETC_FHP_0002) | `Verify Archived Batch Zip Content` | N |
103+
| [E2ETC_FHP_0003](#E2ETC_FHP_0003) | `Verify No Gaps in Zip` | N |
104+
| [E2ETC_FHP_0004](#E2ETC_FHP_0004) | `Verify Cleanup on IO Failure` | N |
105+
| [E2ETC_FHP_0005](#E2ETC_FHP_0005) | `Verify Immutable Zips` | N |
100106

101107
---
102108

103109
### E2ETC_FHP_0001
104110

105111
#### Test Name
106112

107-
TBD
113+
`Verify Archived Batch Zip Location`
108114

109115
#### Scenario Description
110116

111-
TBD
117+
Blocks are persisted in range `0-9` (the only ones currently in existence).
118+
A Persisted Notification is published to the node's messaging system for blocks
119+
persisted in range `0-9` with priority higher than the
120+
`Files Historic Persistence`'s . The `Files Historic Persistence` will then
121+
proceed to archive the batch of blocks in a zip file.
112122

113123
#### Requirements
114124

115-
TBD
125+
It is expected that the `Files Historic Persistence` will archive the batch
126+
successfully creating a zip file at the resolved location.
116127

117128
#### Preconditions
118129

119-
TBD
130+
A running plugin in the Block-Node under test that is able to publish a
131+
Persisted Notification for blocks persisted in range `0-9` with priority
132+
higher than the `Files Historic Persistence`'s.
120133

121134
#### Input
122135

123-
TBD
136+
Persisted Notification for blocks persisted in range `0-9` with priority
137+
higher than the `Files Historic Persistence`'s.
124138

125139
#### Output
126140

127-
TBD
141+
Regular file: `/blocks/000/000/000/000/000/00/00s.zip` exists.
128142

129143
#### Other
130144

@@ -136,27 +150,165 @@ N/A
136150

137151
#### Test Name
138152

139-
TBD
153+
`Verify Archived Batch Zip Content`
140154

141155
#### Scenario Description
142156

143-
TBD
157+
Blocks are persisted in range `0-9` (the only ones currently in existence).
158+
A Persisted Notification is published to the node's messaging system for blocks
159+
persisted in range `0-9` with priority higher than the
160+
`Files Historic Persistence`'s . The `Files Historic Persistence` will then
161+
proceed to archive the batch of blocks in a zip file.
144162

145163
#### Requirements
146164

147-
TBD
165+
It is expected that the `Files Historic Persistence` will archive the batch
166+
successfully creating a zip file at the resolved location.
148167

149168
#### Preconditions
150169

151-
TBD
170+
A running plugin in the Block-Node under test that is able to publish a
171+
Persisted Notification for blocks persisted in range `0-9` with priority
172+
higher than the `Files Historic Persistence`'s.
152173

153174
#### Input
154175

155-
TBD
176+
Persisted Notification for blocks persisted in range `0-9` with priority
177+
higher than the `Files Historic Persistence`'s.
156178

157179
#### Output
158180

159-
TBD
181+
Regular file: `/blocks/000/000/000/000/000/00/00s.zip` contains 10 entries
182+
for each block `0000000000000000000.blk.zstd` to `0000000000000000009.blk.zstd`.
183+
The binary content of each block is the same as the original block that was
184+
persisted.
185+
186+
#### Other
187+
188+
N/A
189+
190+
---
191+
192+
### E2ETC_FHP_0003
193+
194+
#### Test Name
195+
196+
`Verify No Gaps in Zip`
197+
198+
#### Scenario Description
199+
200+
Blocks are persisted in range `1-9` (the only ones currently in existence).
201+
A Persisted Notification is published to the node's messaging system for blocks
202+
persisted in range `1-9` with priority higher than the
203+
`Files Historic Persistence`'s . The `Files Historic Persistence` will then
204+
proceed to not archive the batch of blocks in a zip file.
205+
206+
#### Requirements
207+
208+
It is expected that the `Files Historic Persistence` will not archive the batch
209+
as there is a gap in the batch that is next to be archived. No files or data
210+
are expected to be persisted anywhere on the file system.
211+
212+
#### Preconditions
213+
214+
A running plugin in the Block-Node under test that is able to publish a
215+
Persisted Notification for blocks persisted in range `1-9` with priority
216+
higher than the `Files Historic Persistence`'s.
217+
218+
#### Input
219+
220+
Persisted Notification for blocks persisted in range `1-9` with priority
221+
higher than the `Files Historic Persistence`'s.
222+
223+
#### Output
224+
225+
Regular file: `/blocks/000/000/000/000/000/00/00s.zip` does not exist.
226+
227+
#### Other
228+
229+
N/A
230+
231+
---
232+
233+
### E2ETC_FHP_0004
234+
235+
#### Test Name
236+
237+
`Verify Cleanup on IO Failure`
238+
239+
#### Scenario Description
240+
241+
Blocks are persisted in range `0-9` (the only ones currently in existence).
242+
A Persisted Notification is published to the node's messaging system for blocks
243+
persisted in range `0-9` with priority higher than the
244+
`Files Historic Persistence`'s . The `Files Historic Persistence` will then
245+
proceed to archive the batch of blocks in a zip file.
246+
247+
#### Requirements
248+
249+
It is expected that the `Files Historic Persistence` will clean up any potential
250+
data and side effects produced during an attempt to archive a batch, but an IO
251+
issue has occurred during the archive attempt.
252+
253+
#### Preconditions
254+
255+
A running plugin in the Block-Node under test that is able to publish a
256+
Persisted Notification for blocks persisted in range `0-9` with priority
257+
higher than the `Files Historic Persistence`'s. A way to simulate an IO issue
258+
during the archive attempt.
259+
260+
#### Input
261+
262+
Persisted Notification for blocks persisted in range `0-9` with priority
263+
higher than the `Files Historic Persistence`'s.
264+
265+
#### Output
266+
267+
Regular file: `/blocks/000/000/000/000/000/00/00s.zip` does not exist.
268+
269+
#### Other
270+
271+
N/A
272+
273+
---
274+
275+
### E2ETC_FHP_0005
276+
277+
#### Test Name
278+
279+
`Verify Immutable Zips`
280+
281+
#### Scenario Description
282+
283+
Blocks are persisted in range `0-9` (the only ones currently in existence).
284+
A Persisted Notification is published to the node's messaging system for blocks
285+
persisted in range `0-9` with priority higher than the
286+
`Files Historic Persistence`'s . The `Files Historic Persistence` will then
287+
proceed to archive the batch of blocks in a zip file. The zip file is immutable
288+
and cannot be modified after it has been created.
289+
290+
#### Requirements
291+
292+
It is expected that the `Files Historic Persistence` will archive the batch
293+
successfully creating a zip file at the resolved location, and that the zip
294+
file is immutable, meaning that it cannot be modified after it has been created.
295+
296+
#### Preconditions
297+
298+
A running plugin in the Block-Node under test that is able to publish a
299+
Persisted Notification for blocks persisted in range `0-9` with priority
300+
higher than the `Files Historic Persistence`'s. A subsequent publish of the same
301+
notification is made after the first zip is successfully created.
302+
303+
#### Input
304+
305+
Persisted Notification for blocks persisted in range `0-9` with priority
306+
higher than the `Files Historic Persistence`'s. A subsequent publish of the same
307+
notification is made after the first zip is successfully created.
308+
309+
#### Output
310+
311+
Regular file: `/blocks/000/000/000/000/000/00/00s.zip` exists and is immutable.
160312

161313
#### Other
162314

0 commit comments

Comments
 (0)