installationservices/swi/test/tuiscriptadaptors/scripts/tsisstubhw.script
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 14 May 2010 15:58:48 +0300
changeset 33 8110bf1194d1
parent 0 ba25891c3a9e
permissions -rw-r--r--
Revision: 201017 Kit: 201019

//
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//
//! @file
// This script tests the installation to a removable media drive and
// verifies the correct creation of a SIS stub on that drive

// This script requires the SWIPolicy AllowPackagePropagate to be true in order to pass

PRINT Run Removable media SIS stub installation test
PRINT SWIPolicy AllowPackagePropagate must be set to true for these tests to pass
LOAD_SUITE tuiscriptadaptors

//! @SYMTestCaseID		API-SEC-CreateAndInstallSimpleStub-HW-0001
//! @SYMTestStatus		3. Released

START_TESTCASE API-SEC-CreateAndInstallSimpleStub-HW-0001

// make sure any previous installation of simple.sis is removed
// e: is the default removable drive on Symbian OS
RUN_UTILS DeleteFile e:\Documents\InstTest\file1.txt
RUN_UTILS DeleteFile e:\private\10202dce\80000001_0.sis
RUN_UTILS DeleteFile e:\80000001_0.sis
RUN_UTILS DeleteFile e:\file1.txt

/// Simple file installation from a compressed SIS file
// Install the full SIMPLE.SIS file
RUN_TEST_STEP 100 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini simple

// Copy the stub that was created and the file1.txt installed by SIMPLE.SIS
RUN_UTILS CopyFile e:\private\10202dce\80000001_0.sis e:\80000001_0.sis
RUN_UTILS CopyFile e:\Documents\InstTest\file1.txt e:\file1.txt

// Uninstall SIMPLE.SIS
RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini u_simple

// Now put the file1.txt back in place and install the copy of the stub that was created earlier
// Need to install the copy of the stub from e:\ because tuiscriptadaptors cant access the \private\10202dce\ directroy
RUN_UTILS MkDir e:\Documents\
RUN_UTILS MkDir e:\Documents\InstTest\
RUN_UTILS CopyFile e:\file1.txt e:\Documents\InstTest\file1.txt 
RUN_UTILS DeleteFile e:\file1.txt
// Copy stub back into position
RUN_UTILS MkDir e:\private\
RUN_UTILS MkDir e:\private\10202dce\
RUN_UTILS CopyFile e:\80000001_0.sis e:\private\10202dce\80000001_0.sis 
RUN_TEST_STEP 100 tuiscriptadaptors InstallFHStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini simplestub

// Uninstall simple stub
RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini u_stub

// Remove the copy of the sis stub that we created
RUN_UTILS DeleteFile e:\80000001.sis

// Stub files are left on E:, delete them
RUN_UTILS DeleteFile E:\Documents\InstTest\file1.txt
RUN_UTILS DeleteFile E:\private\10202dce\80000001_0.sis 

END_TESTCASE API-SEC-CreateAndInstallSimpleStub-HW-0001


//! @SYMTestCaseID		API-SEC-InstallOnDriveCNoStub-HW-0001
//! @SYMTestStatus		3. Released

START_TESTCASE API-SEC-InstallOnDriveCNoStub-HW-0001

/// Install the full SIMPLE.SIS file on Drive C
// Since C is not a removable drive no stub should be created
RUN_TEST_STEP 100 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini simplec

// Uninstall SIMPLE.SIS
RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini u_simple

END_TESTCASE API-SEC-InstallOnDriveCNoStub-HW-0001


//! @SYMTestCaseID		API-SEC-CreateAndInstallEmbeddedStub-HW-0001
//! @SYMTestStatus		3. Released

START_TESTCASE API-SEC-CreateAndInstallEmbeddedStub-HW-0001

/// Simple file installation from a compressed SIS file
// make sure any previous installation of simple.sis is removed
// E: is the default removable drive on H2
RUN_UTILS DeleteFile e:\Documents\InstTest\file1.txt
RUN_UTILS DeleteFile e:\private\10202dce\8000001b_0.sis
RUN_UTILS DeleteFile e:\8000001b_0.sis
RUN_UTILS DeleteFile e:\file1.txt

// Install the full SIMPLE.SIS file
RUN_TEST_STEP 100 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini embed1

// Copy the stub that was created and the file1.txt installed by SIMPLE.SIS
RUN_UTILS CopyFile e:\private\10202dce\8000001b_0.sis e:\8000001b_0.sis
RUN_UTILS CopyFile e:\Documents\InstTest\file1.txt e:\file1.txt
RUN_UTILS CopyFile e:\Documents\InstTest\file2.txt e:\file2.txt

// Uninstall SIMPLE.SIS
RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini u_embed1

