344
Novell ZENworks Network Access Control Users Guide
no
vd
ocx
(e
n)
24
Ma
rch 20
09
Python 2.4.1 tutorial:
http://www.python.org/doc/2.4.1/tut/tut.html (http://www.python.org/
doc/2.4.1/tut/tut.html)
Python language reference:
http://www.python.org/doc/2.4.1/ (http://www.python.org/doc/
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
#
Содержание ZENworks Network Access Control 5.0
Страница 4: ...4 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 14: ...14 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 Glossary 525 ...
Страница 136: ...136 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 156: ...156 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 216: ...216 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 224: ...224 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 226: ...226 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 Figure 8 1 Inline Installations ...
Страница 227: ...High Availability and Load Balancing 227 novdocx en 24 March 2009 Figure 8 2 DHCP Installation ...
Страница 234: ...234 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 294: ...294 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 310: ...310 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 328: ...328 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 378: ...378 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 384: ...384 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 392: ...392 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 436: ...436 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 442: ...442 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 450: ...450 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 460: ...460 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 524: ...524 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...
Страница 534: ...534 Novell ZENworks Network Access Control Users Guide novdocx en 24 March 2009 ...