2 Library for the robot based system test tool of the OpenDaylight project.
3 Authors: Vaibhav Bhatnagar@Brocade
8 from robot.libraries.BuiltIn import BuiltIn
11 class CapwapLibrary(object):
12 """Provide many methods to simulate WTPs and their functions."""
15 self.builtin = BuiltIn()
17 def send_discover(self, ac_ip, wtp_ip='', ip='ip', port=5246):
18 """Send Discover CAPWAP Packet from a WTP."""
19 data = ''.join(chr(x) for x in [0x00, 0x20, 0x01, 0x02, 0x03, 0x04, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])
20 self.builtin.log('Sending Discover Packet to: %s' % ac_ip, 'DEBUG')
21 session = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
22 session.sendto(data, (ac_ip, port))
23 self.builtin.log('Packet Sent', 'DEBUG')
26 """Get Host IP Address."""
27 ip_addr = socket.gethostbyname(socket.gethostname())
30 def get_simulated_wtpip(self, controller):
31 """Get the Simulated WTP ip based on the controller."""
32 if controller == '127.0.0.1':
35 exp_ip = self.get_hostip()