persistentstorage/sql/TEST/testexecute/SQLite/scripts/Robustness.script
changeset 0 08ec8eefde2f
child 23 26645d81f48d
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     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 
       
    35 
       
    36 START_TESTCASE SYSLIB-SQL-CIT-3348
       
    37 //! @SYMTestCaseID    SYSLIB-SQL-CIT-3348
       
    38 //! @SYMTestCaseDesc  Not strictly an SQL test. This step fills the disk to
       
    39 //!                  within 4M of full an leaves that file lying around. This
       
    40 //!                  improves the performance of the subsequent OOD tests
       
    41 //!                  and is required for reliable behaviour within the DABS
       
    42 //!                  framework (due to possible timeout issues). The large
       
    43 //!                  file is removed by the script at the end.
       
    44 //!                  This MUST be the first test to execute in the script.
       
    45 //!                  Note that this step does nothing at all on emulator -
       
    46 //!                  that uses the T: drive which is already < 4M.
       
    47 //! @SYMTestPriority  High
       
    48 //! @SYMTestActions   See description and the config file, also the code.
       
    49 //! @SYMTestExpectedResults
       
    50 //!                  A PASS should be generated.
       
    51 //! @SYMDEF           DEF095562
       
    52 
       
    53   RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini FillDisk4M
       
    54 END_TESTCASE SYSLIB-SQL-CIT-3348
       
    55 
       
    56 START_TESTCASE SYSLIB-SQL-CIT-1705
       
    57 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1705
       
    58 //! @SYMTestCaseDesc  Adds a few records to a table in a new database. Begins
       
    59 //!                  a transaction and then fills the disk. When this fails
       
    60 //!                  with KErrDiskFull, database is closed and re-opened. This
       
    61 //!                  is all that can be done with disk full unless space has
       
    62 //!                  been reserved. Free up a bit of disk and then check
       
    63 //!                  the initial records to validate the db is still usable.
       
    64 //!                  Further records are then added and checked.
       
    65 //! @SYMTestPriority  High
       
    66 //! @SYMTestActions   See description and the config file, also the code.
       
    67 //! @SYMTestExpectedResults
       
    68 //!                  A PASS should be generated.
       
    69 //! @SYMREQ           REQ5792
       
    70 
       
    71   PRINT <font size=5 color=AF0000>MMC card on E:\ required on hardware!! </font>
       
    72   RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini Top
       
    73 END_TESTCASE SYSLIB-SQL-CIT-1705
       
    74 
       
    75 RUN_UTILS DeleteFile E:\Robustness*.db
       
    76 RUN_UTILS DeleteFile T:\Robustness*.db
       
    77 RUN_UTILS DeleteFile C:\Robustness*.db
       
    78 RUN_UTILS DeleteFile E:\Robustness*.db-journal
       
    79 RUN_UTILS DeleteFile T:\Robustness*.db-journal
       
    80 RUN_UTILS DeleteFile C:\Robustness*.db-journal
       
    81 RUN_UTILS DeleteFile T:\fillfile.txt
       
    82 RUN_UTILS DeleteFile E:\fillfile.txt
       
    83 RUN_UTILS DeleteFile T:\fillfile2.txt
       
    84 RUN_UTILS DeleteFile E:\fillfile2.txt
       
    85 
       
    86 START_TESTCASE SYSLIB-SQL-CIT-1704
       
    87 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1704
       
    88 //! @SYMTestCaseDesc  Does an attach of a db on another drive and then fills
       
    89 //!                  the disk that resides on. Verifies that appropriate
       
    90 //!                  errors are returned on writing to it. Also check for
       
    91 //!                  'expired' RSqlStatement after DETACH and verifies that
       
    92 //!                  the previously attached database can be deleted despite
       
    93 //!                  having no space.
       
    94 //! @SYMTestPriority  High
       
    95 //! @SYMTestActions   See description and the config file, also the code.
       
    96 //! @SYMTestExpectedResults
       
    97 //!                  A PASS should be generated.
       
    98 //! @SYMREQ           REQ5792
       
    99 
       
   100     PRINT <font size=5 color=0000AF>INFO: MMC card on E:\ required on hardware!! </font>
       
   101     RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini Attach
       
   102 END_TESTCASE SYSLIB-SQL-CIT-1704
       
   103 
       
   104 RUN_UTILS DeleteFile E:\Robustness*.db
       
   105 RUN_UTILS DeleteFile T:\Robustness*.db
       
   106 RUN_UTILS DeleteFile C:\Robustness*.db
       
   107 RUN_UTILS DeleteFile E:\Robustness*.db-journal
       
   108 RUN_UTILS DeleteFile T:\Robustness*.db-journal
       
   109 RUN_UTILS DeleteFile C:\Robustness*.db-journal
       
   110 RUN_UTILS DeleteFile T:\fillfile.txt
       
   111 RUN_UTILS DeleteFile E:\fillfile.txt
       
   112 RUN_UTILS DeleteFile T:\fillfile2.txt
       
   113 RUN_UTILS DeleteFile E:\fillfile2.txt
       
   114 
       
   115 START_TESTCASE SYSLIB-SQL-CIT-1741
       
   116 //! @SYMTestCaseID    SYSLIB-SQL-CIT-1741
       
   117 //! @SYMTestCaseDesc  'FillTest' adds some data into its database and checks
       
   118 //!                  it. It then triggers 'DeleteTest' and waits.
       
   119 //!                  DeleteTest creates its own, separate database.
       
   120 //!                  It then reserves space, and then fills the disk
       
   121 //!                  with writes to a database table. Once it receives
       
   122 //!                  KErrDiskFull it enables the reserved disk space and
       
   123 //!                  attempts to add two more records - this should be
       
   124 //!                  successful. It then signals 'FillTest' back, and waits.
       
   125 //!                  'FillTest' attempts to add records to its own db. These
       
   126 //!                  are small, so a number work. It then receives KErrDiskFull.
       
   127 //!                  DeleteTest is signalled and FillTest waits.
       
   128 //!                  'DeleteTest' attempts to delete a few records. This should
       
   129 //!                  be successful - we have reserved space. Reserved space is
       
   130 //!                  then released by 'DeleteTest', 'FillTest' is signalled
       
   131 //!                  and 'DeleteTest' waits.
       
   132 //!                  'FillTest' had no reserved space so just closes it's db,
       
   133 //!                  deletes it, signals 'DeleteTest' back and dies.
       
   134 //!                  'DeleteTest' releases reserved space a second time
       
   135 //!                  (which gives no error) and cleans up.
       
   136 //!
       
   137 //! @SYMTestPriority  High
       
   138 //! @SYMTestActions   See description and the config file, also the code.
       
   139 //! @SYMTestExpectedResults
       
   140 //!                  A PASS should be generated.
       
   141 //! @SYMREQ           REQ5792
       
   142 //
       
   143 
       
   144     PRINT <font size=5 color=AF0000>MMC card on E:\ required on hardware!! </font>
       
   145 CONCURRENT
       
   146 // DeleteTest's first action is to wait for a signal from FillTest. It *must*
       
   147 // be running when FillTest sends it signal, so lets have it first..
       
   148     RUN_TEST_STEP 1800 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini DeleteTest
       
   149     RUN_TEST_STEP 1800 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini FillTest
       
   150 END_TESTCASE SYSLIB-SQL-CIT-1741
       
   151 
       
   152 RUN_UTILS DeleteFile E:\Robustness*.db
       
   153 RUN_UTILS DeleteFile T:\Robustness*.db
       
   154 RUN_UTILS DeleteFile C:\Robustness*.db
       
   155 RUN_UTILS DeleteFile E:\Robustness*.db-journal
       
   156 RUN_UTILS DeleteFile T:\Robustness*.db-journal
       
   157 RUN_UTILS DeleteFile C:\Robustness*.db-journal
       
   158 RUN_UTILS DeleteFile T:\fillfile.txt
       
   159 RUN_UTILS DeleteFile E:\fillfile.txt
       
   160 RUN_UTILS DeleteFile T:\fillfile2.txt
       
   161 RUN_UTILS DeleteFile E:\fillfile2.txt
       
   162 RUN_UTILS DeleteFile T:\fillfile4M.txt
       
   163 RUN_UTILS DeleteFile E:\fillfile4M.txt