os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/config/Robustness.ini.DEVBOARD
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
sl@0
     2
// ///////////////////////////////////////////////////////////////////////////
sl@0
     3
//
sl@0
     4
// Used by Robustness.script, SYSLIB-SQL-CIT-1705.
sl@0
     5
//
sl@0
     6
// This config file defines operations to test robustness of the SQLite
sl@0
     7
// system, under low disk conditions.
sl@0
     8
//
sl@0
     9
[Top]
sl@0
    10
Delete0=E:\Robustness0.db
sl@0
    11
ExpectedError0=KErrNotFound
sl@0
    12
Create1=E:\Robustness0.db
sl@0
    13
Exec2=Create Table Sometable(Someint int primary key, Somereal real, Sometext text);
sl@0
    14
// Add a small amount of data and check it.
sl@0
    15
NewBlock3=AddBlock10-1
sl@0
    16
NewBlock4=CheckBlock10-1
sl@0
    17
// Fill the disk to within 100K of full. First fill to within 160k so we have
sl@0
    18
// an easy way of quickly getting 60K of disk back - by deleting 'fillfile'.
sl@0
    19
NewBlock5=FillDisk160K
sl@0
    20
NewBlock6=FillDisk100K
sl@0
    21
sl@0
    22
NoOperation7=
sl@0
    23
// Fill the disk until an out of disk error occurs. Then close the
sl@0
    24
// database because once it's reported a disk full error all bets are off..
sl@0
    25
NewBlock8=FillDisk1
sl@0
    26
Close9=
sl@0
    27
sl@0
    28
// This will return things to 60K of disk free (because we filled to 160K,
sl@0
    29
// then to 100K with this file).
sl@0
    30
Delete10=E:\fillfile.txt
sl@0
    31
sl@0
    32
// Re-open the database. This is the point of the test - the database should
sl@0
    33
// still be usable.
sl@0
    34
Open11=E:\Robustness0.db
sl@0
    35
sl@0
    36
// Delete the data that we used to fill the disk. This is easy, our 'AddBlock'
sl@0
    37
// data has 'Someint' values that are negative, the filldisk data is positive.
sl@0
    38
Exec12=Delete From Sometable where Someint >= 0;
sl@0
    39
sl@0
    40
// Check the original block is still ok...
sl@0
    41
NewBlock13=CheckBlock10-1
sl@0
    42
sl@0
    43
NewBlock14=AddBlock10-2
sl@0
    44
NewBlock15=CheckBlock10-2
sl@0
    45
sl@0
    46
Close16=
sl@0
    47
Delete17=E:\Robustness0.db
sl@0
    48
Delete18=E:\fillfile2.txt
sl@0
    49
EndBlock19=
sl@0
    50
sl@0
    51
// Add two records to the table.
sl@0
    52
[AddBlock2-1]
sl@0
    53
Prepare0=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
sl@0
    54
Function1=WriteBigTable
sl@0
    55
LowCount=-30
sl@0
    56
HighCount=-29
sl@0
    57
CountStep=1
sl@0
    58
Multiplier=-1.859785
sl@0
    59
Text=Z:\TEF_SQL\TestData\reference1.txt
sl@0
    60
EventuallyExpectedError=KErrNone
sl@0
    61
St_Close2=
sl@0
    62
EndBlock3=
sl@0
    63
sl@0
    64
// Add ten records to the table.
sl@0
    65
[AddBlock10-1]
sl@0
    66
Prepare0=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
sl@0
    67
Function1=WriteBigTable
sl@0
    68
LowCount=-20
sl@0
    69
HighCount=-11
sl@0
    70
CountStep=1
sl@0
    71
Multiplier=-1.859785
sl@0
    72
Text=Z:\TEF_SQL\TestData\reference1.txt
sl@0
    73
EventuallyExpectedError=KErrNone
sl@0
    74
St_Close2=
sl@0
    75
EndBlock3=
sl@0
    76
sl@0
    77
// Add ten different records to the table.
sl@0
    78
[AddBlock10-2]
sl@0
    79
Prepare0=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
sl@0
    80
