datacommsserver/esockserver/test/TE_RConnection/scripts/Mobility/Mobility_761220.script
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 26 Jan 2010 13:09:14 +0200
changeset 4 928ed51ddc43
parent 0 dfb7c4ff071f
permissions -rw-r--r--
Revision: 201004 Kit: 201004

//
// 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 "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
//! @SYMTestSuiteName NET-BEARERMOBILITY
//! @SYMScriptTestEnvironment Standard Symbian HRP or emulator environment

// Load the test suite
LOAD_SUITE te_esockteststepsSuite -SharedData

// Set up the comms database and start esock in preparation for the test
RUN_SCRIPT Z:\TestData\scripts\te_esock_test_unloadesockForced.script
CED -i z:\testdata\configs\BearerMobility\BearerMobility_001.ced.cfg c:\BearerMobility_001.ced.cfg.log
RUN_SCRIPT z:\TestData\scripts\te_esock_test_loadesock.script


START_TESTCASE			COMINF-ESOCK-RConnection-Mobility-3601
//! @SYMTestCaseID		COMINF-ESOCK-RConnection-Mobility-3601
//!@SYMTestCaseDesc           	TODO_CDG
//!@SYMPREQ                   	PREQ1060
//!@SYMAPI
// TODO_CDG
//!@SYMTestPriority           	Critical
//!@SYMTestActions
// TODO_CDG
//!@SYMTestType               	CIT
//!@SYMTestExpectedResults    	TODO_CDG


PRINT NET_BMOBILITY_761220: (Testing no support for blacklisiting)
PRINT RConnection::Start() with the most preferred AP4 down == starting on AP5,
PRINT RCommsMobilityApiExt::Open(),
PRINT RCommsMobilityApiExt::RegisterForMobilityNotification(),
PRINT Simulate current AP (4) up
PRINT Receive PreferredCarierAvailable (4),
PRINT RCommsMobilityApiExt::RegisterForMobilityNotification(),
PRINT RCommsMobilityApiExt::MigrateToPreferredCarrier(),
PRINT Receive NewCarierActive,
PRINT RCommsMobilityApiExt::RegisterForMobilityNotification(),
PRINT RSocket::Send()/Receive(), RSocket::Close()
PRINT RCommsMobilityApiExt::NewCarrierRejected(),
PRINT Receive PreferredCarierAvailable (5),
PRINT RCommsMobilityApiExt::RegisterForMobilityNotification(),
PRINT RCommsMobilityApiExt::MigrateToPreferredCarrier(),
PRINT Receive NewCarierActive,
PRINT RCommsMobilityApiExt::RegisterForMobilityNotification(),
PRINT RSocket::Send()/Receive(), RSocket::Close()
PRINT RCommsMobilityApiExt::NewCarrierAccepted(),
PRINT Simulate current AP (4) down
PRINT Simulate current AP (4) up
PRINT Receive PreferredCarierAvailable (4) == NO BLACKLISTING
PRINT RCommsMobilityApiExt::Close()


// Create and connect socketserver and connectionserver instances
RUN_TEST_STEP 100 te_esockteststepsSuite creatersocketservStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CreateSockSvr
RUN_TEST_STEP 100 te_esockteststepsSuite connectrsocketservStep z:\testdata\configs\BearerMobility\Mobility_761220.ini ConnectSockSvr

// Initialise availability
RUN_TEST_STEP 100 te_esockteststepsSuite SetAccessPointAvailabilityStep z:\testdata\configs\BearerMobility\Mobility_761220.ini SetAvailability_Ap4Down
RUN_TEST_STEP 100 te_esockteststepsSuite SetAccessPointAvailabilityStep z:\testdata\configs\BearerMobility\Mobility_761220.ini SetAvailability_Ap5Up

// Create, open and start the connection
RUN_TEST_STEP 100 te_esockteststepsSuite createrconnectionStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CreateConn
RUN_TEST_STEP 100 te_esockteststepsSuite openrconnectionStep z:\testdata\configs\BearerMobility\Mobility_761220.ini OpenConn
RUN_TEST_STEP 100 te_esockteststepsSuite startrconnectionStep z:\testdata\configs\BearerMobility\Mobility_761220.ini StartConn

// Create and open a mobility extension on the opened connection and request events on it
RUN_TEST_STEP 100 te_esockteststepsSuite OpenRCommsMobilityAPIExtStep z:\testdata\configs\BearerMobility\Mobility_761220.ini OpenMobilityExtension
RUN_TEST_STEP 100 te_esockteststepsSuite RegisterForMobilityNotificationStep z:\testdata\configs\BearerMobility\Mobility_761220.ini RegisterForMobilityNotifs

// Make the active bearer become unavailable so that a migration will be offered
RUN_TEST_STEP 100 te_esockteststepsSuite SetAccessPointAvailabilityStep z:\testdata\configs\BearerMobility\Mobility_761220.ini SetAvailability_Ap4Up

