Candela Technologies Logo
 
http://www.candelatech.com
sales@candelatech.com
+1 360 380 1618 [PST, GMT -8]
Network Testing and Emulation Solutions

Candela Technologies CLI Scripting Examples

This page contains CLI scripts that are used to automate control of the LANforge system. You may freely download and modify these scripts in any manner you would like. You are also welcome to submit scripts for inclusion here.

To better understand how you can use the CLI to script LANforge, you may wish to read the LANforge CLI User Guide.


NOTE: You must have the Net::Telnet perl module installed in order for these scripts to function. After downloading these scripts, rename them to remove the .txt from the end of their name, and, optionally, make them executable.

LANforge CLI Scripts
Description Script
This is a collection of Perl modules that automate some of the tasks involving setting and parsing objects through the LANforge CLI. They are a work in progress and may change significantly as I learn more Perl! Unzip this in the directory you run your Perl scripts in, or study up on Perl and install it in a more system-wide area. LANforge.pm.tgz
This script sets up connections of types: lf, lf_udp, lf_tcp, custom_ether, custom_udp, and custom_tcp across 3 ports on 2 machines.
It then continously starts and stops the connections.
lf_stress1.pl
This creates a few fast connections between 3 ports on two machines. It then starts/stops them with a fairly lengthy run between them.. lf_stress2.pl
This script is used to test 4 high-end machines. Two of them have GigE NICs in them, and will be configured to run back-to-back. Two other machines have a 4-port NIC and 2 single-port NICs. These ports will be configured to talk to each other.. lf_stress3.pl
This script uses the new LANforge perl modules, and is used in verification regression testing. It has the ability to set values and then test to see if the values were actually set correctly. You may find it interesting as an example of how to use the LANforge perl modules. Requires the LANforge.pm collection above. lf_verify.pl
The purpose of this script is to create 10 (or more) TCP and/or UDP connections on specified ports. The connections will run for a short period of time, and then 10 more will be created on a new set of ports (the next 10). It writes it's cmds to a log file so you can get an idea of what it's doing.

This script should be useful for people who are testing firewalls and other types of systems that care about what ports the data is transmitted on...

lf_port_walk.pl
The purpose of this script is to create as many TCP connections as possible. It creates 40 cross-connects (cmd-line arguments may over-ride the defaults). It then falls into an endless loop that starts all CXs, waits until both side has received traffic, and then stops the connections. lf_many_conn.pl
The purpose of this script is to test for the maximum number of simultaneous connections possible on either a firewall or router. The script sets up one UDP connection, then one TCP connection at a time up to 200 or more connections until the UDP starts dropping packets. Once the UDP connection starts dropping packets, the script records the number of TCP connections and runs the entire test again for 3 loops then calculates the average. lf_macvlan3.pl


Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA
www.candelatech.com | sales@candelatech.com | +1.360.380.1618
Google+ | Facebook | LinkedIn | Blog
Last modified: Wed Aug 6 16:50:37 PDT 2014