sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: // @file
sl@0: //
sl@0: //
sl@0:
sl@0: PRINT Run SQL Tests
sl@0:
sl@0: LOAD_SUITE te_SQL_Suite
sl@0:
sl@0: RUN_UTILS DeleteFile E:\Robustness*.db
sl@0: RUN_UTILS DeleteFile T:\Robustness*.db
sl@0: RUN_UTILS DeleteFile C:\Robustness*.db
sl@0: RUN_UTILS DeleteFile E:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile T:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile C:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile T:\fillfile.txt
sl@0: RUN_UTILS DeleteFile T:\fillfile2.txt
sl@0: RUN_UTILS DeleteFile T:\fillfile4M.txt
sl@0: RUN_UTILS DeleteFile E:\fillfile.txt
sl@0: RUN_UTILS DeleteFile E:\fillfile2.txt
sl@0: RUN_UTILS DeleteFile E:\fillfile4M.txt
sl@0: RUN_UTILS DeleteFile T:\fillDisk*.txt
sl@0: RUN_UTILS DeleteFile E:\fillDisk*.txt
sl@0:
sl@0:
sl@0: START_TESTCASE SYSLIB-SQL-CIT-3348
sl@0: //! @SYMTestCaseID SYSLIB-SQL-CIT-3348
sl@0: //! @SYMTestCaseDesc Not strictly an SQL test. This step fills the disk to
sl@0: //! within 4M of full an leaves that file lying around. This
sl@0: //! improves the performance of the subsequent OOD tests
sl@0: //! and is required for reliable behaviour within the DABS
sl@0: //! framework (due to possible timeout issues). The large
sl@0: //! file is removed by the script at the end.
sl@0: //! This MUST be the first test to execute in the script.
sl@0: //! Note that this step does nothing at all on emulator -
sl@0: //! that uses the T: drive which is already < 4M.
sl@0: //! @SYMTestPriority High
sl@0: //! @SYMTestActions See description and the config file, also the code.
sl@0: //! @SYMTestExpectedResults
sl@0: //! A PASS should be generated.
sl@0: //! @SYMDEF DEF095562
sl@0:
sl@0: RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini FillDisk4M
sl@0: END_TESTCASE SYSLIB-SQL-CIT-3348
sl@0:
sl@0: START_TESTCASE SYSLIB-SQL-CIT-1705
sl@0: //! @SYMTestCaseID SYSLIB-SQL-CIT-1705
sl@0: //! @SYMTestCaseDesc Adds a few records to a table in a new database. Begins
sl@0: //! a transaction and then fills the disk. When this fails
sl@0: //! with KErrDiskFull, database is closed and re-opened. This
sl@0: //! is all that can be done with disk full unless space has
sl@0: //! been reserved. Free up a bit of disk and then check
sl@0: //! the initial records to validate the db is still usable.
sl@0: //! Further records are then added and checked.
sl@0: //! @SYMTestPriority High
sl@0: //! @SYMTestActions See description and the config file, also the code.
sl@0: //! @SYMTestExpectedResults
sl@0: //! A PASS should be generated.
sl@0: //! @SYMREQ REQ5792
sl@0:
sl@0: PRINT MMC card on E:\ required on hardware!!
sl@0: RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini Top
sl@0: END_TESTCASE SYSLIB-SQL-CIT-1705
sl@0:
sl@0: RUN_UTILS DeleteFile E:\Robustness*.db
sl@0: RUN_UTILS DeleteFile T:\Robustness*.db
sl@0: RUN_UTILS DeleteFile C:\Robustness*.db
sl@0: RUN_UTILS DeleteFile E:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile T:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile C:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile T:\fillfile.txt
sl@0: RUN_UTILS DeleteFile E:\fillfile.txt
sl@0: RUN_UTILS DeleteFile T:\fillfile2.txt
sl@0: RUN_UTILS DeleteFile E:\fillfile2.txt
sl@0:
sl@0: START_TESTCASE SYSLIB-SQL-CIT-1704
sl@0: //! @SYMTestCaseID SYSLIB-SQL-CIT-1704
sl@0: //! @SYMTestCaseDesc Does an attach of a db on another drive and then fills
sl@0: //! the disk that resides on. Verifies that appropriate
sl@0: //! errors are returned on writing to it. Also check for
sl@0: //! 'expired' RSqlStatement after DETACH and verifies that
sl@0: //! the previously attached database can be deleted despite
sl@0: //! having no space.
sl@0: //! @SYMTestPriority High
sl@0: //! @SYMTestActions See description and the config file, also the code.
sl@0: //! @SYMTestExpectedResults
sl@0: //! A PASS should be generated.
sl@0: //! @SYMREQ REQ5792
sl@0:
sl@0: PRINT INFO: MMC card on E:\ required on hardware!!
sl@0: RUN_TEST_STEP 900 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini Attach
sl@0: END_TESTCASE SYSLIB-SQL-CIT-1704
sl@0:
sl@0: RUN_UTILS DeleteFile E:\Robustness*.db
sl@0: RUN_UTILS DeleteFile T:\Robustness*.db
sl@0: RUN_UTILS DeleteFile C:\Robustness*.db
sl@0: RUN_UTILS DeleteFile E:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile T:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile C:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile T:\fillfile.txt
sl@0: RUN_UTILS DeleteFile E:\fillfile.txt
sl@0: RUN_UTILS DeleteFile T:\fillfile2.txt
sl@0: RUN_UTILS DeleteFile E:\fillfile2.txt
sl@0:
sl@0: START_TESTCASE SYSLIB-SQL-CIT-1741
sl@0: //! @SYMTestCaseID SYSLIB-SQL-CIT-1741
sl@0: //! @SYMTestCaseDesc 'FillTest' adds some data into its database and checks
sl@0: //! it. It then triggers 'DeleteTest' and waits.
sl@0: //! DeleteTest creates its own, separate database.
sl@0: //! It then reserves space, and then fills the disk
sl@0: //! with writes to a database table. Once it receives
sl@0: //! KErrDiskFull it enables the reserved disk space and
sl@0: //! attempts to add two more records - this should be
sl@0: //! successful. It then signals 'FillTest' back, and waits.
sl@0: //! 'FillTest' attempts to add records to its own db. These
sl@0: //! are small, so a number work. It then receives KErrDiskFull.
sl@0: //! DeleteTest is signalled and FillTest waits.
sl@0: //! 'DeleteTest' attempts to delete a few records. This should
sl@0: //! be successful - we have reserved space. Reserved space is
sl@0: //! then released by 'DeleteTest', 'FillTest' is signalled
sl@0: //! and 'DeleteTest' waits.
sl@0: //! 'FillTest' had no reserved space so just closes it's db,
sl@0: //! deletes it, signals 'DeleteTest' back and dies.
sl@0: //! 'DeleteTest' releases reserved space a second time
sl@0: //! (which gives no error) and cleans up.
sl@0: //!
sl@0: //! @SYMTestPriority High
sl@0: //! @SYMTestActions See description and the config file, also the code.
sl@0: //! @SYMTestExpectedResults
sl@0: //! A PASS should be generated.
sl@0: //! @SYMREQ REQ5792
sl@0: //
sl@0:
sl@0: PRINT MMC card on E:\ required on hardware!!
sl@0: CONCURRENT
sl@0: // DeleteTest's first action is to wait for a signal from FillTest. It *must*
sl@0: // be running when FillTest sends it signal, so lets have it first..
sl@0: RUN_TEST_STEP 1800 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini DeleteTest
sl@0: RUN_TEST_STEP 1800 te_SQL_Suite CSQLCDT z:\TEF_SQL\Robustness.ini FillTest
sl@0: END_TESTCASE SYSLIB-SQL-CIT-1741
sl@0:
sl@0: RUN_UTILS DeleteFile E:\Robustness*.db
sl@0: RUN_UTILS DeleteFile T:\Robustness*.db
sl@0: RUN_UTILS DeleteFile C:\Robustness*.db
sl@0: RUN_UTILS DeleteFile E:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile T:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile C:\Robustness*.db-journal
sl@0: RUN_UTILS DeleteFile T:\fillfile.txt
sl@0: RUN_UTILS DeleteFile E:\fillfile.txt
sl@0: RUN_UTILS DeleteFile T:\fillfile2.txt
sl@0: RUN_UTILS DeleteFile E:\fillfile2.txt
sl@0: RUN_UTILS DeleteFile T:\fillfile4M.txt
sl@0: RUN_UTILS DeleteFile E:\fillfile4M.txt
sl@0: RUN_UTILS DeleteFile T:\fillDisk*.txt
sl@0: RUN_UTILS DeleteFile E:\fillDisk*.txt