![Novell ZENworks Network Access Control 5.0 Скачать руководство пользователя страница 350](http://html1.mh-extra.com/html/novell/zenworks-network-access-control-5-0/zenworks-network-access-control-5-0_user-manual_1711968350.webp)
350
Novell ZENworks Network Access Control Users Guide
no
vd
ocx
(e
n)
24
Ma
rch 20
09
#
# 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']
= sys.exc_type, sys.exc_value
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
“testTemplate.py” on page 348
, to create a new test script. As an
example, the new test script is called
checkOpenPorts.py,
and it fails if any of the
specified ports are open on the target host being tested. Before examining the code, consider
the following information about the test scripts:
All test scripts contain a
self.inputParams
hash table that has all input parameters
configured through the policy properties HTML. For example, if the
testConfig
variable for the test is set to:
<input id="myparam" name="myparam" value="">
Then, the self
inputParams
contains a
myparams
key that is set to the value of the
HTML input element set in the policy editor.
All test scripts contain a
self.session
member variable that is set by Novell
ZENworks Network Access Control when the test class is instantiated. It contains a
reference to a Session object, which is a built-in Python class defined by Novell
ZENworks Network Access Control and is used internally by the
BasicTests
class
described later in this section. However, to retrieve the host name or IP address, use
host()
method:
self.session.host()
when developing scripts.
All tests contain a reference to the
BasicTests
class called
self.bt
. The
self.bt
class gives you access to commonly used functions for testing endpoints including registry
operations and service operations. See
Section 16.10.5, “BasicTests API,” on page 356
for
more information on the
BasicTests
API. This example does not use this API.
2
“checkOpenPorts.py script” on page 351
shows the code for the new
checkOpenPorts.py
test. The file is included on the Novell ZENworks Network Access Control CD as
/
sampleScripts/checkOpenPorts.py
. Review the code. The comments explain each
section of the code.
Содержание 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 ...