Fwtester libraries
Submodules
lib.argument module
- class lib.argument.argument(name, default_value, help_string, logger, required=False)
Bases:
object
lib.argumentparser module
lib.config module
lib.datastorage module
lib.datastoragecsv module
- class lib.datastoragecsv.datastoragecsv(logger)
Bases:
lib.datastorageinterface.datastorageinterfaceClass to manage data storage of type csv
- add_row(row, table)
Adds a row of data to the data storage
- add_rows(rows, table, truncate=False)
Adds some rows of data to the data storage
- get_rows(table, num_of_rows=None, offset=0, headers_in_file=True)
@get_rows: read csv lines from a file and retun them as a tupple
lib.datastorageinterface module
- class lib.datastorageinterface.datastorageinterface
Bases:
objectInterface class for subclasses which manage storage of data
- abstract add_row(data=[])
Adds a row of data to the data storage
- add_rows(data=[])
Adds some rows of data to the data storage
- abstract get_row(number=0)
Gets a row of data from the data storage
- abstract get_rows(num_of_rows=None, offset=0)
Gets some rows of data from the data storage
lib.datastoragemongodb module
- class lib.datastoragemongodb.datastoragemongodb(database, logger)
Bases:
lib.datastorageinterface.datastorageinterfaceClass to manage data storage of type MongoDB
- add_row(row, table)
Adds a row of data to the data storage
- add_rows(rows, table)
Adds some rows of data to the data storage
- get_rows(table, num_of_rows=None, offset=0)
@get_rows: read documents from a collection in MongoDB database
lib.datastoragesqlite module
- class lib.datastoragesqlite.datastoragesqlite(database, logger)
Bases:
lib.datastorageinterface.datastorageinterfaceClass to manage data storage of type database
- add_row(row, table)
Adds a row of data to the data storage
- add_rows(rows, table)
Adds some rows of data to the data storage
- get_rows(table, num_of_rows=None, offset=0)
@get_rows: read rows from a table in SQLite database
lib.logger module
- class lib.logger.logger(log_path, file_level=10, console_level=40, log_format='%(asctime)s:%(name)s:%(levelname)s:%(message)s', debug_level=0)
Bases:
objectClass responsible of logging features for the code
- debug(message, message_level=0)
- error(message)
- info(message)
- logbegin(function)
Writes the beginning of a function to log
- logend(function)
Writes the end of a function to log
- warning(message)
lib.network module
- class lib.network.network(logger)
Bases:
objectClass used to manage TCP/IP operations: -IP network and address -TCP/UPD Ports
- get_address(address, fw_nics, fw_routes, nic='', search_domains=None)
- get_default_route(routes)
- get_mask(network)
- get_mask_cidr(network)
- get_network_address(network)
- get_port(port, protocol='tcp')
- getprotocolname(protocol)
- is_fqdn(address, search_domains)
- is_host(address)
- is_in_network(ip, network)
- is_network(address)
- is_subnet(network1, network2)
lib.report module
lib.reportcsv module
- class lib.reportcsv.reportcsv(logger)
Bases:
lib.reportinterface.reportinterface- add_section(section_name, section_headers, section_data)
- del_section()
- generate(report_name)
lib.reporthtml module
- class lib.reporthtml.reporthtml