Spirent Test Center Controller Shell #1549
Quali-Community
started this conversation in
Integrations
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Spirent Test Center Controller Shell
Traffic Controller
A Shell implements integration of a device model, application or other technology with CloudShell. A shell consists of a data-model that defines how the device and its properties are modeled in CloudShell along with an automation that enables interaction with the device via CloudShell.
This Shell provides traffic controller capabilities such as loading test configuration, start traffic, stop traffic and more. The traffic controller shell should be used with a traffic chassis shell.
This Shell is based on the Shell Traffic Standard.
Before using it, make sure that you have installed the STC Chassis shell and executed the Autoload command.
The STC Chassis shell can be found at:
spirent-test-center-chasis-shell
Shell Documentation
The shell documentation can be found at: Spirent TestCenter Controller 1G Shell ReadMe.
Repository
Latest Release
README.md
Name
Spirent-TestCenterController-Shell
Owner
QualiSystems
Type
1st Gen Shell
Category
Traffic Generators
Min. Compatible CloudShell Version
7.0
Total Downloads
(All Releases)
221
Link
1.5.3-Preview
(Version / Tag)
TAR / ZIP
1.5.3-Preview (TAR)
1.5.3-Preview (ZIP)
Author
shmir
Published On
01/27/2019 10:38 AM
Assets
spirent_testcenter_controller.zip
[10 KB]
spirent_testcenter_controller_offline_requirements.zip
[3.17 MB]
Spirent TestCenter Controller 1G Shell
Release date: January 2019
Shell version: 1.5.3
Document version: A
In This Guide
Overview
A shell integrates a device model, application or other technology with CloudShell. A shell consists of a data model that defines how the device and its properties are modeled in CloudShell, along with automation that enables interaction with the device via CloudShell.
Note: We recommend using a 2nd gen shell where possible. Using a 1st gen shell may limit some shell management capabilities. For more information, see Shell Overview – “Our Shell”.
Traffic Generator Shells
CloudShell's traffic generator shells enable you to conduct traffic test activities on Devices Under Test (DUT) or Systems Under Test (SUT) from a sandbox. In CloudShell, a traffic generator is typically modeled using a chassis resource, which represents the traffic generator device and ports, and a controller service that runs the chassis commands, such as Load Configuration File, Start Traffic and Get Statistics. Chassis and controllers are modeled by different shells, allowing you to accurately model your real-life architecture. For example, scenarios where the chassis and controller are located on different machines.
For additional information on traffic generator shell architecture, and setting up and using a traffic generator in CloudShell, see the Traffic Generators Overiew online help topic.
Spirent TestCenter Controller 1G Shell
To model a Spirent TestCenter device in CloudShell, use the following shells:
▪ Spirent TestCenter Chassis 2G Shell, which provides data model and autoload functionality to model and load the Spirent TestCenter Chassis to resource management.
▪ Spirent TestCenter Controller 1G Shell (service), which provides functionality to load test configuration, run tests, get test results, etc.
For more information on Spirent TestCenter, see the official device manufacturer product documentation.
Standard version
For detailed information about the shell’s structure and attributes, see the Shells Standard: Traffic Generator Controller.(https://github.com/QualiSystems/cloudshell-standards/blob/master/Documentation/Traffic%20Generator%20Controller%20Shell%20Standard.md) in GitHub.
Supported OS
▪ Windows
Requirements
Release: Spirent TestCenter Controller 1G Shell
▪ CloudShell version: 8.1 and above
▪ TestCenter Rest Server: Lab Server or STC web services
Data Model
The shell's data model includes all shell metadata, families, and attributes.
Spirent TestCenter Controller Attributes
The attribute names and descriptions are listed in the following table:
Automation
This section describes the automation (driver) associated with the data model. The shell’s driver is provided as part of the shell package. There are two types of automation processes, Autoload and Resource. Autoload is executed when creating the resource in the Inventory dashboard, while resource commands are run in the sandbox.
For Traffic Generator shells, commands are configured and executed from the controller service in the sandbox, with the exception of the Autoload command, which is executed when creating the resource.
The following table describes the process that occurrs during Autoload for the controller shell:
User Commands
The following table lists the commands the sandbox end-user can run from the controller service:
Note: For detailed information on running a traffic test in CloudShell, see Traffic Generators Overview.
Set the command input as follows:
▪ STC config file name (String) (Mandatory): Full path to the STC configuration file name - tcc or xml.
Set the command input as follows:
▪ Blocking (Enum): True: Returns after traffic finishes running; False: Returns immediateley.
Set the command's inputs as follows:
▪ View Name: (String) (Mandatory) - Type of statistics to return, such as generatorPortResults, analyzerPortResults, etc.
▪ Output Type (Enum): JSON or CSV. JSON prints the statistics to the sandbox's output, which is useful for API calls that can then use the output, while CSV attaches a CSV file with the test's statistics to the sandbox.
Command (Enum)
▪ Start, Stop or Wait for sequencer to end (Blocking).
Hidden Commands
The following table describes the hidden developer commands from the controller service:
If child_type == None, all children will be returned.
child_type: Requested child type
attr_name: Requested attribute name
attr_value: Value to set
parameters_json: Command parameters dict {name: value} as serialized json
The following is a simple code snippet demonstrating the hidden commands:
The code assumes that reservation_id holds the reservation ID and session holds the CS session.
Downloading the Shell
The Spirent TestCenter Controller 1G Shell is available from the Quali Community Integrations page.
Download the files into a temporary location on your local machine.
The shell comprises:
Importing and Configuring the Shell
This section describes how to import the Spirent TestCenter Controller 1G Shell and configure and modify the shell’s devices.
Importing the shell into CloudShell
To import the shell into CloudShell:
Make sure you have the shell’s zip package. If not, download the shell from the Quali Community's Integrations page.
Backup your database.
Log in to CloudShell Portal as administrator and access the relevant domain.
In the user menu select Import Package.
Browse to the location of the downloaded shell file, select the relevant .zip file and Click Open. Alternatively, drag the shell’s .zip file into CloudShell Portal.
The Spirent TestCenter controller shell is displayed in the App/Service>Applications section of your blueprint, and can be used to run custom code and automation processes in the sandbox. For more information, see Services Overview.
Offline installation of a shell
Note: Offline installation instructions are relevant only if CloudShell Execution Server has no access to PyPi. You can skip this section if your execution server has access to PyPi. For additional information, see the online help topic on offline dependencies.
In offline mode, import the shell into CloudShell and place any dependencies in the appropriate dependencies folder. The dependencies folder may differ, depending on the CloudShell version you are using:
For CloudShell version 8.3 and above, see Adding Shell and script packages to the local PyPi Server repository.
For CloudShell version 8.2, perform the appropriate procedure: Adding Shell and script packages to the local PyPi Server repository or Setting the Python pythonOfflineRepositoryPath configuration key.
For CloudShell versions prior to 8.2, see Setting the Python pythonOfflineRepositoryPath configuration key.
Adding shell and script packages to the local PyPi Server repository
If your Quali Server and/or execution servers work offline, you will need to copy all required Python packages, including the out-of-the-box ones, to the PyPi Server's repository on the Quali Server computer (by default C:\Program Files (x86)\QualiSystems\CloudShell\Server\Config\Pypi Server Repository).
For more information, see Configuring CloudShell to Execute Python Commands in Offline Mode.
To add Python packages to the local PyPi Server repository:
If you haven't created and configured the local PyPi Server repository to work with the execution server, perform the steps in Add Python packages to the local PyPi Server repository (offline mode).
For each shell or script you add into CloudShell, do one of the following (from an online computer):
Connect to the Internet and download each dependency specified in the requirements.txt file with the following command:
pip download -r requirements.txt
.The shell or script's requirements are downloaded as zip files.
In the Quali Community's Integrations page, locate the shell and click the shell's Download link. In the page that is displayed, from the Downloads area, extract the dependencies package zip file.
Place these zip files in the local PyPi Server repository.
Setting the Python PythonOfflineRepositoryPath configuration key
Before PyPi Server was introduced as CloudShell’s Python package management mechanism, the
PythonOfflineRepositoryPath
key was used to set the default offline package repository on the Quali Server machine, and could be used on specific Execution Server machines to set a different folder.To set the offline Python repository:
Download the Spirent_TestCenter_controller_offline_requirements.zip file, see Downloading the Shell.
Unzip it to a local repository. Make sure the execution server has access to this folder.
On the Quali Server machine, in the ~\CloudShell\Server\customer.config file, add the following key to specify the path to the default Python package folder (for all Execution Servers):
<add key="PythonOfflineRepositoryPath" value="repository full path"/>
If you want to override the default folder for a specific Execution Server, on the Execution Server machine, in the ~TestShell\Execution Server\customer.config file, add the following key:
<add key="PythonOfflineRepositoryPath" value="repository full path"/>
Restart the Execution Server.
Configuring a new service
To configure a service for the device:
In CloudShell Resource Manager, in the Inventory tab, click Resource Families.
In the Traffic Generator Controller folder, select TestCenter Controller.
In the Attributes tab, enter the Default Values for the Spirent TestCenter Controller service as follows:
CloudShell validates the device’s settings and updates the new resource with the device’s structure.
Updating Python Dependencies for Shells
This section explains how to update your Python dependencies folder. This is required when you upgrade a shell that uses new/updated dependencies. It applies to both online and offline dependencies.
Updating offline Python dependencies
To update offline Python dependencies:
Download the latest Python dependencies package zip file locally.
Extract the zip file to the suitable offline package folder(s).
Terminate the shell’s instance, as explained here.
Updating online Python dependencies
In online mode, the execution server automatically downloads and extracts the appropriate dependencies file to the online Python dependencies repository every time a new instance of the driver or script is created.
To update online Python dependencies:
Associating a CloudShell Service to a Non-Global Domain
In order to expose a service to users of a domain that is not the Global domain, you must associate the service to the domain. To do this, you need to associate the service to a category that is assigned to the domain.
When you import a service shell, most shells are automatically assigned a default service category which is associated with the Global domain. For custom shells, this may not be true.
To associate the Spirent TestCenter Controller 1G service to a non-global domain:
Note: The association process differs depending on the type of shell - second generation (2G) shell or first generation (1G) shell. The instructions below detail the steps for a 1G service shell.
(Optional) You can associate the service to a service category that already exists in CloudShell or associate the service to a new category.
Note: If you do not want to change the category(s) of this shell, you can use the default category that comes out-of-the-box (if it exists).
Do one of the following:
Associate the service family to an existing category(s).
In Resource Manager Client, open the Resource Families explorer and click the relevant service family.
From the right pane, open the Categories tab.
Click Add. The Select Category dialog box is displayed.
Select a category from the catalog and click OK.
or
Associate the shell’s service category to a domain.
In the Manage dashboard, click Categories from the left sidebar, or Domains if you are a domain admin.
Select Services Categories.
Click the service category that is associated with your service shell.
In the Edit Category dialog box, from the Domains drop-down list, select the desired domain(s).
Click Save.
Typical Workflows
Workflow - Using the Spirent controller to run TestCenter traffic
Create a new blueprint.
a. In CloudShell Portal, in the top left section of the Blueprint Catalog, click + Create Blueprint.
b. Give the blueprint a name.
Add resources and services to the blueprint.
a. Click the App/Services tab and add the TestCenter Controller service.
b. Click the Resource button and add the TestCenter chassis resource and all needed ports into the diagram. The number of STC ports in the blueprint should match the number of ports in the TestCenter configuration. For example, if you have a configuration with two ports:
Reserve the blueprint to create a sandbox.
Edit the TestCenter Controller Service parameters if required.
See Configuring a new service.
Click Add.
Map the configuration ports to the sandbox ports. For each port in the TestCenter configuration, assign a physical port from the ports in the sandbox. To do this, open the attributes tab and set the Logical Name to the port name in the configuration:
References
To download and share integrations, see Quali Community's Integrations.
For instructional training and documentation, see Quali University.
To suggest an idea for the product, see Quali's Idea box.
To connect with Quali users and experts from around the world, ask questions and discuss issues, see Quali's Community forums.
To use traffic generator ports as abstract resources, see CloudShell's Online Help.
Release Notes
What's New
• The Get Statistics command does not fail, if there are no results available on the STC chassis (for example, if traffic did not start) and instead, returns an empty statistics table.
For release updates, see the shell's GitHub releases page.
* Please allow 30-60 seconds for manual update changes to take effect.
ofir eldar 04/18/2017 02:09 PM
· 1280 ·
Beta Was this translation helpful? Give feedback.
All reactions