Function1=WriteBigTable
sl@0
    81
LowCount=-10
sl@0
    82
HighCount=-1
sl@0
    83
CountStep=1
sl@0
    84
Multiplier=-1.859785
sl@0
    85
Text=Z:\TEF_SQL\TestData\reference1.txt
sl@0
    86
EventuallyExpectedError=KErrNone
sl@0
    87
St_Close2=
sl@0
    88
EndBlock3=
sl@0
    89
sl@0
    90
// Check the records added by AddBlock10-1
sl@0
    91
[CheckBlock10-1]
sl@0
    92
Prepare0=Select * from Sometable;
sl@0
    93
Next1=KSqlAtRow
sl@0
    94
Function2=ReadBigTable
sl@0
    95
LowCount=-20
sl@0
    96
HighCount=-11
sl@0
    97
CountStep=1
sl@0
    98
Multiplier=-1.859785
sl@0
    99
Text=Z:\TEF_SQL\TestData\reference1.txt
sl@0
   100
EventuallyExpectedError=KErrNone
sl@0
   101
St_Close3=
sl@0
   102
EndBlock4=
sl@0
   103
// Check both blocks.
sl@0
   104
[CheckBlock10-2]
sl@0
   105
Prepare0=Select * from Sometable;
sl@0
   106
Next1=KSqlAtRow
sl@0
   107
Function2=ReadBigTable
sl@0
   108
LowCount=-20
sl@0
   109
HighCount=-1
sl@0
   110
CountStep=1
sl@0
   111
Multiplier=-1.859785
sl@0
   112
Text=Z:\TEF_SQL\TestData\reference1.txt
sl@0
   113
EventuallyExpectedError=KErrNone
sl@0
   114
St_Close3=
sl@0
   115
EndBlock4=
sl@0
   116
sl@0
   117
sl@0
   118
// /////////////////////////////////////////////////////////////////////////// 
sl@0
   119
sl@0
   120
// Fill the disk to within 4M of full.
sl@0
   121
[FillDisk4M]
sl@0
   122
Function0=NearFillDisk
sl@0
   123
FillFile=E:\fillfile4M.txt
sl@0
   124
DiskFree=4194304
sl@0
   125
EndBlock1=
sl@0
   126
sl@0
   127
// Fill the disk to within 160K of full.
sl@0
   128
[FillDisk160K]
sl@0
   129
Function0=NearFillDisk
sl@0
   130
FillFile=E:\fillfile2.txt
sl@0
   131
DiskFree=168960
sl@0
   132
EndBlock1=
sl@0
   133
sl@0
   134
// Fill the disk to within 100K of full.
sl@0
   135
[FillDisk100K]
sl@0
   136
Function0=NearFillDisk
sl@0
   137
FillFile=E:\fillfile.txt
sl@0
   138
DiskFree=102400
sl@0
   139
EndBlock1=
sl@0
   140
sl@0
   141
// Use 8k text chunks to fill the disk up not so quickly.
sl@0
   142
[FillDisk1]
sl@0
   143
Prepare0=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
sl@0
   144
Function1=WriteBigTable
sl@0
   145
LowCount=0
sl@0
   146
HighCount=999999
sl@0
   147
CountStep=1
sl@0
   148
Multiplier=299792458
sl@0
   149
Text=Z:\TEF_SQL\TestData\reference1.txt
sl@0
   150
EventuallyExpectedError=KErrDiskFull
sl@0
   151
St_Close2=
sl@0
   152
EndBlock3=
sl@0
   153
sl@0
   154
// Fill the disk with small records, slow. We should close the database once the
sl@0
   155
// i/o error has been seen - unless we have space reserved.
sl@0
   156
[FillDisk2]
sl@0
   157
Prepare0=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
sl@0
   158
Function1=WriteBigTable
sl@0
   159
LowCount=1000000
sl@0
   160
HighCount=1999999
sl@0
   161
CountStep=1
sl@0
   162
Multiplier=299792458
sl@0
   163
Text=S
sl@0
   164
EventuallyExpectedError=KErrDiskFull
sl@0
   165
