Home Products and Solutions Tcl Test Scripts
Tcl Test Scripts

The SilverCreek SNMP Test Suite contains well over 1000 test scripts that can generate hundreds of thousands of test cases. The total number of tests cases available in SilverCreek is not a constant number--it grows with the number of MIBs implemented in the product under test.

These test scripts automatically run against your SNMPv1, v2c, or v3 agent to test for protocol compliance and conformance. In addition the SilverCreek SNMP Test Suite also tests your private and enterprise MIBs.

The syntactic tests verify protocol compliance, error and exception handling, and boundary condition behavior. The functionality tests (semantic tests) verify performance, trap/alert/event/notification handling, counter accuracy, security vulnerabilities, performance and many other implementation specific areas.

Small, single function tests exercise one or a small number of parameters. All the tests are written in Tcl (Tool Command Language), an industry standard, interpreted, scripting language. The use of a scripting language permits easy modifications, customizations, or additions to the tests. The SNMP tests make use of an SNMP engine written in C++.

The tests were designed and approved by the InterWorking Labs Advisory Board. The Board includes experts from the IETF and other industry associations who are well known for the depth and breadth of their knowledge of the practical implementations of SNMP.

The SNMP tests have been tested and debugged by thousands of users over many years. The tests generate deterministic results so that software testers can take decisive action on bug fixes, and are not left with ambiguous information.

  • Hundreds of thousands of test cases – the most comprehensive coverage available
  • Tests all versions of SNMP – v1, v2c, and v3
  • Tests your private and enterprise MIBs automatically
  • Create your own tests with a graphical test generator or copy/edit existing tests

Every Silvercreek SNMP test begins with the information you need to know to find and fix bugs.

Each Silvercreek SNMP Test Description Contains:

1. Purpose of the test

1.1.12.x The purpose of these tests is to verify that the agent can handle message boundary conditions correctly.

2. Algorithm "or what the test is doing"

1.1.12.1 This test issues a GET Request, a GET-NEXT request and a SET Request with the 'indefinite length' form. (Note: ISO ASN.1 allows indefinite length representations of data items; SNMP does not allow this)

3. Expected outcome

The expected outcome is for the agent to return noError or drop the packet and increment snmpInASNParseErrs.

4. Authority "referenced RFC"

Reference RFC 1157 4.1, 4.1.2, 4.1.3, 4.1.5
Here we see the Source code for the test that can be easily modified to create your own custom tests:

For users who do not wish to use a programming language, SilverCreek provides the SNMP Command Tcl Script Generator and the SNMP Automation Wizard for easy point and click creation and customization of SNMP tests.

Sample SilverCreek Test

###################################################################
 #
 # Copyright 1995 - 2009 by InterWorking Labs, Inc. All Rights Reserved
 #
 ###################################################################

 if {$snmpcontext(version) != "SNMPv1"} {
 snmptest_result_uninitiated $test "Context was not specified to be SNMPv1"
 return
 }

 ###################################################################test_pur
 #
 # 1.1.12.x The purpose of these tests is to make certain that v1 agents
 # handle message boundary conditions correctly.
 #
 # 1.1.12.5 This test issues a GET Request, a GET-NEXT request and a SET
 # Request using a non-zero error-status.
 #
 # The expected outcome for v1 agents is to return noError.
 #
 ####################################################################

 #
 # Ready a list of read-write variables to perform this test on
 #
 if {![info exists readwrite]} { readyReadWriteVars }

 set magic "nonzeroes"
 set ops [list NEXT GET SET]
 guilib::StatusMsg -mesg "This involves timeouts, so it may take a while.."

 #
 # Run this test on the first read-write variable found
 # Perform each of the following operations on the variable
 #
 set var [lindex $readwrite 0]
 set vBinds ""
 set iters 0
 foreach op $ops {
 #
 # Update progress of the test..
 #
 incr iters
 snmptest_remark $test "$iters of [llength $ops] iterations.."

 #
 # Get the list to perform the operation on
 #
 set obj $var
 if {$op == "SET"} {
 if {[GETglobal $test $var none eStatus eIndex vBinds]} { return }
 set obj $vBinds
 }

 #
 # Construct the cmd name and perform the operation
 #
 append op "global"
 if {[$op $test $obj $magic eStatus eIndex vBinds fullData]} {
 return
 }
 
 #
 # Check for correct error status from this operation
 #
 switch -- $eStatus {
 destroyed { return }
 noError {
 }
 default {
 snmptest_result_failed $test "" [rsp2text $eStatus $eIndex\
 $vBinds]
 return
 }
 }
 }

snmptest_result_passed $test "$iters iterations tested"


Using the SilverCreek Developer's Guide, we can review each of the parameters to understand how they are used in each test.

Summary


InterWorking Labs provides the Tcl source code with libraries, definitions, examples, and APIs with SilverCreek. If you prefer not to use the Tcl scripting language, you can automatically generate your own tests with our point and click tools. With SilverCreek, you truly get everything you need to inspect, modify, or customize your own SNMP tests, whether you are an experienced software engineer or a new Q/A tester.
 
Terms of Use  - Privacy Policy -  Trademarks
©2006 - 2009 InterWorking Labs, Inc. ALL RIGHTS RESERVED.
For more information, please contact InterWorking Labs.