os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/scripts/Robustness.script
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/persistentdata/persistentstorage/sql/TEST/testexecute/SQLite/scripts/Robustness.script Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,167 @@
1.4 +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// @file
1.18 +//
1.19 +//
1.20 +
1.21 +PRINT Run SQL Tests
1.22 +
1.23 +LOAD_SUITE te_SQL_Suite
1.24 +
1.25 +RUN_UTILS DeleteFile E:\Robustness*.db
1.26 +RUN_UTILS DeleteFile T:\Robustness*.db
1.27 +RUN_UTILS DeleteFile C:\Robustness*.db
1.28 +RUN_UTILS DeleteFile E:\Robustness*.db-journal
1.29 +RUN_UTILS DeleteFile T:\Robustness*.db-journal
1.30 +RUN_UTILS DeleteFile C:\Robustness*.db-journal
1.31 +RUN_UTILS DeleteFile T:\fillfile.txt
1.32 +RUN_UTILS DeleteFile T:\fillfile2.txt
1.33 +RUN_UTILS DeleteFile T:\fillfile4M.txt
1.34 +RUN_UTILS DeleteFile E:\fillfile.txt
1.35 +RUN_UTILS DeleteFile E:\fillfile2.txt
1.36 +RUN_UTILS DeleteFile E:\fillfile4M.txt
1.37 +RUN_UTILS DeleteFile T:\fillDisk*.txt
1.38 +RUN_UTILS DeleteFile E:\fillDisk*.txt
1.39 +
1.40 +
1.41 +START_TESTCASE SYSLIB-SQL-CIT-3348
1.42 +//! @SYMTestCaseID SYSLIB-SQL-CIT-3348
1.43 +//! @SYMTestCaseDesc Not strictly an SQL test. This step fills the disk to
1.44 +//! within 4M of full an leaves that file lying around. This
1.45 +//! improves the performance of the subsequent OOD tests
1.46 +//! and is required for reliable behaviour within the DABS
1.47 +//! framework (due to possible timeout issues). The large
1.48 +//! file is removed by the script at the end.
1.49 +//! This MUST be the first test to execute in the script.
1.50 +//! Note that this step does nothing at all on emulator -
1.51 +//! that uses the T: drive which is already < 4M.
1.52 +//! @SYMTestPriority High
1.53 +//! @SYMTestActions See description and the config file, also the code.
1.54 +//! @SYMTestExpectedResults
1.55 +//! A PASS should be generated.
1.56 +//! @SYMDEF DEF095562
1.57 +
1.58 + RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini FillDisk4M
1.59 +END_TESTCASE SYSLIB-SQL-CIT-3348
1.60 +
1.61 +START_TESTCASE SYSLIB-SQL-CIT-1705
1.62 +//! @SYMTestCaseID SYSLIB-SQL-CIT-1705
1.63 +//! @SYMTestCaseDesc Adds a few records to a table in a new database. Begins
1.64 +//! a transaction and then fills the disk. When this fails
1.65 +//! with KErrDiskFull, database is closed and re-opened. This
1.66 +//! is all that can be done with disk full unless space has
1.67 +//! been reserved. Free up a bit of disk and then check
1.68 +//! the initial records to validate the db is still usable.
1.69 +//! Further records are then added and checked.
1.70 +//! @SYMTestPriority High
1.71 +//! @SYMTestActions See description and the config file, also the code.
1.72 +//! @SYMTestExpectedResults
1.73 +//! A PASS should be generated.
1.74 +//! @SYMREQ REQ5792
1.75 +
1.76 + PRINT <font size=5 color=AF0000>MMC card on E:\ required on hardware!! </font>
1.77 + RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini Top
1.78 +END_TESTCASE SYSLIB-SQL-CIT-1705
1.79 +
1.80 +RUN_UTILS DeleteFile E:\Robustness*.db
1.81 +RUN_UTILS DeleteFile T:\Robustness*.db
1.82 +RUN_UTILS DeleteFile C:\Robustness*.db
1.83 +RUN_UTILS DeleteFile E:\Robustness*.db-journal
1.84 +RUN_UTILS DeleteFile T:\Robustness*.db-journal
1.85 +RUN_UTILS DeleteFile C:\Robustness*.db-journal
1.86 +RUN_UTILS DeleteFile T:\fillfile.txt
1.87 +RUN_UTILS DeleteFile E:\fillfile.txt
1.88 +RUN_UTILS DeleteFile T:\fillfile2.txt
1.89 +RUN_UTILS DeleteFile E:\fillfile2.txt
1.90 +
1.91 +START_TESTCASE SYSLIB-SQL-CIT-1704
1.92 +//! @SYMTestCaseID SYSLIB-SQL-CIT-1704
1.93 +//! @SYMTestCaseDesc Does an attach of a db on another drive and then fills
1.94 +//! the disk that resides on. Verifies that appropriate
1.95 +//! errors are returned on writing to it. Also check for
1.96 +//! 'expired' RSqlStatement after DETACH and verifies that
1.97 +//! the previously attached database can be deleted despite
1.98 +//! having no space.
1.99 +//! @SYMTestPriority High
1.100 +//! @SYMTestActions See description and the config file, also the code.
1.101 +//! @SYMTestExpectedResults
1.102 +//! A PASS should be generated.
1.103 +//! @SYMREQ REQ5792
1.104 +
1.105 + PRINT <font size=5 color=0000AF>INFO: MMC card on E:\ required on hardware!! </font>
1.106 + RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini Attach
1.107 +END_TESTCASE SYSLIB-SQL-CIT-1704
1.108 +
1.109 +RUN_UTILS DeleteFile E:\Robustness*.db
1.110 +RUN_UTILS DeleteFile T:\Robustness*.db
1.111 +RUN_UTILS DeleteFile C:\Robustness*.db
1.112 +RUN_UTILS DeleteFile E:\Robustness*.db-journal
1.113 +RUN_UTILS DeleteFile T:\Robustness*.db-journal
1.114 +RUN_UTILS DeleteFile C:\Robustness*.db-journal
1.115 +RUN_UTILS DeleteFile T:\fillfile.txt
1.116 +RUN_UTILS DeleteFile E:\fillfile.txt
1.117 +RUN_UTILS DeleteFile T:\fillfile2.txt
1.118 +RUN_UTILS DeleteFile E:\fillfile2.txt
1.119 +
1.120 +START_TESTCASE SYSLIB-SQL-CIT-1741
1.121 +//! @SYMTestCaseID SYSLIB-SQL-CIT-1741
1.122 +//! @SYMTestCaseDesc 'FillTest' adds some data into its database and checks
1.123 +//! it. It then triggers 'DeleteTest' and waits.
1.124 +//! DeleteTest creates its own, separate database.
1.125 +//! It then reserves space, and then fills the disk
1.126 +//! with writes to a database table. Once it receives
1.127 +//! KErrDiskFull it enables the reserved disk space and
1.128 +//! attempts to add two more records - this should be
1.129 +//! successful. It then signals 'FillTest' back, and waits.
1.130 +//! 'FillTest' attempts to add records to its own db. These
1.131 +//! are small, so a number work. It then receives KErrDiskFull.
1.132 +//! DeleteTest is signalled and FillTest waits.
1.133 +//! 'DeleteTest' attempts to delete a few records. This should
1.134 +//! be successful - we have reserved space. Reserved space is
1.135 +//! then released by 'DeleteTest', 'FillTest' is signalled
1.136 +//! and 'DeleteTest' waits.
1.137 +//! 'FillTest' had no reserved space so just closes it's db,
1.138 +//! deletes it, signals 'DeleteTest' back and dies.
1.139 +//! 'DeleteTest' releases reserved space a second time
1.140 +//! (which gives no error) and cleans up.
1.141 +//!
1.142 +//! @SYMTestPriority High
1.143 +//! @SYMTestActions See description and the config file, also the code.
1.144 +//! @SYMTestExpectedResults
1.145 +//! A PASS should be generated.
1.146 +//! @SYMREQ REQ5792
1.147 +//
1.148 +
1.149 + PRINT <font size=5 color=AF0000>MMC card on E:\ required on hardware!! </font>
1.150 +CONCURRENT
1.151 +// DeleteTest's first action is to wait for a signal from FillTest. It *must*
1.152 +// be running when FillTest sends it signal, so lets have it first..
1.153 + RUN_TEST_STEP 1800 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini DeleteTest
1.154 + RUN_TEST_STEP 1800 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini FillTest
1.155 +END_TESTCASE SYSLIB-SQL-CIT-1741
1.156 +
1.157 +RUN_UTILS DeleteFile E:\Robustness*.db
1.158 +RUN_UTILS DeleteFile T:\Robustness*.db
1.159 +RUN_UTILS DeleteFile C:\Robustness*.db
1.160 +RUN_UTILS DeleteFile E:\Robustness*.db-journal
1.161 +RUN_UTILS DeleteFile T:\Robustness*.db-journal
1.162 +RUN_UTILS DeleteFile C:\Robustness*.db-journal
1.163 +RUN_UTILS DeleteFile T:\fillfile.txt
1.164 +RUN_UTILS DeleteFile E:\fillfile.txt
1.165 +RUN_UTILS DeleteFile T:\fillfile2.txt
1.166 +RUN_UTILS DeleteFile E:\fillfile2.txt
1.167 +RUN_UTILS DeleteFile T:\fillfile4M.txt
1.168 +RUN_UTILS DeleteFile E:\fillfile4M.txt
1.169 +RUN_UTILS DeleteFile T:\fillDisk*.txt
1.170 +RUN_UTILS DeleteFile E:\fillDisk*.txt