St_Close2=
sl@0
   166
EndBlock3=
sl@0
   167
sl@0
   168
// ///////////////////////////////////////////////////////////////////////////
sl@0
   169
//
sl@0
   170
// Used by SYSLIB-SQL-CIT-1741
sl@0
   171
// 
sl@0
   172
// This block has two concurrent, synchronized threads. It checks that
sl@0
   173
// a database can be modified when the disk is utterly full if disk space
sl@0
   174
// has been reserved, looks for appropriate errors and so forth.
sl@0
   175
//
sl@0
   176
// This block is initially triggered by 'FillTest' which is working
sl@0
   177
// on a separate db on the same disk at the same time.
sl@0
   178
[DeleteTest]
sl@0
   179
WaitA0=1
sl@0
   180
Delete1=E:\Robustness5.db
sl@0
   181
ExpectedError1=KErrNotFound
sl@0
   182
DefineConfig2=page_size=1024;
sl@0
   183
sl@0
   184
Create3=E:\Robustness5.db
sl@0
   185
// Reserve 100K of space.
sl@0
   186
ReserveDriveSpace4=102400
sl@0
   187
Exec5=Create Table Sometable(Someint int primary key, Somereal real, Sometext text);
sl@0
   188
sl@0
   189
// Fill the disk to within 100K of full.
sl@0
   190
NewBlock6=FillDisk100K
sl@0
   191
sl@0
   192
// Fill the remaining 100K with db writes. Do NOT close - we have reserved space.
sl@0
   193
NewBlock7=FillDisk1
sl@0
   194
sl@0
   195
// Get the reserved space.
sl@0
   196
GetReserveAccess8=
sl@0
   197
sl@0
   198
// And add two more records. No error should occur, we have reserved space now.
sl@0
   199
// Two of these records is <15K.
sl@0
   200
NewBlock9=AddBlock2-1
sl@0
   201
NoOperation10=
sl@0
   202
sl@0
   203
// Wake up 'FillTest'. There is very little disk space left (<8k?) at this
sl@0
   204
// point but it will be using very small records so it'll manage some.
sl@0
   205
SignalB11=1
sl@0
   206
// Goes to FillTest Step 7.
sl@0
   207
WaitA12=1
sl@0
   208
sl@0
   209
// FillTest has filled the disk remaining with small records.
sl@0
   210
// Our reserved disk space is actually shared so the following delete will
sl@0
   211
// fail - the reserve has gone. Two records, about 15k.
sl@0
   212
Exec13=delete from Sometable where Someint>=0 and Someint<2;
sl@0
   213
ExpectedError13=KErrDiskFull
sl@0
   214
ReleaseReserveAccess14=
sl@0
   215
LastErrorMessage15=
sl@0
   216
SignalB16=1
sl@0
   217
WaitA17=1
sl@0
   218
// Goes to FillTest Step 13.
sl@0
   219
sl@0
   220
// Right, we're done. Clean up. Try releasing the reserve again, just to
sl@0
   221
// see if it will break anything.. Naturally we must do this before the
sl@0
   222
// RSqlDatabase::Close, we must have a valid object to do anything.
sl@0
   223
ReleaseReserveAccess18=
sl@0
   224
FreeReservedSpace19=
sl@0
   225
Close20=
sl@0
   226
Delete21=E:\Robustness5.db
sl@0
   227
Delete22=E:\fillfile.txt
sl@0
   228
EndBlock23=
sl@0
   229
sl@0
   230
// Runs concurrently with DeleteTest.
sl@0
   231
[FillTest]
sl@0
   232
Delete0=E:\Robustness4.db
sl@0
   233
ExpectedError0=KErrNotFound
sl@0
   234
Create1=E:\Robustness4.db
sl@0
   235
Exec2=Create Table Sometable(Someint int primary key, Somereal real, Sometext text);
sl@0
   236
// Add some data to the database.
sl@0
   237
NewBlock3=AddBlock10-1
sl@0
   238
NewBlock4=CheckBlock10-1
sl@0
   239
