usbmgmt/usbmgrtest/T_usb/scripts/t_usb1.script
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // t_usb tests. 
       
    15 // Test Steps available
       
    16 // "StartUsb"			- Initiate Start of USB services
       
    17 // "WaitForUsb"			- Wait for the bus to re-enumerate
       
    18 // "StartCSY"			- Ask C32 to load the ACM CSY
       
    19 // "OpenDTE"			- Open the ACM comm port as a DTE
       
    20 // "OpenDCE"			- Open the ACM comm port as a DCE
       
    21 // "Read"			- Post a Read to the comm port
       
    22 // "Write"			- Post a Write to the comm port
       
    23 // "CancelRead"			- Cancel a pending Read
       
    24 // "CancelWrite" 		- Cancel a pending Write
       
    25 // "WaitForRead"		- Wait for a Read operation to complete
       
    26 // "WaitForWrite"		- Wait for a Write operation to complete
       
    27 // "ReadOneOrMore"		- Post a ReadOneOrMore to the comm port
       
    28 // "ClosePort"			- Close the ACM port
       
    29 // "CloseCommServer"		- Close the handle to C32
       
    30 // "CloseUsb"			- Close the handle to the USB server
       
    31 // "CloseAll"			- Close all handles (port, C32 and USB server)
       
    32 // "StopUsb"			- Stop USB services
       
    33 // "NotifySignalChange"		- Post a notify request for when signals change
       
    34 // "WaitForReadCancel"		- Wait for a read operation to be cancelled completely
       
    35 // "ReadThenCancel"		- Post a read and then cancel it immediately
       
    36 // "NotifyConfigChange"		- Post a notify request for when the config changes
       
    37 // "WaitForConfigChange"	- Wait for the configuration to change
       
    38 // "NotifyBreak"		- Post a notify request for when a break occurs
       
    39 // "WaitForBreak"		- Wait for a break to occur 
       
    40 // "SetSignalsToMarkC"		- Set the signals to mark (Requires a configuration file)
       
    41 // "SetSignalsToSpaceC"		- Set the signals to space (Requires a configuration file) 
       
    42 // "CheckSignalsC"		- Check the signals match (Requires a configuration file)
       
    43 // "WaitForReadFailureC"	- Wait for read failure (Requires a configuration file)
       
    44 // "WaitForWriteFailureC"	- Wait for write failure (Requires a configuration file)
       
    45 // "OpenPortC"			- Open the ACM port configurable for role, mode and return value
       
    46 // "WaitForSignalChangeC"	- Wait for the signals to change
       
    47 // 
       
    48 //
       
    49 
       
    50 LOAD_SUITE t_usb.dll
       
    51 
       
    52 ////////////////////////////////////////
       
    53 // Test 1 - Start and Stop Usb services
       
    54 ////////////////////////////////////////
       
    55 
       
    56 PRINT Please remove USB cable
       
    57 PAUSE
       
    58 
       
    59 // Request the USB services are started
       
    60 RUN_TEST_STEP -1, t_usb, StartUsb
       
    61 
       
    62 PRINT Please insert USB cable
       
    63 PAUSE
       
    64 
       
    65 // Wait for the bus to re-enumerate
       
    66 RUN_TEST_STEP -1, t_usb, WaitForUsb
       
    67 
       
    68 // Stop the USB services
       
    69 RUN_TEST_STEP -1, t_usb, StopUsb
       
    70 
       
    71 // Close all handles
       
    72 RUN_TEST_STEP -1, t_usb, CloseAll
       
    73 
       
    74 TEST_COMPLETE 1
       
    75 
       
    76 ////////////////////////////////////////
       
    77 // Test 2 - Open a comm port as DTE
       
    78 ////////////////////////////////////////
       
    79 
       
    80 PRINT Please remove USB cable
       
    81 PAUSE
       
    82 
       
    83 // Request the USB services are started
       
    84 RUN_TEST_STEP -1, t_usb, StartUsb
       
    85 
       
    86 PRINT Please insert USB cable
       
    87 PAUSE
       
    88 
       
    89 // Wait for the bus to re-enumerate
       
    90 RUN_TEST_STEP -1, t_usb, WaitForUsb
       
    91 
       
    92 // Open the ACM comm port as DTE
       
    93 RUN_TEST_STEP -1, t_usb, OpenDTE
       
    94 
       
    95 // Close the port
       
    96 RUN_TEST_STEP -1, t_usb, ClosePort
       
    97 
       
    98 // Close the rest of the handles
       
    99 RUN_TEST_STEP -1, t_usb, CloseAll
       
   100 
       
   101 TEST_COMPLETE 2
       
   102 
       
   103 UNLOAD
       
   104