Studio:WorkspaceSetup.pl: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
The WorkspaceSetup.pl script (found in the STRIDE ''scripts'' directory) provides a command line tool for creating workspaces from a Framework.  This script requires perl for execution as well as the STRIDE Test Utilities.
The WorkspaceSetup.pl script (found in the STRIDE ''scripts'' directory) provides a command line tool for creating canonical STRIDE Studio workspaces suitable for organizing your test scripts.  This script requires perl for execution as well as the STRIDE Test Utilities.


==Usage==
==Usage==
Line 14: Line 14:
;-d | --dirworkspace = WorkspaceDirectory
;-d | --dirworkspace = WorkspaceDirectory
:Specifies the directory in which to create the new workspace. Defaults to the current directory.
:Specifies the directory in which to create the new workspace. Defaults to the current directory.
;-f | --framework = TargetFramework
:Specifies the STRIDE Target Framework to use when creating the workspace. As of this writing, STRIDE provides several basic frameworks:
:*'''''LinuxTestAgent''''' for TestAgent-based tests on a FedoraCore7 target machine.
:*'''''WindowsTestAgent''''' for TestAgent-based tests on the host platform.
:*'''''WindowsTestApp''''' for TestApp-based tests on the host platform.
:*'''''WinMobileTestAgent''''' for TestAgent-based tests on a WinMobile device.
:*'''''GenericTestAgent''''' for a skeleton framework that prompts the user at each step that requires action (e.g. building or starting the target application).
:*'''''GenericTestApp''''' for a skeleton framework that prompts the user at each step that required action.
:Customers can create additional custom frameworks and specify additional search paths for this script to use to locate the frameworks.
;-g | --dirframework = FrameworkSearchDirectory
:Specifies an additional directory path to search for the specified framework. If the framework is not found in the default STRIDE frameworks directory, these directories will be searched. This option can be specified multiple times to add multiple directories to the framework search path.
;-p | --package = PackageName
:Specifies a Test Package to add to the workspace when it is created. If no packages are specified, the workspace will be created without any tests in it. This option can be specified multiple times to add multiple packages to the new workspace
;-q | --dirpackage = PackageSearchDirectory
:Specifies an additional directory path to search for packages. For any package that is specified with the --package option, we first look in the packages directory in the STRIDE installation directory. If it is not found there, we will search in the location(s) specified by this option. This option can be specified multiple times to add multiple additional directories to the packages search path.
;-s | --commonsettings = MySettings.pm
:Allows users to specify a different CommonSettings file to copy into the generated workspace directory. This allows framework users to generate a workspace with a customized set of local settings.
;-c | --workspaceconfig = MyConfig.pm
;-c | --workspaceconfig = MyConfig.pm
:Allows users to specify a different WorkspaceConfig file to use when creating the workspace. This allows framework users to generate a workspace with custom config parameters.
:Allows users to specify a different WorkspaceConfig file to use when creating the workspace. This allows framework users to generate a workspace with custom config parameters.
Line 40: Line 23:
The workspaces that are created by WorkspaceSetup will have the following files and folders (items in '''<brackets>''' indicate folders):
The workspaces that are created by WorkspaceSetup will have the following files and folders (items in '''<brackets>''' indicate folders):


   '''< Script Files >'''
   '''< Script Files >'''  
    '''<[[#build Folder|build]]> (only if present in the input framework)'''
      [[Creating Frameworks#CheckEnv.pl|CheckEnv.pl]]
      [[Creating Frameworks#CompileWorkspace.pl|CompileWorkspace.pl]]
      [[Creating Frameworks#CreateInterceptModule.pl|CreateInterceptModule.pl]]
      [[Creating Frameworks#BuildStrideAgent.pl|BuildStrideAgent.pl]]
      '''<[[#Intercept Module Overrides Folder|Intercept Module Overrides]]>'''
        '''<{Package_X}>'''
          (optional package specific scripts, grouped into a package folder)
        '''<...>'''  
     '''<[[#setup Folder|setup]]>'''
     '''<[[#setup Folder|setup]]>'''
       [[Creating Frameworks#StartPrintLog.pl|StartPrintLog.pl]]
       [[Creating Frameworks#StartPrintLog.pl|StartPrintLog.pl]]
      [[Creating Frameworks#StartTestAgent.pl|StartTestAgent.pl]]
     '''<[[#test Folder|test]]>'''  
        (OR any other files that exist in the input framework's setup folder)
     '''<[[#test Folder|test]]>'''
        '''<{Package_X}>'''
          (package specific test scripts, grouped into a package folder)
        '''<...>'''  
     '''<[[#teardown Folder|teardown]]>'''
     '''<[[#teardown Folder|teardown]]>'''
      [[Creating Frameworks#StopTestAgent.pl|StopTestAgent.pl]]
        (OR any other files that exist in the input framework's teardown folder)
       [[Creating Frameworks#StopPrintLog.pl|StopPrintLog.pl]]
       [[Creating Frameworks#StopPrintLog.pl|StopPrintLog.pl]]
       [[Creating Frameworks#TweakResults.pl|TweakResults.pl]]
       [[Creating Frameworks#TweakResults.pl|TweakResults.pl]]
     '''<[[#utility Folder|utility]]>'''
     '''<[[#utility Folder|utility]]>'''
      (optional [[Creating Frameworks#utility Directory (framework)|Framework specific]] utility libraries)
      [[Creating Frameworks#BuildUtilities.pm|BuildUtilities.pm]]
      [[Creating Frameworks#TargetUtilities.pm|TargetUtilities.pm]]
       '''<[[#recovery Folder|recovery]]>'''
       '''<[[#recovery Folder|recovery]]>'''
         [[Creating Frameworks#OnError.pl (framework)|OnError.pl]]
         [[Creating Frameworks#OnError.pl (framework)|s2OnError.pl]]
        [[Creating Frameworks#OnTimeout.pl (framework)|OnTimeout.pl]]
 
      [[Creating Frameworks#CommonSettings.pm|CommonSettings.pm]]
      [[Creating Frameworks#FrameworkUtilities.pm|FrameworkUtilities.pm]]
   '''< Source Files >'''
   '''< Source Files >'''
    '''<[[#Framework Folder|Framework]]>'''
      [[Creating Frameworks#strideIMProbe_SCL.h|strideIMProbe_SCL.h]]
    '''<{Package_X}>'''
      (optional package specific source, grouped into a package folder)
    '''<...>'''
===build Folder===
This folder contains the general and Framework-specific scripts necessary for building the STRIDE workspace and strideAgent device image. If this folder is not present in the input framework (e.g. with a TestApp framework), then it will be omitted from the generated workspace.
===Intercept Module Overrides Folder===


This folder may contain one or more Test Package-specific scripts for properly configuring the Intercept Module settings for the interfaces associated with the package.


===setup Folder===
===setup Folder===


This folder contains the scripts necessary to prepare the device for testing. For TestAgent-based frameworks, this might involve transfer of the TestAgent image and starting of the process on the device.
This folder is intended to contain the scripts necessary to prepare the device for testing. For the canonical workspace, we add a script that opens a traceview to capture srPrint* output messages. Users might choose to add scripts for starting and initializing the device under test.


===test Folder===
===test Folder===


This folder contains all package-specific tests, grouped in sub-folders by package name. For TestAgent-based frameworks, this folder also has the "OnRunConnect" property set to true so that a target connection will be initiated when it is executed. The connection is established using your global connection settings (see STRIDE Studio reference guide for more information).
This folder is intended to contain the test scripts to be executed on the device. It is created by this setup and test script writers are free to organize test scripts however they want in this folder. This folder also has the "OnRunConnect" property set to true so that a target connection will be initiated when it is executed. The connection is established using your global connection settings (see STRIDE Studio reference guide for more information).


===teardown Folder===
===teardown Folder===


This folder contains the scripts necessary to cleanup after testing is completed. For TestAgent-based frameworks, this might involve stopping the TestAgent process and removing the TestAgent image from the device.
This folder contains the scripts necessary to cleanup after testing is completed. This might involve, for example, stopping the device. The canonical workspace contains one script to process the srPrint* info sent to the logging traceview and another to adjust the hierarchy of the final report results.  


===utility Folder===
===utility Folder===


This folder contains utility libraries that are associated with the workspace.  Some files come from the common STRIDE Framework, while others are Framework-specific. Not all of the files in this directory tree are included in execution; as such, they are in the workspace primarily for convenience to the users.
This folder should be used to hold utility libraries that are associated with the workspace.  This directory is not included in execution; as such, the files therin are provided for convenience to the users.


===recovery Folder===
===recovery Folder===


This folder contains the OnError and OnTimeout scripts &ndash; either a [[Creating Frameworks#OnError.pl (framework)|specific implementation]] provided by the Framework or the [[Creating Frameworks#OnError.pl (common)|default implementation]] provide by the STRIDE common files.
This folder contains the sample s2OnError script that we provide. This is intended as a template for customization depending on your device's needs.
 
===Framework Folder===
 
This folder contains source code required for general Framework test execution and recovery.


== See Also ==
== See Also ==

Revision as of 22:04, 2 December 2008

The WorkspaceSetup.pl script (found in the STRIDE scripts directory) provides a command line tool for creating canonical STRIDE Studio workspaces suitable for organizing your test scripts. This script requires perl for execution as well as the STRIDE Test Utilities.

Usage

Summary

WorkspaceSetup.pl -w MyWorkspace -d "MyDir" -f fxname [-g fxdir -p pkg -q pkgdir -s customsettings -c customconfig -l]
Parameters
-w | --workspacename = WorkspaceName
Specifies the name new workspace to be created. This workspace will be created in the directory specified by the --dirworkspace argument or in the current directory (if no workspace directory is specified). Defaults to 'MyWorkspace'.
-d | --dirworkspace = WorkspaceDirectory
Specifies the directory in which to create the new workspace. Defaults to the current directory.
-c | --workspaceconfig = MyConfig.pm
Allows users to specify a different WorkspaceConfig file to use when creating the workspace. This allows framework users to generate a workspace with custom config parameters.
-l | --launch
Launches STRIDE Studio and opens the newly created workspace.

Workspace Layout

The workspaces that are created by WorkspaceSetup will have the following files and folders (items in <brackets> indicate folders):

 < Script Files > 
   <setup>
     StartPrintLog.pl
   <test> 
   <teardown>
     StopPrintLog.pl
     TweakResults.pl
   <utility>
     <recovery>
       s2OnError.pl
 < Source Files >


setup Folder

This folder is intended to contain the scripts necessary to prepare the device for testing. For the canonical workspace, we add a script that opens a traceview to capture srPrint* output messages. Users might choose to add scripts for starting and initializing the device under test.

test Folder

This folder is intended to contain the test scripts to be executed on the device. It is created by this setup and test script writers are free to organize test scripts however they want in this folder. This folder also has the "OnRunConnect" property set to true so that a target connection will be initiated when it is executed. The connection is established using your global connection settings (see STRIDE Studio reference guide for more information).

teardown Folder

This folder contains the scripts necessary to cleanup after testing is completed. This might involve, for example, stopping the device. The canonical workspace contains one script to process the srPrint* info sent to the logging traceview and another to adjust the hierarchy of the final report results.

utility Folder

This folder should be used to hold utility libraries that are associated with the workspace. This directory is not included in execution; as such, the files therin are provided for convenience to the users.

recovery Folder

This folder contains the sample s2OnError script that we provide. This is intended as a template for customization depending on your device's needs.

See Also