usbmgmt/usbmgrtest/T_usb/scripts/t_usb5.script
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 02:02:59 +0200
changeset 0 c9bc50fca66e
permissions -rw-r--r--
Revision: 201001 Kit: 201005

// Copyright (c) 2007-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:
// t_usb tests. 
// Test Steps available
// "StartUsb"				- Initiate Start of USB services
// "WaitForUsb"				- Wait for the bus to re-enumerate
// "StartCSY"				- Ask C32 to load the ACM CSY
// "OpenDTE"				- Open the ACM comm port as a DTE
// "OpenDCE"				- Open the ACM comm port as a DCE
// "Read"				- Post a Read to the comm port
// "Write"				- Post a Write to the comm port
// "CancelRead"				- Cancel a pending Read
// "CancelWrite" 			- Cancel a pending Write
// "WaitForRead"			- Wait for a Read operation to complete
// "WaitForWrite"			- Wait for a Write operation to complete
// "ReadOneOrMore"			- Post a ReadOneOrMore to the comm port
// "ClosePort"				- Close the ACM port
// "CloseCommServer"			- Close the handle to C32
// "CloseUsb"				- Close the handle to the USB server
// "CloseAll"				- Close all handles (port, C32 and USB server)
// "StopUsb"				- Stop USB services
// "NotifySignalChange"			- Post a notify request for when signals change
// "WaitForSignalChange"		- Wait for the signals to change
// "WaitForReadCancel"			- Wait for a read operation to be cancelled completely
// "ReadThenCancel"			- Post a read and then cancel it immediately
// "NotifyConfigChange"			- Post a notify request for when the config changes
// "WaitForConfigChange"		- Wait for the configuration to change
// "NotifyBreak"			- Post a notify request for when a break occurs
// "WaitForBreak"			- Wait for a break to occur 
// "SetSignalsToMarkC"			- Set the signals to mark (Requires a configuration file)
// "SetSignalsToSpaceC"			- Set the signals to space (Requires a configuration file) 
// "CheckSignalsC"			- Check the signals match (Requires a configuration file)
// "WaitForReadFailureC"		- Wait for read failure (Requires a configuration file)
// "WaitForWriteFailureC"		- Wait for write failure (Requires a configuration file)
// "OpenPortC"				- Open the ACM port configurable for role, mode and return value
// 
//

LOAD_SUITE t_usb.dll

////////////////////////////////////////////
// Test 5 - Check SignalChange Notification
////////////////////////////////////////////

PRINT Please remove USB cable
PAUSE

// Request the USB services are started
RUN_TEST_STEP -1, t_usb, StartUsb

PRINT Please insert USB cable
PAUSE

// Wait for the bus to re-enumerate
RUN_TEST_STEP -1, t_usb, WaitForUsb

// Open the ACM comm port as DTE
RUN_TEST_STEP -1, t_usb, OpenDTE

// Post a notification request for signal change
RUN_TEST_STEP -1, t_usb, NotifySignalChange

PRINT Please change signals on the host
PAUSE

// Wait for signal change notification
RUN_TEST_STEP -1, t_usb, WaitForSignalChange

// Close the port
RUN_TEST_STEP -1, t_usb, ClosePort

// Close the rest of the handles
RUN_TEST_STEP -1, t_usb, CloseAll

TEST_COMPLETE 5

UNLOAD