Figure 177: Test Script Code - Extreme Networks Sentriant AG Software User's Manual

Hide thumbs Also See for Sentriant AG:
Table of Contents

Advertisement

3 Examine the code. The comments explain each section of code. The following example shows the
contents of the file.

Figure 177: Test Script Code

#!/usr/bin/python
from checkSoftwareNotAllowed import CheckSoftwareNotAllowed
#
# This allows a script to be tested from the command line.
#
if __name__ == '__main__':
import myCheckSoftwareNotAllowed
t = myCheckSoftwareNotAllowed.MyCheckSoftwareNotAllowed()
t.processCommandLine()
#
# The class definition. MyCheckSofwareNotAllowed is derived
# from the existing test CheckSoftwareNotAllowed and inherits
# all the existing tests functionality.
#
class MyCheckSoftwareNotAllowed(CheckSoftwareNotAllowed):
#
# Override the testId to be unique from all other test ids
#
testId = "MyCheckSoftwareNotAllowed"
#
# Rename your derived test
#
testName = "My check software not allowed"
#
# All test classes must define the runTest method with the self and
debug
# parameters
#
def runTest(self,debug=0):
#
# Get the result hash from the CheckSoftwareNotAllowed test
# and modify the result message based on the result code.
#
result = CheckSoftwareNotAllowed.runTest(self,debug)
if result["result_code"] == "fail":
result["result_message"] = "The MyCheckSoftwareNotAllowed test
failed."
elif result["result_code"] == "pass":
result["result_message"] = "The MyCheckSoftwareNotAllowed test
passed."
return result
Sentriant AG Software Users Guide, Version 5.3
System Administration
323

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sentriant ag 5.3

Table of Contents