I'm testing Peach 2.3.1 on a Ubuntu 9.04 linux box and I'd like to
create an HTTP server publisher starting from TcpListener. I've
created the following basic file httpserver.py in the folder
Peach_2.3.1/Peach/Publishers:
from tcp import TcpListener
class HttpServerBase(TcpListener):
def __init__(self, host, port, timeout = 0.25):
TcpListener.__init__(self,host,port,timeout)
I've modified the Server-Example.xml pit file with:
in order to use the new publisher but when I run peach, I get the
following error:
] Peach 2.3.1 DEV Runtime
] Copyright (c) Michael Eddington
Traceback (most recent call last):
File "peach.py", line 475, in <module>
engine.Run(args[0], None, verbose, watcher, restartFuzzerFile,
noCount, parallel, startNum)
File "/home/x/Devel/Peach_2.3.1/Peach/Engine/engine.py", line 397,
in Run
self.peach = Analyzer.DefaultParser().asParser(uri)
File "/home/x/Devel/Peach_2.3.1/Peach/Analyzers/pit.py", line 57, in
asParser
return parser.parse(uri)
File "/home/x/Devel/Peach_2.3.1/Peach/Engine/parser.py", line 159,
in parse
obj = self.HandleDocument(doc, uri)
File "/home/x/Devel/Peach_2.3.1/Peach/Engine/parser.py", line 362,
in HandleDocument
tests = self.HandleTest(child, None)
File "/home/x/Devel/Peach_2.3.1/Peach/Engine/parser.py", line 2244,
in HandleTest
test.publisher = self.HandlePublisher(child, test)
File "/home/x/Devel/Peach_2.3.1/Peach/Engine/parser.py", line 2580,
in HandlePublisher
pub = eval(code, globals(), locals())
File "<string>", line 1, in <module>
NameError: name 'PeachXml_httpserver' is not defined
Sounds like you haven't used <Import> to import your module with the new
code. I recommend keeping the file in the same folder as your pit. Then you can use <PythonPath> and <Import> to include the file for use.
> I'm testing Peach 2.3.1 on a Ubuntu 9.04 linux box and I'd like to
> create an HTTP server publisher starting from TcpListener. I've
> created the following basic file httpserver.py in the folder
> Peach_2.3.1/Peach/Publishers: