os/kernelhwsrv/baseapitest/basesvs/validation/f32/sfsrv/scripts/PBASE-F32-RawDisk-PublicApi-REM.script
First public contribution.
2 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
3 // All rights reserved.
4 // This component and the accompanying materials are made available
5 // under the terms of "Eclipse Public License v1.0"
6 // which accompanies this distribution, and is available
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 // Initial Contributors:
10 // Nokia Corporation - initial contribution.
17 //! @SYMTestSuiteName pbase-f32-sfsrv-publicapi-rem
18 //! @SYMScriptTestEnvironment This test script requires a basic ROM and a MMC card (128 MB recommended, not tested above that).
19 //! @SYMScriptAuthor Alvar Udras, Runno Sgirka
20 //! @SYMScriptDescription The test script contains API tests for the following functions of RRawDisk class:
21 //! TInt Open(RFs &aFs, TInt aDrive);
23 //! TInt Read(TInt64 aPos, TDes8 &aDes);
24 //! TInt Write(TInt64 aPos, TDesC8 &aDes);
25 //! The tests are containing risk, e.g. Write() method call can corrupt the boot sector or
26 //! non-writable sector of the disc, which may corrupt the whole disk forever.
32 START_TESTCASE PBASE-F32-RawDisk-PublicApi-0001
33 //! @SYMTestCaseID PBASE-F32-RawDisk-PublicApi-0001
35 //! @SYMTestCaseDesc Functions Open() and Close() test. Open a disk channel and close it.
36 //! Uses API elements: Open(), Close().
37 //! @SYMTestActions 1. Create a RFs session.
38 //! 2. Connect the RFs session.
39 //! 3. call Open(RFs &aFs, TInt aDrive) method to open a direct access channel to disk, passing fileserver session, removable
40 //! drive as parameters.
41 //! 4. Call Close() method to close the channel.
42 //! 5. Close the RFs session.
43 //! @SYMTestStatus Implemented
44 //! @SYMTestPriority Critical
45 //! @SYMTestExpectedResults The Open() method call is completed returning KErrNone. The Close() method call is completed without errors.
47 START_TEST_BLOCK 100 t_sfsrv \base\PBASE-F32-RawDisk-PublicApi.ini
48 CREATE_OBJECT RFs rfs1
49 CREATE_OBJECT RRawDisk rawdisk1
53 COMMAND rawdisk1 Open PBASE-F32-RawDisk-PublicApi-0001-001-Open_command05
54 COMMAND rawdisk1 Close
59 END_TESTCASE PBASE-F32-RawDisk-PublicApi-0001
62 START_TESTCASE PBASE-F32-RawDisk-PublicApi-0002
63 //! @SYMTestCaseID PBASE-F32-RawDisk-PublicApi-0002
65 //! @SYMTestCaseDesc Function Write() and Read() test. Open a disk channel, write to the disc, verify it by reading and close the channel.
66 //! Uses API elements: Open(), Write(), Read(), Close().
67 //! @SYMTestActions 1. Create a RFs session.
68 //! 2. Connect the RFs session.
69 //! 3. Call Open(RFs &aFs, TInt aDrive) method to open a direct access channel to disk, passing fileserver session, removable
70 //! drive as parameters.
71 //! 4. Call Write(TInt64 aPos, TDes8 &aDes) method passing position 1024 and string 'Hello Big World!' to write
73 //! 5. Call Read(TInt64 aPos, TDes8 &aDes) method passing position 1024 and string 'Hello Big World!' for
74 //! verification as parameters.
75 //! 6. Call Close() method to close the disk.
76 //! 7. Close the RFs session.
77 //! @SYMTestStatus Implemented
78 //! @SYMTestPriority Critical
79 //! @SYMTestExpectedResults The Read() and Write() method calls are completed returning KErrNone.
81 START_TEST_BLOCK 100 t_sfsrv \base\PBASE-F32-RawDisk-PublicApi.ini
82 CREATE_OBJECT RFs rfs1
83 CREATE_OBJECT RRawDisk rawdisk1
87 COMMAND rawdisk1 Open PBASE-F32-RawDisk-PublicApi-0002-001-Open_command05
88 COMMAND rawdisk1 Write PBASE-F32-RawDisk-PublicApi-0002-001-Write_command06
89 COMMAND rawdisk1 Read PBASE-F32-RawDisk-PublicApi-0002-001-Read_command07
90 COMMAND rawdisk1 Close
95 END_TESTCASE PBASE-F32-RawDisk-PublicApi-0002
98 START_TESTCASE PBASE-F32-RawDisk-PublicApi-0003
99 //! @SYMTestCaseID PBASE-F32-RawDisk-PublicApi-0003
101 //! @SYMTestCaseDesc Function Write() and Read() test. Open a disk channel, write and read an empty string and close the channel.
102 //! Uses API elements: Open(), Write(), Read(), Close().
103 //! @SYMTestActions 1. Create a RFs session.
104 //! 2. Connect the RFs session.
105 //! 3. Call Open(RFs &aFs, TInt aDrive) method to open a direct access channel to disk, passing fileserver session, removable
106 //! drive as parameters.
107 //! 4. Call Write(TInt64 aPos, TDes8 &aDes) method passing position 1024 and empty string to write
109 //! 5. Call Read(TInt64 aPos, TDes8 &aDes) method passing position 1024 and empty string for
110 //! verification as parameters.
111 //! 6. Call Close() method to close the disk.
112 //! 7. Close the RFs session.
113 //! @SYMTestStatus Implemented
114 //! @SYMTestPriority Critical
115 //! @SYMTestExpectedResults The Read() and Write() method calls are completed returning KErrNone.
117 START_TEST_BLOCK 100 t_sfsrv \base\PBASE-F32-RawDisk-PublicApi.ini
118 CREATE_OBJECT RFs rfs1
119 CREATE_OBJECT RRawDisk rawdisk1
123 COMMAND rawdisk1 Open PBASE-F32-RawDisk-PublicApi-0003-001-Open_command05
124 COMMAND rawdisk1 Write PBASE-F32-RawDisk-PublicApi-0003-001-Write_command06
125 COMMAND rawdisk1 Read PBASE-F32-RawDisk-PublicApi-0003-001-Read_command07
126 COMMAND rawdisk1 Close
131 END_TESTCASE PBASE-F32-RawDisk-PublicApi-0003
134 // ************************
135 // *** NEGATIVE TESTS ***
136 // ************************
139 START_TESTCASE PBASE-F32-RawDisk-PublicApi-1007
140 //! @SYMTestCaseID PBASE-F32-RawDisk-PublicApi-1007
142 //! @SYMTestCaseDesc Test that checks that no other resources can access the disk while direct access to it is in effect.
143 //! Uses API elements: Open(), Close().
144 //! @SYMTestActions 1. Create a RFs session.
145 //! 2. Connect the RFs session.
146 //! 3. Call Open(RFs &aFs, TInt aDrive) method to open a direct access channel to disk, passing fileserver session, removable
147 //! drive as parameters.
148 //! 4. Create a RFile instance, passing fileserver session, EFileShareAny and {removable drive path}test03.txt as parameters.
149 //! 5. Close the RFile instance.
150 //! 6. Call Close() method to close the channel.
151 //! 7. Format the disk for future usage.
152 //! 8. Close the RFs session.
153 //! @SYMTestStatus Implemented
154 //! @SYMTestPriority Critical
155 //! @SYMTestExpectedResults The RFormat::Open() method call returns error -14 (KErrInUse).
157 START_TEST_BLOCK 100 t_sfsrv \base\PBASE-F32-RawDisk-PublicApi.ini
158 CREATE_OBJECT RFs rfs1
159 CREATE_OBJECT RRawDisk rawdisk1
160 CREATE_OBJECT RFile file
164 COMMAND rawdisk1 Open PBASE-F32-RawDisk-PublicApi-1007-001-Open_command05
166 COMMAND !Error=-14 file Create PBASE-F32-RawDisk-PublicApi-1007-001-Create_command07
169 COMMAND rawdisk1 Close
174 END_TESTCASE PBASE-F32-RawDisk-PublicApi-1007
177 START_TESTCASE PBASE-F32-RawDisk-PublicApi-1008
178 //! @SYMTestCaseID PBASE-F32-RawDisk-PublicApi-1008
180 //! @SYMTestCaseDesc Function Open() test. Call Open() after opening a resource on the disk.
181 //! Uses API elements: Open(), Close().
182 //! @SYMTestActions 1. Create a RFs session.
183 //! 2. Connect the RFs session.
184 //! 3. Open an RFormat instance, passing fileserver session, removable drive and EHighDensity as parameters.
185 //! 4. Call Open(RFs &aFs, TInt aDrive) method to open a direct access channel to disk, passing fileserver session, removable
186 //! drive as parameters.
187 //! 5. Call Close() method to close the channel.
188 //! 6. Close the RFormat instance.
189 //! 7. Format the disk for future usage.
190 //! 8. Close the RFs session.
191 //! @SYMTestStatus Implemented
192 //! @SYMTestPriority Critical
193 //! @SYMTestExpectedResults The Open() method call returns error -14 (KErrInUse).
195 START_TEST_BLOCK 100 t_sfsrv \base\PBASE-F32-RawDisk-PublicApi.ini
196 CREATE_OBJECT RFs rfs1
197 CREATE_OBJECT RRawDisk rawdisk1
198 CREATE_OBJECT RFormat format1
202 COMMAND format1 Open PBASE-F32-RawDisk-PublicApi-1008-001-Open_command05
204 COMMAND !Error=-14 rawdisk1 Open PBASE-F32-RawDisk-PublicApi-1008-001-Open_command07
205 COMMAND format1 Close
207 COMMAND rawdisk1 Close
212 END_TESTCASE PBASE-F32-RawDisk-PublicApi-1008
215 START_TESTCASE PBASE-F32-RawDisk-PublicApi-1009
216 //! @SYMTestCaseID PBASE-F32-RawDisk-PublicApi-1009
218 //! @SYMTestCaseDesc Test that checks that calling Close() allows other resources to access the disk.
219 //! Uses API elements: Open(), Close().
220 //! @SYMTestActions 1. Create a RFs session.
221 //! 2. Connect the RFs session.
222 //! 3. Call Open(RFs &aFs, TInt aDrive) method to open a direct access channel to disk, passing fileserver session, removable
223 //! drive as parameters.
224 //! 4. Call Close() method to close the channel.
225 //! 5. Open an RFormat instance, passing fileserver session, removable drive and EHighDensity as parameters.
226 //! 6. Close the RFormat instance.
227 //! 7. Close the RFs session.
228 //! @SYMTestStatus Implemented
229 //! @SYMTestPriority Critical
230 //! @SYMTestExpectedResults The RFormat instance can access the disk without errors.
232 START_TEST_BLOCK 100 t_sfsrv \base\PBASE-F32-RawDisk-PublicApi.ini
233 CREATE_OBJECT RFs rfs1
234 CREATE_OBJECT RRawDisk rawdisk1
235 CREATE_OBJECT RFormat format1
239 COMMAND rawdisk1 Open PBASE-F32-RawDisk-PublicApi-1009-001-Open_command05
240 COMMAND rawdisk1 Close
243 COMMAND format1 Open PBASE-F32-RawDisk-PublicApi-1009-001-Open_command09
244 COMMAND format1 Close
249 END_TESTCASE PBASE-F32-RawDisk-PublicApi-1009
252 START_TESTCASE PBASE-F32-RawDisk-PublicApi-1010
253 //! @SYMTestCaseID PBASE-F32-RawDisk-PublicApi-1010
255 //! @SYMTestCaseDesc Function Write() test. Open a disk channel, write to the disc, while starting writing from a negative position.
256 //! Uses API elements: Open(), Write(), Close().
257 //! @SYMTestActions 1. Create a RFs session.
258 //! 2. Connect the RFs session.
259 //! 3. Call Open(RFs &aFs, TInt aDrive) method to open a direct access channel to disk, passing fileserver session, removable
260 //! drive as parameters.
261 //! 4. Call Write(TInt64 aPos, TDes8 &aDes) method passing -1 as position, string 'Hello World!' to write as parameters.
262 //! 6. Call Close() method to close the disk.
263 //! 7. Format the disk for future usage.
264 //! 8. Close the RFs session.
265 //! @SYMTestStatus Implemented
266 //! @SYMTestPriority Critical
267 //! @SYMTestExpectedResults The Write() method call returns error -6 (KErrArgument).
269 START_TEST_BLOCK 100 t_sfsrv \base\PBASE-F32-RawDisk-PublicApi.ini
270 CREATE_OBJECT RFs rfs1
271 CREATE_OBJECT RRawDisk rawdisk1
272 CREATE_OBJECT RFormat format1
276 COMMAND rawdisk1 Open PBASE-F32-RawDisk-PublicApi-1010-001-Open_command05
277 COMMAND !Error=-6 rawdisk1 Write PBASE-F32-RawDisk-PublicApi-1010-001-Write_command06
278 COMMAND rawdisk1 Close
281 COMMAND format1 Open PBASE-F32-RawDisk-PublicApi-1010-001-Open_command10
283 COMMAND format1 Close
288 END_TESTCASE PBASE-F32-RawDisk-PublicApi-1010
291 START_TESTCASE PBASE-F32-RawDisk-PublicApi-1011
292 //! @SYMTestCaseID PBASE-F32-RawDisk-PublicApi-1011
294 //! @SYMTestCaseDesc Function Write() test. Open a disk channel, write to the disc, while starting writing from an out of range position.
295 //! Uses API elements: Open(), Write(), Close().
296 //! @SYMTestActions 1. Create a RFs session.
297 //! 2. Connect the RFs session.
298 //! 3. Call Open(RFs &aFs, TInt aDrive) method to open a direct access channel to disk, passing fileserver session, removable
299 //! drive as parameters.
300 //! 4. Call Write(TInt64 aPos, TDes8 &aDes) method passing 10000000 as position, string 'Hello World!' as parameters.
301 //! 6. Call Close() method to close the disk.
302 //! 7. Format the disk for future usage.
303 //! 8. Close the RFs session.
304 //! @SYMTestStatus Implemented
305 //! @SYMTestPriority Critical
306 //! @SYMTestExpectedResults The Write() method call returns error -20 (KErrCorrupt).
308 START_TEST_BLOCK 100 t_sfsrv \base\PBASE-F32-RawDisk-PublicApi.ini
309 CREATE_OBJECT RFs rfs1
310 CREATE_OBJECT RRawDisk rawdisk1
311 CREATE_OBJECT RFormat format1
315 COMMAND rawdisk1 Open PBASE-F32-RawDisk-PublicApi-1011-001-Open_command05
316 COMMAND !Error=-20 rawdisk1 Write PBASE-F32-RawDisk-PublicApi-1011-001-Write_command06
317 COMMAND rawdisk1 Close
320 COMMAND format1 Open PBASE-F32-RawDisk-PublicApi-1011-001-Open_command10
322 COMMAND format1 Close
326 END_TESTCASE PBASE-F32-RawDisk-PublicApi-1011
329 START_TESTCASE PBASE-F32-RawDisk-PublicApi-1012
330 //! @SYMTestCaseID PBASE-F32-RawDisk-PublicApi-1012
332 //! @SYMTestCaseDesc Function Read() test. Open a disk channel, read from disc, starting reading from a negative position, and close the channel.
333 //! Uses API elements: Open(), Read(), Close().
334 //! @SYMTestActions 1. Create a RFs session.
335 //! 2. Connect the RFs session.
336 //! 3. Call Open(RFs &aFs, TInt aDrive) method to open a direct access channel to disk, passing fileserver session, removable
337 //! drive as parameters.
338 //! 4. Call Read(TInt64 aPos, TDes8 &aDes) method passing -1 as position, string 'Hello World!' as parameters.
339 //! 5. Call Close() method to close the disk.
340 //! 6. Close the RFs session.
341 //! @SYMTestStatus Implemented
342 //! @SYMTestPriority Critical
343 //! @SYMTestExpectedResults The Read() method call returns error -6 (KErrArgument).
345 START_TEST_BLOCK 100 t_sfsrv \base\PBASE-F32-RawDisk-PublicApi.ini
346 CREATE_OBJECT RFs rfs1
347 CREATE_OBJECT RRawDisk rawdisk1
351 COMMAND rawdisk1 Open PBASE-F32-RawDisk-PublicApi-1012-001-Open_command05
352 COMMAND !Error=-6 rawdisk1 Read PBASE-F32-RawDisk-PublicApi-1012-001-Read_command06
353 COMMAND rawdisk1 Close
358 END_TESTCASE PBASE-F32-RawDisk-PublicApi-1012
361 START_TESTCASE PBASE-F32-RawDisk-PublicApi-1013
362 //! @SYMTestCaseID PBASE-F32-RawDisk-PublicApi-1013
364 //! @SYMTestCaseDesc Function Read() test. Open a disk channel, read from disc, starting reading from an out of range position,
365 //! and close the channel.
366 //! Uses API elements: Open(), Read(), Close().
367 //! @SYMTestActions 1. Create a RFs session.
368 //! 2. Connect the RFs session.
369 //! 3. Call Open(RFs &aFs, TInt aDrive) method to open a direct access channel to disk, passing fileserver session, removable
370 //! drive as parameters.
371 //! 4. Call Read(TInt64 aPos, TDes8 &aDes) method passing 10000000 as position, string 'Hello World!' as parameters.
372 //! 5. Call Close() method to close the disk.
373 //! 6. Close the RFs session.
374 //! @SYMTestStatus Implemented
375 //! @SYMTestPriority Critical
376 //! @SYMTestExpectedResults The Read() method call returns error -20 (KErrCorrupt).
378 START_TEST_BLOCK 100 t_sfsrv \base\PBASE-F32-RawDisk-PublicApi.ini
379 CREATE_OBJECT RFs rfs1
380 CREATE_OBJECT RRawDisk rawdisk1
384 COMMAND rawdisk1 Open PBASE-F32-RawDisk-PublicApi-1013-001-Open_command05
385 COMMAND !Error=-20 rawdisk1 Read PBASE-F32-RawDisk-PublicApi-1013-001-Read_command06
386 COMMAND rawdisk1 Close
391 END_TESTCASE PBASE-F32-RawDisk-PublicApi-1013