glaciation package

Subpackages

Submodules

glaciation.helper module

class glaciation.helper.SSHHelper(host, user, key=None, pwd='', port=22, disAlgorithms=None, timeout=3)[source]

Bases: object

SSH Helper to run shh commands easily in remote devices

Parameters:
  • host (string) – host address

  • user (string) – username

  • key (string) – user private key path (default is None)

  • pwd (string) – password (default is None)

  • port (int) – port number for the ssh connection (default is 22)

  • disAlgorithms (string) – If given, must be a dictionary mapping algorithm type to an iterable of algorithm identifiers, which will be disabled for the lifetime of the transport.  Example for TSW: dict(pubkeys=[‘rsa-sha2-256’, ‘rsa-sha2-512’]) (default is None)

Raises:

Exception – Error in connection

close()[source]

Close SSH connection

runCommand(command)[source]

Runs a command in the previously connected device

Parameters:

command (string) – command to be executed

Returns:

Command outputs

Return type:

outputs

glaciation.helper.mainTest(func)[source]

Decorator for main test function It will wrap the main test script like this:

Try:
tgf.initTest() # log in a file the start of the test
mainScript # execute main script
tgf.finishTestOk() # log in a file execution SUCCESS
except Exception as e:
print(traceback.format_exc()) # print traceback
tgf.finishTestNotOK(str(e)) # log in a file execution FAILED
exit(-1)
glaciation.helper.measureTime(func)[source]

Decorator function to measure and print out time spend in execution in the given function

glaciation.networking module

glaciation.networking.checkPortIsOpen(ip, port)[source]

Check if port is open in given address

Parameters:
  • ip (string) – ip address

  • port (int) – port number

Returns:

outputs – True if port is open else False

Return type:

bool

glaciation.networking.insert_packets(packets_per_second, src_ip, multicast_ip)[source]

Starts iperf process in a different thread to inject packets in the network

Parameters:
  • packets_per_second (int) – Number of packet per seconds to be injected

  • src_ip (string) – source ip address

  • multicast_ip (string) – multicast ip address of the injected packets

glaciation.networking.stop_inserting()[source]

Stops all iperf processes of injecting packets

glaciation.snmp module

glaciation.snmp.cast(value)[source]
glaciation.snmp.construct_object_types(list_of_oids)[source]
glaciation.snmp.construct_value_pairs(list_of_pairs)[source]
glaciation.snmp.fetch(handler, count)[source]
glaciation.snmp.get(target, oids, credentials, port=161, engine=SnmpEngine(snmpEngineID=<SnmpEngineID value object, tagSet <TagSet object, tags 0:0:4>, subtypeSpec <ConstraintsIntersection object, consts <ValueSizeConstraint object, consts 0, 65535>, <ValueSizeConstraint object, consts 5, 32>>, encoding iso-8859-1, payload [0x80004fb8054cf80bc8]>), context=ContextData(contextEngineId=None, contextName=b''))[source]
glaciation.snmp.get_bulk(target, oids, credentials, count, start_from=0, port=161, engine=SnmpEngine(snmpEngineID=<SnmpEngineID value object, tagSet <TagSet object, tags 0:0:4>, subtypeSpec <ConstraintsIntersection object, consts <ValueSizeConstraint object, consts 0, 65535>, <ValueSizeConstraint object, consts 5, 32>>, encoding iso-8859-1, payload [0x80004fb8054cf845e8]>), context=ContextData(contextEngineId=None, contextName=b''))[source]
glaciation.snmp.get_bulk_auto(target, oids, credentials, count_oid, start_from=0, port=161, engine=SnmpEngine(snmpEngineID=<SnmpEngineID value object, tagSet <TagSet object, tags 0:0:4>, subtypeSpec <ConstraintsIntersection object, consts <ValueSizeConstraint object, consts 0, 65535>, <ValueSizeConstraint object, consts 5, 32>>, encoding iso-8859-1, payload [0x80004fb8054cf88088]>), context=ContextData(contextEngineId=None, contextName=b''))[source]
glaciation.snmp.set(target, value_pairs, credentials, port=161, engine=SnmpEngine(snmpEngineID=<SnmpEngineID value object, tagSet <TagSet object, tags 0:0:4>, subtypeSpec <ConstraintsIntersection object, consts <ValueSizeConstraint object, consts 0, 65535>, <ValueSizeConstraint object, consts 5, 32>>, encoding iso-8859-1, payload [0x80004fb8054cf84bc8]>), context=ContextData(contextEngineId=None, contextName=b''))[source]

Module contents