os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/Robustness.ini.DEVBOARD
First public contribution.
2 // ///////////////////////////////////////////////////////////////////////////
4 // Used by Robustness.script, SYSLIB-SQL-CIT-1705.
6 // This config file defines operations to test robustness of the SQLite
7 // system, under low disk conditions.
10 Delete0=E:\Robustness0.db
11 ExpectedError0=KErrNotFound
12 Create1=E:\Robustness0.db
13 Exec2=Create Table Sometable(Someint int primary key, Somereal real, Sometext text);
14 // Add a small amount of data and check it.
15 NewBlock3=AddBlock10-1
16 NewBlock4=CheckBlock10-1
17 // Fill the disk to within 100K of full. First fill to within 160k so we have
18 // an easy way of quickly getting 60K of disk back - by deleting 'fillfile'.
19 NewBlock5=FillDisk160K
20 NewBlock6=FillDisk100K
23 // Fill the disk until an out of disk error occurs. Then close the
24 // database because once it's reported a disk full error all bets are off..
28 // This will return things to 60K of disk free (because we filled to 160K,
29 // then to 100K with this file).
30 Delete10=E:\fillfile.txt
32 // Re-open the database. This is the point of the test - the database should
34 Open11=E:\Robustness0.db
36 // Delete the data that we used to fill the disk. This is easy, our 'AddBlock'
37 // data has 'Someint' values that are negative, the filldisk data is positive.
38 Exec12=Delete From Sometable where Someint >= 0;
40 // Check the original block is still ok...
41 NewBlock13=CheckBlock10-1
43 NewBlock14=AddBlock10-2
44 NewBlock15=CheckBlock10-2
47 Delete17=E:\Robustness0.db
48 Delete18=E:\fillfile2.txt
51 // Add two records to the table.
53 Prepare0=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
54 Function1=WriteBigTable
59 Text=Z:\TEF_SQL\TestData\reference1.txt
60 EventuallyExpectedError=KErrNone
64 // Add ten records to the table.
66 Prepare0=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
67 Function1=WriteBigTable
72 Text=Z:\TEF_SQL\TestData\reference1.txt
73 EventuallyExpectedError=KErrNone
77 // Add ten different records to the table.
79 Prepare0=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
80 Function1=WriteBigTable
85 Text=Z:\TEF_SQL\TestData\reference1.txt
86 EventuallyExpectedError=KErrNone
90 // Check the records added by AddBlock10-1
92 Prepare0=Select * from Sometable;
94 Function2=ReadBigTable
99 Text=Z:\TEF_SQL\TestData\reference1.txt
100 EventuallyExpectedError=KErrNone
103 // Check both blocks.
105 Prepare0=Select * from Sometable;
107 Function2=ReadBigTable
112 Text=Z:\TEF_SQL\TestData\reference1.txt
113 EventuallyExpectedError=KErrNone
118 // ///////////////////////////////////////////////////////////////////////////
120 // Fill the disk to within 4M of full.
122 Function0=NearFillDisk
123 FillFile=E:\fillfile4M.txt
127 // Fill the disk to within 160K of full.
129 Function0=NearFillDisk
130 FillFile=E:\fillfile2.txt
134 // Fill the disk to within 100K of full.
136 Function0=NearFillDisk
137 FillFile=E:\fillfile.txt
141 // Use 8k text chunks to fill the disk up not so quickly.
143 Prepare0=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
144 Function1=WriteBigTable
149 Text=Z:\TEF_SQL\TestData\reference1.txt
150 EventuallyExpectedError=KErrDiskFull
154 // Fill the disk with small records, slow. We should close the database once the
155 // i/o error has been seen - unless we have space reserved.
157 Prepare0=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
158 Function1=WriteBigTable
164 EventuallyExpectedError=KErrDiskFull
168 // ///////////////////////////////////////////////////////////////////////////
170 // Used by SYSLIB-SQL-CIT-1741
172 // This block has two concurrent, synchronized threads. It checks that
173 // a database can be modified when the disk is utterly full if disk space
174 // has been reserved, looks for appropriate errors and so forth.
176 // This block is initially triggered by 'FillTest' which is working
177 // on a separate db on the same disk at the same time.
180 Delete1=E:\Robustness5.db
181 ExpectedError1=KErrNotFound
182 DefineConfig2=page_size=1024;
184 Create3=E:\Robustness5.db
185 // Reserve 100K of space.
186 ReserveDriveSpace4=102400
187 Exec5=Create Table Sometable(Someint int primary key, Somereal real, Sometext text);
189 // Fill the disk to within 100K of full.
190 NewBlock6=FillDisk100K
192 // Fill the remaining 100K with db writes. Do NOT close - we have reserved space.
195 // Get the reserved space.
198 // And add two more records. No error should occur, we have reserved space now.
199 // Two of these records is <15K.
200 NewBlock9=AddBlock2-1
203 // Wake up 'FillTest'. There is very little disk space left (<8k?) at this
204 // point but it will be using very small records so it'll manage some.
206 // Goes to FillTest Step 7.
209 // FillTest has filled the disk remaining with small records.
210 // Our reserved disk space is actually shared so the following delete will
211 // fail - the reserve has gone. Two records, about 15k.
212 Exec13=delete from Sometable where Someint>=0 and Someint<2;
213 ExpectedError13=KErrDiskFull
214 ReleaseReserveAccess14=
218 // Goes to FillTest Step 13.
220 // Right, we're done. Clean up. Try releasing the reserve again, just to
221 // see if it will break anything.. Naturally we must do this before the
222 // RSqlDatabase::Close, we must have a valid object to do anything.
223 ReleaseReserveAccess18=
226 Delete21=E:\Robustness5.db
227 Delete22=E:\fillfile.txt
230 // Runs concurrently with DeleteTest.
232 Delete0=E:\Robustness4.db
233 ExpectedError0=KErrNotFound
234 Create1=E:\Robustness4.db
235 Exec2=Create Table Sometable(Someint int primary key, Somereal real, Sometext text);
236 // Add some data to the database.
237 NewBlock3=AddBlock10-1
238 NewBlock4=CheckBlock10-1
239 // Now trigger the 'DeleteTest' block - this fills the whole disk with a
240 // separate database and signals us back when it's done.
242 // Goes to DeleteTest step 1.
244 // Attempt to add more data to our database. Some will work, especially as
245 // our records are small. The 'FillTest-1' block is expecting an error.
246 Prepare7=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
250 // Wake up 'DeleteTest' again. It's going to delete a record or two.
251 // Goes to DeleteTest Step 13.
256 // We can't do any db operations now - this thread never had reserved disk space
257 // so all we can do is close down.
260 Delete14=E:\Robustness4.db
262 // Goes to DeleteTest step 18.
266 // Called by FillTest. Fills the (small) amount of remaining disk.
268 Function0=WriteBigTable
273 Text=Shine On You Crazy Diamond
274 EventuallyExpectedError=KErrDiskFull
277 // ///////////////////////////////////////////////////////////////////////////
279 // Used by SYSLIB-SQL-CIT-1704
281 // Here we create a database and add some data to it. Then we ATTACH another
282 // database (creating it in the process) on a completely different partition.
283 // We fill that partition with 'FillDisk' and then try to add one more record,
284 // which should fail. Then we attempt to delete the attached database,
285 // expecting 'KErrInUse', then we DETACH it and once more try to write to it,
286 // which of course fails. Then we delete it.
288 Delete0=C:\Robustness2.db
289 ExpectedError0=KErrNotFound
290 Delete1=E:\Robustness3.db
291 ExpectedError1=KErrNotFound
292 Create2=C:\Robustness2.db
294 Exec4=Create Table Maintable(MyInt int primary key, MyReal real, MyText text);
295 NewBlock5=AttachAddBlock
297 Exec6=Attach "E:\Robustness3.db" as TheAttached;
298 Exec7=Create Table TheAttached.Sometable(Someint int, Somereal real, Sometext text);
300 // Fill the disk to within 100K of full (with a file..)
301 NewBlock8=FillDisk160K
302 NewBlock9=FillDisk100K
304 // Fill up the drive with the attached database, first with big records,
309 // Re-open and re-attach.. Fill right to the limit with small records.
310 Open12=C:\Robustness2.db
311 Exec13=Attach "E:\Robustness3.db" as TheAttached;
315 // Re-open and re-attach...
316 Open16=C:\Robustness2.db
317 Exec17=Attach "E:\Robustness3.db" as TheAttached;
319 // Verify we can add no more.
320 Exec18=Insert into Sometable values(-90009, 2.718281828, "Hovercraft");
321 ExpectedError18=KErrDiskFull
323 // Close, re-open and re-attach, bets are off once we have a disk error.
325 Open20=C:\Robustness2.db
326 Exec21=Attach "E:\Robustness3.db" as TheAttached;
328 // Verify the attached db is locked.
329 Delete22=E:\Robustness3.db
330 ExpectedError22=KErrInUse
332 // Beyond this point we can't expect anything to work (necessarily) because
333 // there isn't any disk space left. So grab free off 60K to make sure
334 // (the fill to within 100K of full file which was created after filling
335 // to within 160K of full).
336 Delete23=E:\fillfile.txt
340 // The number of lines common to both tables is highly dependent on exactly
341 // how much space was left when the disk was filled. We really can't know
342 // how many lines there will be so lets just check there are some.. Even
343 // this might fail if the amount of space was very small..
344 Prepare26=Select * from Maintable, Sometable where(MyInt = Someint);
347 // Keep the reserve for the moment or we can't be sure things will run.
349 // We're in the middle of an RSqlStatement operation so this detach will
351 Exec29=Detach TheAttached;
352 ExpectedError29=KSqlErrGeneral
353 LastErrorMessage30=database TheAttached is locked
354 // Statement has NOT expired, because DETACH should have failed..
357 Exec33=Detach TheAttached;
358 Exec34=Select * from Sometable;
359 ExpectedError34=KSqlErrGeneral
360 LastErrorMessage35=no such table: Sometable
362 // Now try to delete it again. This attempt should be successful.
363 Delete36=E:\Robustness3.db
364 // This test has been done before..
365 Delete37=C:\Robustness2.db
366 ExpectedError37=KErrInUse
367 ReleaseReserveAccess38=
370 Delete41=C:\Robustness2.db
371 Delete42=E:\fillfile2.txt
374 // Just add a little to the database..
376 Prepare0=Insert into Maintable(MyInt, MyReal, MyText) values(:FInt, :FReal, :FText);
377 Function1=WriteBigTable
381 Multiplier=9.869604401
382 Text=Hey, here's some text.
383 EventuallyExpectedError=KErrNone