System Administration
Adding Custom Tests
#!/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"
Figure 13-3. Test Script Code
13-14
1.
Log in as root to the NAC 800 server using SSH.
2.
Open the /sampleTests/myCheckSoftwareNotAllowed.py file on
the NAC 800 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.