HP 800 User Manual page 369

Network access controller
Hide thumbs Also See for 800:
Table of Contents

Advertisement

#
# All tests must define the runTest method with the self and the debug
# parameters.
#
def runTest(self,debug=0):
#
# All tests must call the initialize routine
#
self.initTest()
#
# Create a hash to store the return results.
# All tests must fill return a hash with the following keys:
#
#
status_code
successful
#
result_code
#
result_message - the message to display to the end-user
#
returnHash = {}
returnHash["status_code"] = 1
returnHash["result_code"] = "pass"
returnHash["result_message"] = "Some nice text that a user can read
here."
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)
Figure 13-5. testTemplate.py (cont.)
- 0 if an unexpected error occurred, 1 if
- pass, fail or some error
= sys.exc_type, sys.exc_value
System Administration
Adding Custom Tests
13-21

Advertisement

Table of Contents
loading

This manual is also suitable for:

Procurve nac 800

Table of Contents