kitty.model.high_level.base module

class kitty.model.high_level.base.BaseModel(name='BaseModel')[source]

Bases: kitty.core.kitty_object.KittyObject

This class defines the API that is required to be implemented by any top- level model

Note

This class should not be instantiated directly.

__init__(name='BaseModel')[source]
Parameters:name – name of the model (default: BaseModel)
current_index()[source]
Returns:current mutation index
get_model_info()[source]
Return type:dict
Returns:model information
get_sequence()[source]
Return type:[Connection]
Returns:Sequence of current case
get_sequence_str()[source]
Returns:string representation of the sequence
get_stages()[source]
Returns:dictionary of information regarding the stages in the fuzzing session

Note

structure: { current: [‘stage1’, ‘stage2’, ‘stage3’], ‘stages’: {‘source1’: [‘dest1’, ‘dest2’], ‘source2’: [‘dest1’, ‘dest3’]}}

get_template_info()[source]
Returns:dictionary of information regarding the current template

Note

by default, we return None, as the current template might not be interesting. Take a look at GraphModel for actual implementation.

get_test_info()[source]
Return type:dict
Returns:test information
hash()[source]
Returns:a hash of the model object (used for notifying change in the model)
last_index()[source]
Returns:the last valid mutation index
mutate()[source]

Mutate to next state

Returns:True if mutated, False if not
num_mutations()[source]
Returns:number of mutations in the model
set_notification_handler(handler)[source]
Parameters:handler – handler for notifications from the data model

Note

The handler should support the following APIs:

  • handle_stage_changed(data_model)
skip(count)[source]
Parameters:count – number of cases to skip
Returns:number of cases skipped
class kitty.model.high_level.base.Connection(src, dst, callback)[source]

Bases: object

A connection between to messages,

__init__(src, dst, callback)[source]
Parameters:
  • src – the source node
  • dst – the destination node
  • callback – the function to call after sending src and before sending dst