// Now put the file1.txt back in place and install the stub that was created earlier
// Need to install the stub from e:\ because tuiscriptadaptors cant access the \private\10202dce\ directroy
RUN_UTILS MkDir e:\Documents\
RUN_UTILS MkDir e:\Documents\InstTest\
RUN_UTILS CopyFile e:\file1.txt e:\Documents\InstTest\file1.txt 
RUN_UTILS CopyFile e:\file2.txt e:\Documents\InstTest\file2.txt 
RUN_UTILS DeleteFile e:\file1.txt

// Copy stub back into position
RUN_UTILS MkDir e:\private\
RUN_UTILS MkDir e:\private\10202dce\
RUN_UTILS CopyFile e:\8000001b_0.sis e:\private\10202dce\8000001b_0.sis 

RUN_TEST_STEP 100 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini embed1stub

// Uninstall simple stub
RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini u_embedstub

// Stub files are left on E:, delete them
RUN_UTILS DeleteFile E:\Documents\InstTest\file1.txt
RUN_UTILS DeleteFile E:\Documents\InstTest\file2.txt
RUN_UTILS DeleteFile E:\private\10202dce\8000001b_0.sis

// Remove the copy of the SIS stub we created
RUN_UTILS DeleteFile e:\8000001b_0.sis

END_TESTCASE API-SEC-CreateAndInstallEmbeddedStub-HW-0001


//! @SYMTestCaseID 		API-SEC-UpgradedStub-HW-0001
//! @SYMTestCaseDesc 		Upgrade propagatable package and attempt to reinstall from stub sis file
//! @SYMDEF 			DEF088493
//! @SYMTestPriority 		High
//! @SYMTestActions 		Upgraded stub successfully installs
//! @SYMTestExpectedResults 	Successful install.
//! @SYMDevelopedForRelease 	Bravo

START_TESTCASE API-SEC-UpgradedStub-HW-0001

// make sure any previous installation of testupgrade sis file is removed
RUN_UTILS DeleteFile e:\Documents\InstTest\upgrade1.txt
RUN_UTILS DeleteFile e:\Documents\InstTest\upgrade2.txt
RUN_UTILS DeleteFile e:\Documents\InstTest\upgrade3.txt
RUN_UTILS DeleteFile e:\Documents\InstTest\upgrade4.txt
RUN_UTILS DeleteFile e:\private\10202dce\811111FD.sis
RUN_UTILS DeleteFile e:\upgrade1.txt
RUN_UTILS DeleteFile e:\upgrade4.txt
RUN_UTILS DeleteFile e:\811111FD_0.sis

// Install the full testupgrade_base.SIS file and upgrade it
RUN_TEST_STEP 100 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini testupgrade_base
RUN_TEST_STEP 100 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini testupgrade_upgrade

// Copy the stub that was created and the installed files
RUN_UTILS CopyFile e:\Documents\InstTest\upgrade1.txt e:\upgrade1.txt
RUN_UTILS CopyFile e:\Documents\InstTest\upgrade4.txt e:\upgrade4.txt
RUN_UTILS CopyFile e:\private\10202dce\811111FD_0.sis e:\811111FD_0.sis

// Uninstall SIMPLE.SIS
RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini u_testupgrade

// Now put the target files back in place and install the copy of the stub that was created earlier
RUN_UTILS MkDir e:\Documents\
RUN_UTILS MkDir e:\Documents\InstTest\
RUN_UTILS CopyFile e:\upgrade1.txt e:\Documents\InstTest\upgrade1.txt
RUN_UTILS CopyFile e:\upgrade4.txt e:\Documents\InstTest\upgrade4.txt
// Copy stub back into position
RUN_UTILS MkDir e:\private\
RUN_UTILS MkDir e:\private\10202dce\
RUN_UTILS CopyFile e:\811111FD_0.sis e:\private\10202dce\811111FD_0.sis
RUN_UTILS DeleteFile e:\upgrade1.txt
RUN_UTILS DeleteFile e:\upgrade4.txt
RUN_UTILS DeleteFile e:\811111FD_0.sis

RUN_TEST_STEP 100 tuiscriptadaptors InstallFHStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini testupgradestub

// Uninstall simple stub
RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini u_testupgradestub

// Remove the copy of the sis stub that we created
RUN_UTILS DeleteFile e:\Documents\InstTest\upgrade1.txt
RUN_UTILS DeleteFile e:\Documents\InstTest\upgrade4.txt
RUN_UTILS DeleteFile e:\private\10202dce\811111FD_0.sis

END_TESTCASE API-SEC-UpgradedStub-HW-0001


//! @SYMTestCaseID 		API-SEC-OrphanedStubSurvivesRollback-HW-0001
//! @SYMTestCaseDesc 		Make sure that a stub sis file removed during an install is recovered on rollback 
//! @SYMDEF 			DEF088493
//! @SYMTestPriority 		High
//! @SYMTestActions 		Install a package which replaces a stub sis file but fails to complete, check that the stub sis is
//! 				recovered on rollback.  Also check that a successful install replaces the stub correctly.
//! @SYMTestExpectedResults 	Replaced stub sis recovered on rollback, successful install replaces it correctly.
//! @SYMDevelopedForRelease 	Bravo