// Now trigger the 'DeleteTest' block - this fills the whole disk with a
sl@0
   240
// separate database and signals us back when it's done.
sl@0
   241
SignalA5=1
sl@0
   242
// Goes to DeleteTest step 1.
sl@0
   243
WaitB6=1
sl@0
   244
// Attempt to add more data to our database.  Some will work, especially as
sl@0
   245
// our records are small. The 'FillTest-1' block is expecting an error.
sl@0
   246
Prepare7=Insert into Sometable(Someint, Somereal, Sometext) values(:FInt, :FReal, :FText);
sl@0
   247
NewBlock8=FillTest-1
sl@0
   248
St_Close9=
sl@0
   249
sl@0
   250
// Wake up 'DeleteTest' again. It's going to delete a record or two.
sl@0
   251
// Goes to DeleteTest Step 13.
sl@0
   252
SignalA10=1
sl@0
   253
WaitB11=1
sl@0
   254
NoOperation12=
sl@0
   255
sl@0
   256
// We can't do any db operations now - this thread never had reserved disk space
sl@0
   257
// so all we can do is close down.
sl@0
   258
sl@0
   259
Close13=
sl@0
   260
Delete14=E:\Robustness4.db
sl@0
   261
NoOperation15=
sl@0
   262
// Goes to DeleteTest step 18.
sl@0
   263
SignalA16=1
sl@0
   264
EndBlock17=
sl@0
   265
sl@0
   266
// Called by FillTest. Fills the (small) amount of remaining disk.
sl@0
   267
[FillTest-1]
sl@0
   268
Function0=WriteBigTable
sl@0
   269
LowCount=12000000
sl@0
   270
HighCount=12999999
sl@0
   271
CountStep=1
sl@0
   272
Multiplier=299792458
sl@0
   273
Text=Shine On You Crazy Diamond
sl@0
   274
EventuallyExpectedError=KErrDiskFull
sl@0
   275
EndBlock1=
sl@0
   276
sl@0
   277
// ///////////////////////////////////////////////////////////////////////////
sl@0
   278
//
sl@0
   279
// Used by SYSLIB-SQL-CIT-1704
sl@0
   280
//
sl@0
   281
// Here we create a database and add some data to it. Then we ATTACH another
sl@0
   282
// database (creating it in the process) on a completely different partition.
sl@0
   283
// We fill that partition with 'FillDisk' and then try to add one more record,
sl@0
   284
// which should fail. Then we attempt to delete the attached database,
sl@0
   285
// expecting 'KErrInUse', then we DETACH it and once more try to write to it,
sl@0
   286
// which of course fails. Then we delete it.
sl@0
   287
[Attach]
sl@0
   288
Delete0=C:\Robustness2.db
sl@0
   289
ExpectedError0=KErrNotFound
sl@0
   290
Delete1=E:\Robustness3.db
sl@0
   291
ExpectedError1=KErrNotFound
sl@0
   292
Create2=C:\Robustness2.db
sl@0
   293
NoOperation3=
sl@0
   294
Exec4=Create Table Maintable(MyInt int primary key, MyReal real, MyText text);
sl@0
   295
NewBlock5=AttachAddBlock
sl@0
   296
sl@0
   297
Exec6=Attach "E:\Robustness3.db" as TheAttached;
sl@0
   298
Exec7=Create Table TheAttached.Sometable(Someint int, Somereal real, Sometext text);
sl@0
   299
sl@0
   300
// Fill the disk to within 100K of full (with a file..)
sl@0
   301
NewBlock8=FillDisk160K
sl@0
   302
NewBlock9=FillDisk100K
sl@0
   303
sl@0
   304
// Fill up the drive with the attached database, first with big records,
sl@0
   305
// then small.
sl@0
   306
NewBlock10=FillDisk1
sl@0
   307
Close11=
sl@0
   308
sl@0
   309
// Re-open and re-attach.. Fill right to the limit with small records.
sl@0
   310
Open12=C:\Robustness2.db
sl@0
   311
Exec13=Attach "E:\Robustness3.db" as TheAttached;
sl@0
   312
