X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=test%2Fcsit%2Flibraries%2FSwitchClasses%2FOvs.py;fp=test%2Fcsit%2Flibraries%2FSwitchClasses%2FOvs.py;h=0000000000000000000000000000000000000000;hb=23412e442bc8e1b8f3d27e233829cf106b6ad0b8;hp=58b13c4282fc0dac0edaf9d3afa1f907717517a0;hpb=732659be50eedc962e9cf09b09ac15e459523c7a;p=integration.git diff --git a/test/csit/libraries/SwitchClasses/Ovs.py b/test/csit/libraries/SwitchClasses/Ovs.py deleted file mode 100644 index 58b13c42..00000000 --- a/test/csit/libraries/SwitchClasses/Ovs.py +++ /dev/null @@ -1,101 +0,0 @@ -""" -Open vSwitch Object Definition -Authors: james.luhrsen@hp.com -Created: 2014-10-02 -""" -import re -from BaseSwitch import * # noqa - - -class Ovs(BaseSwitch): - ''' - OpenVswitch Class - ''' - - make = 'OpenVswitch' - model = 'OVS' - - mgmt_protocol = 'ssh' - mgmt_ip = '' - mgmt_port = '' - mgmt_user = 'mininet' - mgmt_password = 'mininet' - - mgmt_prompt = '>' - - initialization_type = 'cleanup' - - @property - def connection_configs(self): - return ['pwd'] - - @property - def cleanup_cmds(self): - return ['/sbin/ifconfig -a | egrep \'^s\' | awk \'{print \"sudo ovs-vsctl del-br\",$1}\' | sh'] - - @property - def initialization_cmds(self): - return [self.cleanup_cmds] - - @property - def base_openflow_config(self): - return ['sudo ovs-vsctl add-br s1', - 'sudo ovs-vsctl set bridge s1 protocols=OpenFlow13', - 'sudo ovs-vsctl set-controller s1 tcp:' + self.of_controller_ip, - 'sudo ifconfig s1 up'] - - @property - def openflow_validation_cmd(self): - return 'sudo ovs-vsctl show' - - @property - def openflow_enable_config(self): - return ['sudo ovs-vsctl set-controller s1 tcp:' + self.of_controller_ip] - - @property - def openflow_enable_validations(self): - return ['is_connected: true'] - - invalid_of_controller_ip = '1.1.1.1' - - @property - def openflow_disable_config(self): - return ['sudo ovs-vsctl set-controller s1 tcp:' + self.invalid_of_controller_ip] - - @property - def openflow_disable_validations(self): - return [] - - @property - def dump_all_flows(self): - return 'sudo /usr/bin/ovs-ofctl dump-flows s1 -O OpenFlow13' - - @property - def flow_validations(self): - return ['dl_src=' + self.src_mac + - ',dl_dst=' + self.dst_mac + - ',nw_src=' + self.ip_src + - ',nw_dst=' + self.ip_dst + - ' actions=' + self.action, - 'table=' + self.table_id] - - def create_flow_match_elements(self, flow_xml): - super(Ovs, self).create_flow_match_elements(flow_xml) - if (self.action == 'INPORT'): - self.action = 'IN_PORT' - - @property - def datapath_id_output_command(self): - '''This regex will extract the macaddr of the ovs switch''' - return '/sbin/ifconfig s1 | grep -o -E "([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}"' - - datapath_id_output_string = '' - datapath_id = '' - - def update_datapath_id(self): - if not self.datapath_id_output_string: - self.datapath_id = 'unknown' - else: - # 32:cc:bf:34:ed:4c - datapath_id_hex = re.sub(':', '', self.datapath_id_output_string) - self.datapath_id = self.convert_hex_to_decimal_as_string(datapath_id_hex)