// Check for mobility events, fully expecting to now be offered the more preferred bearer, and accept the migration
RUN_TEST_STEP 100 te_esockteststepsSuite CheckMobilityNotificationStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CheckPreferredCarrierAvailable_Ap4
RUN_TEST_STEP 100 te_esockteststepsSuite RegisterForMobilityNotificationStep z:\testdata\configs\BearerMobility\Mobility_761220.ini RegisterForMobilityNotifs
RUN_TEST_STEP 150 te_esockteststepsSuite migratercommsmobilityapiextStep z:\testdata\configs\BearerMobility\Mobility_761220.ini MigrateToPreferredCarrier

// Receive NewCarrierActive
RUN_TEST_STEP 100 te_esockteststepsSuite CheckMobilityNotificationStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CheckNewCarrierActive_Ap4
RUN_TEST_STEP 100 te_esockteststepsSuite RegisterForMobilityNotificationStep z:\testdata\configs\BearerMobility\Mobility_761220.ini RegisterForMobilityNotifs

// Now test the data path and confirm we are on the new bearer
RUN_TEST_STEP 100 te_esockteststepsSuite creatersocketStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CreateSocket
RUN_TEST_STEP 100 te_esockteststepsSuite openrsocketStep z:\testdata\configs\BearerMobility\Mobility_761220.ini OpenSocket
RUN_TEST_STEP 100 te_esockteststepsSuite connectrsocketStep z:\testdata\configs\BearerMobility\Mobility_761220.ini ConnectSocket
RUN_TEST_STEP 100 te_esockteststepsSuite sendreceiversocketStep z:\testdata\configs\BearerMobility\Mobility_761220.ini SendReceiveSocket

//*REJECT*
RUN_TEST_STEP 100 te_esockteststepsSuite rejectcarrierrcommsmobilityapiextStep z:\testdata\configs\BearerMobility\Mobility_761220.ini RejectNewCarrier

//Finish the handshake (to agree AP5 again)
RUN_TEST_STEP 100 te_esockteststepsSuite CheckMobilityNotificationStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CheckPreferredCarrierAvailable_Ap5
RUN_TEST_STEP 100 te_esockteststepsSuite RegisterForMobilityNotificationStep z:\testdata\configs\BearerMobility\Mobility_761220.ini RegisterForMobilityNotifs
RUN_TEST_STEP 150 te_esockteststepsSuite migratercommsmobilityapiextStep z:\testdata\configs\BearerMobility\Mobility_761220.ini MigrateToPreferredCarrier

// Receive NewCarrierActive
RUN_TEST_STEP 100 te_esockteststepsSuite CheckMobilityNotificationStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CheckNewCarrierActive_Ap5
RUN_TEST_STEP 100 te_esockteststepsSuite RegisterForMobilityNotificationStep z:\testdata\configs\BearerMobility\Mobility_761220.ini RegisterForMobilityNotifs

//Test the sockets again
RUN_TEST_STEP 100 te_esockteststepsSuite sendreceiversocketStep z:\testdata\configs\BearerMobility\Mobility_761220.ini SendReceiveSocket

//Accept the 5th now
RUN_TEST_STEP 100 te_esockteststepsSuite acceptcarrierrcommsmobilityapiextStep z:\testdata\configs\BearerMobility\Mobility_761220.ini AcceptNewCarrier

// Now make the preferred bearer unavailable again and then available again (this should trigger new mobility handshake == THERE IS NO BLACKLISTING)
RUN_TEST_STEP 100 te_esockteststepsSuite SetAccessPointAvailabilityStep z:\testdata\configs\BearerMobility\Mobility_761220.ini SetAvailability_Ap4Down
RUN_TEST_STEP 100 te_esockteststepsSuite SetAccessPointAvailabilityStep z:\testdata\configs\BearerMobility\Mobility_761220.ini SetAvailability_Ap4Up

// Confirm now that we receive PreferredCarrierAvailable again indicating that the bearer is *NOT BLACKLISTED*
RUN_TEST_STEP 100 te_esockteststepsSuite CheckMobilityNotificationStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CheckPreferredCarrierAvailable_Ap4

// Close the resources we opened and cleanup
RUN_TEST_STEP 100 te_esockteststepsSuite CloseRCommsMobilityAPIExtStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CloseMobilityExtension
RUN_TEST_STEP 100 te_esockteststepsSuite closersocketStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CloseSocket
RUN_TEST_STEP 100 te_esockteststepsSuite CloseRConnectionStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CloseConn
RUN_TEST_STEP 100 te_esockteststepsSuite closersocketservStep z:\testdata\configs\BearerMobility\Mobility_761220.ini CloseSocketSvr
RUN_TEST_STEP 100 te_esockteststepsSuite cleanallStep
END_TESTCASE			COMINF-ESOCK-RConnection-Mobility-3601

// Clean up
RUN_SCRIPT Z:\TestData\Scripts\te_esock_test_stopallinterfaces.script
RUN_SCRIPT Z:\TestData\scripts\te_esock_test_unloadesockForced.script

PRINT Completed NET_BMOBILITY_761220