os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/scripts/Robustness.script
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // @file
    15 // 
    16 //
    17 
    18 PRINT Run SQL Tests
    19 
    20 LOAD_SUITE te_SQL_Suite
    21 
    22 RUN_UTILS DeleteFile E:\Robustness*.db
    23 RUN_UTILS DeleteFile T:\Robustness*.db
    24 RUN_UTILS DeleteFile C:\Robustness*.db
    25 RUN_UTILS DeleteFile E:\Robustness*.db-journal
    26 RUN_UTILS DeleteFile T:\Robustness*.db-journal
    27 RUN_UTILS DeleteFile C:\Robustness*.db-journal
    28 RUN_UTILS DeleteFile T:\fillfile.txt
    29 RUN_UTILS DeleteFile T:\fillfile2.txt
    30 RUN_UTILS DeleteFile T:\fillfile4M.txt
    31 RUN_UTILS DeleteFile E:\fillfile.txt
    32 RUN_UTILS DeleteFile E:\fillfile2.txt
    33 RUN_UTILS DeleteFile E:\fillfile4M.txt
    34 RUN_UTILS DeleteFile T:\fillDisk*.txt
    35 RUN_UTILS DeleteFile E:\fillDisk*.txt
    36 
    37 
    38 START_TESTCASE SYSLIB-SQL-CIT-3348
    39 //! @SYMTestCaseID    SYSLIB-SQL-CIT-3348
    40 //! @SYMTestCaseDesc  Not strictly an SQL test. This step fills the disk to
    41 //!                  within 4M of full an leaves that file lying around. This
    42 //!                  improves the performance of the subsequent OOD tests
    43 //!                  and is required for reliable behaviour within the DABS
    44 //!                  framework (due to possible timeout issues). The large
    45 //!                  file is removed by the script at the end.
    46 //!                  This MUST be the first test to execute in the script.
    47 //!                  Note that this step does nothing at all on emulator -
    48 //!                  that uses the T: drive which is already < 4M.
    49 //! @SYMTestPriority  High
    50 //! @SYMTestActions   See description and the config file, also the code.
    51 //! @SYMTestExpectedResults
    52 //!                  A PASS should be generated.
    53 //! @SYMDEF           DEF095562
    54 
    55   RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini FillDisk4M
    56 END_TESTCASE SYSLIB-SQL-CIT-3348
    57 
    58 START_TESTCASE SYSLIB-SQL-CIT-1705
    59 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1705
    60 //! @SYMTestCaseDesc  Adds a few records to a table in a new database. Begins
    61 //!                  a transaction and then fills the disk. When this fails
    62 //!                  with KErrDiskFull, database is closed and re-opened. This
    63 //!                  is all that can be done with disk full unless space has
    64 //!                  been reserved. Free up a bit of disk and then check
    65 //!                  the initial records to validate the db is still usable.
    66 //!                  Further records are then added and checked.
    67 //! @SYMTestPriority  High
    68 //! @SYMTestActions   See description and the config file, also the code.
    69 //! @SYMTestExpectedResults
    70 //!                  A PASS should be generated.
    71 //! @SYMREQ           REQ5792
    72 
    73   PRINT <font size=5 color=AF0000>MMC card on E:\ required on hardware!! </font>
    74   RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini Top
    75 END_TESTCASE SYSLIB-SQL-CIT-1705
    76 
    77 RUN_UTILS DeleteFile E:\Robustness*.db
    78 RUN_UTILS DeleteFile T:\Robustness*.db
    79 RUN_UTILS DeleteFile C:\Robustness*.db
    80 RUN_UTILS DeleteFile E:\Robustness*.db-journal
    81 RUN_UTILS DeleteFile T:\Robustness*.db-journal
    82 RUN_UTILS DeleteFile C:\Robustness*.db-journal
    83 RUN_UTILS DeleteFile T:\fillfile.txt
    84 RUN_UTILS DeleteFile E:\fillfile.txt
    85 RUN_UTILS DeleteFile T:\fillfile2.txt
    86 RUN_UTILS DeleteFile E:\fillfile2.txt
    87 
    88 START_TESTCASE SYSLIB-SQL-CIT-1704
    89 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1704
    90 //! @SYMTestCaseDesc  Does an attach of a db on another drive and then fills
    91 //!                  the disk that resides on. Verifies that appropriate
    92 //!                  errors are returned on writing to it. Also check for
    93 //!                  'expired' RSqlStatement after DETACH and verifies that
    94 //!                  the previously attached database can be deleted despite
    95 //!                  having no space.
    96 //! @SYMTestPriority  High
    97 //! @SYMTestActions   See description and the config file, also the code.
    98 //! @SYMTestExpectedResults
    99 //!                  A PASS should be generated.
   100 //! @SYMREQ           REQ5792
   101 
   102     PRINT <font size=5 color=0000AF>INFO: MMC card on E:\ required on hardware!! </font>
   103     RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini Attach
   104 END_TESTCASE SYSLIB-SQL-CIT-1704
   105 
   106 RUN_UTILS DeleteFile E:\Robustness*.db
   107 RUN_UTILS DeleteFile T:\Robustness*.db
   108 RUN_UTILS DeleteFile C:\Robustness*.db
   109 RUN_UTILS DeleteFile E:\Robustness*.db-journal
   110 RUN_UTILS DeleteFile T:\Robustness*.db-journal
   111 RUN_UTILS DeleteFile C:\Robustness*.db-journal
   112 RUN_UTILS DeleteFile T:\fillfile.txt
   113 RUN_UTILS DeleteFile E:\fillfile.txt
   114 RUN_UTILS DeleteFile T:\fillfile2.txt
   115 RUN_UTILS DeleteFile E:\fillfile2.txt
   116 
   117 START_TESTCASE SYSLIB-SQL-CIT-1741
   118 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1741
   119 //! @SYMTestCaseDesc  'FillTest' adds some data into its database and checks
   120 //!                  it. It then triggers 'DeleteTest' and waits.
   121 //!                  DeleteTest creates its own, separate database.
   122 //!                  It then reserves space, and then fills the disk
   123 //!                  with writes to a database table. Once it receives
   124 //!                  KErrDiskFull it enables the reserved disk space and
   125 //!                  attempts to add two more records - this should be
   126 //!                  successful. It then signals 'FillTest' back, and waits.
   127 //!                  'FillTest' attempts to add records to its own db. These
   128 //!                  are small, so a number work. It then receives KErrDiskFull.
   129 //!                  DeleteTest is signalled and FillTest waits.
   130 //!                  'DeleteTest' attempts to delete a few records. This should
   131 //!                  be successful - we have reserved space. Reserved space is
   132 //!                  then released by 'DeleteTest', 'FillTest' is signalled
   133 //!                  and 'DeleteTest' waits.
   134 //!                  'FillTest' had no reserved space so just closes it's db,
   135 //!                  deletes it, signals 'DeleteTest' back and dies.
   136 //!                  'DeleteTest' releases reserved space a second time
   137 //!                  (which gives no error) and cleans up.
   138 //!
   139 //! @SYMTestPriority  High
   140 //! @SYMTestActions   See description and the config file, also the code.
   141 //! @SYMTestExpectedResults
   142 //!                  A PASS should be generated.
   143 //! @SYMREQ           REQ5792
   144 //
   145 
   146     PRINT <font size=5 color=AF0000>MMC card on E:\ required on hardware!! </font>
   147 CONCURRENT
   148 // DeleteTest's first action is to wait for a signal from FillTest. It *must*
   149 // be running when FillTest sends it signal, so lets have it first..
   150     RUN_TEST_STEP 1800 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini DeleteTest
   151     RUN_TEST_STEP 1800 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini FillTest
   152 END_TESTCASE SYSLIB-SQL-CIT-1741
   153 
   154 RUN_UTILS DeleteFile E:\Robustness*.db
   155 RUN_UTILS DeleteFile T:\Robustness*.db
   156 RUN_UTILS DeleteFile C:\Robustness*.db
   157 RUN_UTILS DeleteFile E:\Robustness*.db-journal
   158 RUN_UTILS DeleteFile T:\Robustness*.db-journal
   159 RUN_UTILS DeleteFile C:\Robustness*.db-journal
   160 RUN_UTILS DeleteFile T:\fillfile.txt
   161 RUN_UTILS DeleteFile E:\fillfile.txt
   162 RUN_UTILS DeleteFile T:\fillfile2.txt
   163 RUN_UTILS DeleteFile E:\fillfile2.txt
   164 RUN_UTILS DeleteFile T:\fillfile4M.txt
   165 RUN_UTILS DeleteFile E:\fillfile4M.txt
   166 RUN_UTILS DeleteFile T:\fillDisk*.txt
   167 RUN_UTILS DeleteFile E:\fillDisk*.txt