NewBlock14=FillDisk2
sl@0
   313
Close15=
sl@0
   314
sl@0
   315
// Re-open and re-attach...
sl@0
   316
Open16=C:\Robustness2.db
sl@0
   317
Exec17=Attach "E:\Robustness3.db" as TheAttached;
sl@0
   318
sl@0
   319
// Verify we can add no more.
sl@0
   320
Exec18=Insert into Sometable values(-90009, 2.718281828, "Hovercraft");
sl@0
   321
ExpectedError18=KErrDiskFull
sl@0
   322
sl@0
   323
// Close, re-open and re-attach, bets are off once we have a disk error.
sl@0
   324
Close19=
sl@0
   325
Open20=C:\Robustness2.db
sl@0
   326
Exec21=Attach "E:\Robustness3.db" as TheAttached;
sl@0
   327
sl@0
   328
// Verify the attached db is locked.
sl@0
   329
Delete22=E:\Robustness3.db
sl@0
   330
ExpectedError22=KErrInUse
sl@0
   331
sl@0
   332
// Beyond this point we can't expect anything to work (necessarily) because
sl@0
   333
// there isn't any disk space left. So grab free off 60K to make sure
sl@0
   334
// (the fill to within 100K of full file which was created after filling
sl@0
   335
// to within 160K of full).
sl@0
   336
Delete23=E:\fillfile.txt
sl@0
   337
NoOperation24=
sl@0
   338
NoOperation25=
sl@0
   339
sl@0
   340
// The number of lines common to both tables is highly dependent on exactly
sl@0
   341
// how much space was left when the disk was filled. We really can't know
sl@0
   342
// how many lines there will be so lets just check there are some.. Even
sl@0
   343
// this might fail if the amount of space was very small..
sl@0
   344
Prepare26=Select * from Maintable, Sometable where(MyInt = Someint);
sl@0
   345
Next27=KSqlAtRow
sl@0
   346
Next28=KSqlAtRow
sl@0
   347
// Keep the reserve for the moment or we can't be sure things will run.
sl@0
   348
sl@0
   349
// We're in the middle of an RSqlStatement operation so this detach will
sl@0
   350
// fail.
sl@0
   351
Exec29=Detach TheAttached;
sl@0
   352
ExpectedError29=KSqlErrGeneral
sl@0
   353
LastErrorMessage30=database TheAttached is locked
sl@0
   354
// Statement has NOT expired, because DETACH should have failed..
sl@0
   355
Next31=KSqlAtRow
sl@0
   356
St_Close32=
sl@0
   357
Exec33=Detach TheAttached;
sl@0
   358
Exec34=Select * from Sometable;
sl@0
   359
ExpectedError34=KSqlErrGeneral
sl@0
   360
LastErrorMessage35=no such table: Sometable
sl@0
   361
sl@0
   362
// Now try to delete it again. This attempt should be successful.
sl@0
   363
Delete36=E:\Robustness3.db
sl@0
   364
// This test has been done before..
sl@0
   365
Delete37=C:\Robustness2.db
sl@0
   366
ExpectedError37=KErrInUse
sl@0
   367
ReleaseReserveAccess38=
sl@0
   368
FreeReservedSpace39=
sl@0
   369
Close40=
sl@0
   370
Delete41=C:\Robustness2.db
sl@0
   371
Delete42=E:\fillfile2.txt
sl@0
   372
EndBlock43=
sl@0
   373
sl@0
   374
// Just add a little to the database..
sl@0
   375
[AttachAddBlock]
sl@0
   376
Prepare0=Insert into Maintable(MyInt, MyReal, MyText) values(:FInt, :FReal, :FText);
sl@0
   377
Function1=WriteBigTable
sl@0
   378
LowCount=0
sl@0
   379
HighCount=49
sl@0
   380
CountStep=1
sl@0
   381
Multiplier=9.869604401
sl@0
   382
Text=Hey, here's some text.
sl@0
   383
EventuallyExpectedError=KErrNone
sl@0
   384
St_Close2=
sl@0
   385
EndBlock3=
sl@0
   386
sl@0
   387