Changing The Error Messages In A Test Script - Novell ZENWORKS NETWORK ACCESS CONTROL 5.0 - 09-22-2008 User Manual

Table of Contents

Advertisement

Python 2.4.1 tutorial:
doc/2.4.1/tut/tut.html)
Python language reference:
2.4.1/)
Sample test scripts are on the Novell ZENworks Network Access Control CD in the /
sampleScripts folder.

16.10.3 Changing the Error Messages in a Test Script

Using Python, try changing the error messages in an existing test script. This task can help you to
familiarize yourself with the Novell ZENworks Network Access Control scripting API. Each Novell
ZENworks Network Access Control test script defines a test class. To change an error message,
create a new script that derives a new test class from an existing test class and modify the return hash
of the runTest method.
For example, to change an error message:
1 Log in as root to the Novell ZENworks Network Access Control server using SSH.
2 Open the /sampleScripts/myCheckSoftwareNotAllowed.py file on the Novell
ZENworks Network Access Control CD in a text editor.
3 Examine the code. The comments explain each section of code. The following example shows
the contents of the file.
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
#
344 Novell ZENworks Network Access Control Users Guide
http://www.python.org/doc/2.4.1/tut/tut.html (http://www.python.org/
http://www.python.org/doc/2.4.1/ (http://www.python.org/doc/
#

Advertisement

Table of Contents
loading

This manual is also suitable for:

Zenworks network access control 5.0

Table of Contents