Extreme Networks Sentriant AG Software User's Manual page 329

Hide thumbs Also See for Sentriant AG:
Table of Contents

Advertisement

Figure 179: testTemplate.py (continued)
try:
#
# Replace 'pass' with your test here. Modify the returnHash
accordingly.
#
pass
except:
#
# Set the return status when exception occurs
#
import sys
returnHash['status_code'] = 0
returnHash['result_code'] = "unknown_error"
returnHash['result_message']
return(returnHash)
#
# Always use the doReturn function; this allows superclass to add or
modify
# any items in the returnHash as necessary.
#
return(self.doReturn(returnHash))
1 Use the template, as shown in
script is called
checkOpenPorts.py,
host being tested. Before examining the code, consider the following information about the test
scripts:
All test scripts contain a
through the policy properties HTML. For example, if the
to:
<input id="myparam" name="myparam" value="">
Then, the self
inputParams
element set in the policy editor.
All test scripts contain a
class is instantiated. It contains a reference to a Session object, which is a built-in Python class
defined by Sentriant AG and is used internally by the
section. However, to retrieve the host name or IP address, use
self.session.host()
when developing scripts.
Sentriant AG Software Users Guide, Version 5.3
= sys.exc_type, sys.exc_value
Figure
179, to create a new test script. As an example, the new test
and it fails if any of the specified ports are open on the target
hash table that has all input parameters configured
self.inputParams
contains a
key that is set to the value of the HTML input
myparams
member variable that is set by Sentriant AG when the test
self.session
System Administration
variable for the test is set
testConfig
class described later in this
BasicTests
method:
host()
329

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sentriant ag 5.3

Table of Contents