START_TESTCASE API-SEC-OrphanedStubSurvivesRollback-HW-0001

// Create orphaned fake stub sis and controller file
RUN_TEST_STEP 10 tuiscriptadaptors MmcCopyFilesStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini setuporphanstubandcontroller

// Attempt an install where the orphaned controller file will be held open so that install fails with KErrInUse and rolls back
RUN_TEST_STEP 10 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini simple_hold_controllerfile

// Perform an install which should complete successfully, replacing the orphaned stub and controller file.
RUN_TEST_STEP 10 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini simple

// Copy the stub that was created and the file1.txt installed by SIMPLE.SIS
RUN_UTILS CopyFile e:\private\10202dce\80000001.sis e:\80000001_0.sis
RUN_UTILS CopyFile e:\Documents\InstTest\file1.txt e:\file1.txt

// Uninstall SIMPLE.SIS
RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini u_simple

// Put file1.txt and the stub back in place
RUN_UTILS MkDir e:\Documents\
RUN_UTILS MkDir e:\Documents\InstTest\
RUN_UTILS CopyFile e:\file1.txt e:\Documents\InstTest\file1.txt
RUN_UTILS DeleteFile e:\file1.txt
// Copy stub back into position
RUN_UTILS MkDir e:\private\
RUN_UTILS MkDir e:\private\10202dce\
RUN_UTILS CopyFile e:\80000001_0.sis e:\private\10202dce\80000001_0.sis
RUN_UTILS DeleteFile e:\80000001_0.sis

// Make sure that we can re-install from the stub (so it must be the correct version).
RUN_TEST_STEP 10 tuiscriptadaptors InstallFHStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini simplestub

// Uninstall simple stub
RUN_TEST_STEP 10 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini u_stub

RUN_UTILS DeleteFile e:\private\10202dce\80000001_0.sis
RUN_UTILS DeleteFile e:\Documents\InstTest\file1.txt

END_TESTCASE API-SEC-OrphanedStubSurvivesRollback-HW-0001

START_TESTCASE API-INST-PREQ2344-SWI-19
// Make sure any previous installation of devlangsupport.sis is removed
RUN_UTILS DeleteFile e:\Documents\InstTest\devlangsup_en.txt
RUN_UTILS DeleteFile e:\Documents\InstTest\devlangsup_fr.txt
RUN_UTILS DeleteFile e:\private\10202dce\88000100_0.sis
RUN_UTILS DeleteFile e:\88000100_0.sis
RUN_UTILS DeleteFile e:\devlangsup_en.txt
RUN_UTILS DeleteFile e:\devlangsup_fr.txt
// Install the device language supported sis file
RUN_TEST_STEP 100 tuiscriptadaptors InstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini install_package
// Copy the stub and files that was created
RUN_UTILS CopyFile e:\private\10202dce\88000100_0.sis e:\88000100_0.sis
RUN_UTILS CopyFile e:\Documents\InstTest\devlangsup_en.txt e:\devlangsup_en.txt
RUN_UTILS CopyFile e:\Documents\InstTest\devlangsup_fr.txt e:\devlangsup_fr.txt
// Uninstall the package
RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini uninstall_package
// Now put the files back in place and install the copy of the stub that was created earlier
RUN_UTILS MkDir e:\Documents\
RUN_UTILS MkDir e:\Documents\InstTest\
RUN_UTILS CopyFile e:\devlangsup_en.txt e:\Documents\InstTest\devlangsup_en.txt
RUN_UTILS CopyFile e:\devlangsup_fr.txt e:\Documents\InstTest\devlangsup_fr.txt 
RUN_UTILS DeleteFile e:\devlangsup_en.txt
RUN_UTILS DeleteFile e:\devlangsup_fr.txt
RUN_UTILS MkDir e:\private\
RUN_UTILS MkDir e:\private\10202dce\
RUN_UTILS CopyFile e:\88000100_0.sis e:\private\10202dce\88000100_0.sis
// Install stub
RUN_TEST_STEP 100 tuiscriptadaptors InstallFHStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini install_stub
// Uninstall stub
RUN_TEST_STEP 100 tuiscriptadaptors UninstallStep z:\tswi\tuiscriptadaptors\scripts\tsisstub.ini uninstall_stub
// Remove the copy of files that we created
RUN_UTILS DeleteFile e:\88000100_0.sis
RUN_UTILS DeleteFile e:\Documents\InstTest\devlangsup_en.txt
RUN_UTILS DeleteFile e:\Documents\InstTest\devlangsup_fr.txt
RUN_UTILS DeleteFile e:\private\10202dce\88000100_0.sis
END_TESTCASE API-INST-PREQ2344-SWI-19

// Ensure that SWIS shuts down after the above tests to make sure heap checks run
RUN_TEST_STEP 5 tuiscriptadaptors SwisNotRunning