Package FuzzManager :: Package Collector :: Module Collector :: Class Collector
[hide private]
[frames] | no frames]

Class Collector

source code

Instance Methods [hide private]
 
__init__(self, sigCacheDir=None, serverHost=None, serverPort=None, serverProtocol=None, serverAuthToken=None, clientId=None, tool=None)
Initialize the Collector.
source code
 
refresh(self, *args, **kwargs)
Refresh signatures by contacting the server, downloading new signatures and invalidating old ones.
source code
 
refreshFromZip(self, *args, **kwargs)
Refresh signatures from a local zip file, adding new signatures and invalidating old ones.
source code
 
submit(self, *args, **kwargs)
Submit the given crash information and an optional testcase/metadata to the server for processing and storage.
source code
tuple
search(self, *args, **kwargs)
Searches within the local signature cache directory for a signature matching the given crash.
source code
string
generate(self, *args, **kwargs)
Generates a signature in the local cache directory.
source code
tuple
download(self, *args, **kwargs)
Download the testcase for the specified crashId.
source code
string
__store_signature_hashed(self, signature)
Store a signature, using the sha1 hash hex representation as filename.
source code
Static Methods [hide private]
 
__serverError(response) source code
tuple(string, bool)
read_testcase(testCase)
Read a testcase file, return the content and indicate if it is binary or not.
source code
Method Details [hide private]

__init__(self, sigCacheDir=None, serverHost=None, serverPort=None, serverProtocol=None, serverAuthToken=None, clientId=None, tool=None)
(Constructor)

source code 

Initialize the Collector. This constructor will also attempt to read a configuration file to populate any missing properties that have not been passed to this constructor.

Parameters:
  • sigCacheDir (string) - Directory to be used for caching signatures
  • serverHost (string) - Server host to contact for refreshing signatures
  • serverPort (int) - Server port to use when contacting server
  • serverAuthToken (string) - Token for server authentication
  • clientId (string) - Client ID stored in the server when submitting issues
  • tool (string) - Name of the tool that found this issue

refresh(self, *args, **kwargs)

source code 

Refresh signatures by contacting the server, downloading new signatures and invalidating old ones.

Decorators:
  • @remote_checks
  • @signature_checks

refreshFromZip(self, *args, **kwargs)

source code 

Refresh signatures from a local zip file, adding new signatures and invalidating old ones. (This is a non-standard use case; you probably want to use refresh() instead.)

Decorators:
  • @signature_checks

submit(self, *args, **kwargs)

source code 

Submit the given crash information and an optional testcase/metadata to the server for processing and storage.

Parameters:
  • crashInfo (CrashInfo) - CrashInfo instance obtained from CrashInfo.fromRawCrashData
  • testCase (string) - A file containing a testcase for reproduction
  • testCaseQuality (int) - A value indicating the quality of the test (less is better)
  • metaData (map) - A map containing arbitrary (application-specific) data which will be stored on the server in JSON format. This metadata is combined with possible metadata stored in the ProgramConfiguration inside crashInfo.
Decorators:
  • @remote_checks

search(self, *args, **kwargs)

source code 

Searches within the local signature cache directory for a signature matching the given crash.

Parameters:
  • crashInfo (CrashInfo) - CrashInfo instance obtained from CrashInfo.fromRawCrashData
Returns: tuple
Tuple containing filename of the signature and metadata matching, or None if no match.
Decorators:
  • @signature_checks

generate(self, *args, **kwargs)

source code 

Generates a signature in the local cache directory. It will be deleted when refresh is called on the same local cache directory.

Parameters:
  • crashInfo (CrashInfo) - CrashInfo instance obtained from CrashInfo.fromRawCrashData
  • forceCrashAddress (bool) - Force including the crash address into the signature
  • forceCrashInstruction (bool) - Force including the crash instruction into the signature (GDB only)
  • numFrames (int) - How many frames to include in the signature
Returns: string
File containing crash signature in JSON format
Decorators:
  • @signature_checks

download(self, *args, **kwargs)

source code 

Download the testcase for the specified crashId.

Parameters:
  • crashId (int) - ID of the requested crash entry on the server side
Returns: tuple
Tuple containing name of the file where the test was stored and the raw JSON response
Decorators:
  • @remote_checks

__store_signature_hashed(self, signature)

source code 

Store a signature, using the sha1 hash hex representation as filename.

Parameters:
  • signature (CrashSignature) - CrashSignature to store
Returns: string
Name of the file that the signature was written to

read_testcase(testCase)
Static Method

source code 

Read a testcase file, return the content and indicate if it is binary or not.

Parameters:
  • testCase (string) - Filename of the file to open
Returns: tuple(string, bool)
Tuple containing the file contents and a boolean indicating if the content is binary