Candela Technologies Logo
Network Testing and Emulation Solutions

Load Scenarios And Control Test Groups With Python

Goal: Using a python script to load scenarios and start, stop, and quiesce test groups

This cookbook will demonstrate how we can use json to load DB scenarios and control test groups using python. We will be referencing the script scenario.py. Requires LANforge 5.4.2.
 
  1. Running The Script

    1. Setting up
      1. For this example we are using a database called fio_test_group. It has two stations that each have a read-only and write-only file-io endpoint attached to them. Port tab highlighting created stationsList of File-IO endpointsEach pair of file-io endpoints are in a group. One group is named test-group-ro and the other is test-group-wo.Test Group tab showing test-group-roTest Group tab showing test-group-wo
  2. Script Examples

    1. The Command and Available Options
      1. The script is located in lanforge-scripts/py-scripts/. From that directory we can use ./scenario.py to run the script.
      2. The available options are:
        1. --load db_name | This will load the database named db_name
        2. --action (overwrite, append) | Optional argument to be used with --load, will specify an action to take when loading the database. The default action is to overwrite. The append option is more difficult to use and its use is discouraged. See here for more info.
        3. --clean_dut | Optional argument to be used with --load, will cleanup DUTs on load. See here for more info.
        4. --clean_chambers | Optional argument to be used with --load, will cleanup Chambers on load. See here for more info.
        5. --start group_name | This will start the cross-connects in the specified group
        6. --stop group_name | This will stop the cross-connects in the specified group
        7. --quiesce group_name | This will quiesce the cross-connects in the specified group
    2. Examples of Running the Script
      • Loading fio_test_group with overwrite
      • Status tab showing successful load of database
      • Starting test-group-ro
      • Test Group tab showing test-group-ro being started
      • Stopping test-group-ro
      • Test Group tab showing test-group-ro being stopped
      • Quiescing test-group-wo
      • Test Group tab showing test-group-wo being started and quiesced

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA
www.candelatech.com | sales@candelatech.com | +1.360.380.1618
Facebook | LinkedIn | Blog