2 Provision 3800 Object Definition
3 Authors: james.luhrsen@hp.com
9 from robot.libraries.BuiltIn import BuiltIn
10 from BaseSwitch import *
12 class H3C(BaseSwitch):
20 mgmt_protocol = 'telnet'
23 mgmt_prompt = '(' + model + '.*>|' + model + '.*])'
26 initialization_type = 'reboot'
32 def connection_configs(self):
37 def initialization_cmds(self):
39 ['\rstartup saved-configuration odl_test_startup_config.cfg main\r', \
47 def cleanup_cmds(self):
50 'undo openflow instance ' + self.of_instance_id, \
54 def base_openflow_config(self):
57 'openflow instance ' + self.of_instance_id, \
58 'classification vlan 1', \
59 'controller ' + self.of_instance_id + ' address ip ' + self.of_controller_ip, \
64 def openflow_enable_config(self):
67 'openflow instance ' + self.of_instance_id, \
68 'classification vlan 1', \
73 def openflow_validation_cmd(self):
75 'display openflow summary'
78 def openflow_enable_validations(self):
80 [self.of_instance_id + ' +Active', \
84 def openflow_disable_config(self):
87 'openflow instance ' + self.of_instance_id, \
88 'undo classification', \
93 def openflow_disable_validations(self):
95 [self.of_instance_id + ' +Inactive - +- +- +- +-']
98 def dump_all_flows(self):
103 def datapath_id_output_command(self):
105 'display openflow summary | include 0x'
107 datapath_id_output_string = ''
110 def update_datapath_id(self):
111 if not self.datapath_id_output_string:
112 self.datapath_id = 'unknown'
114 #21 Active 0x0015cc3e5f42ad23 Connected 1 24 N
115 #|---------------------------------(0)---------------------------------|
116 #|------(1)-------||------(2)-----|
117 matches = re.search('(.*0x)(\w+) +Connected', self.datapath_id_output_string)
118 datapath_id_hex = matches.group(2)
119 self.datapath_id = self.convert_hex_to_decimal_as_string(datapath_id_hex)