Add DAQClient and basic test to simulate access switch with device coupler#936
Add DAQClient and basic test to simulate access switch with device coupler#936anurag6 merged 35 commits intofaucetsdn:masterfrom
Conversation
…nected with a trunk port
| @@ -0,0 +1,9 @@ | |||
| #!/bin/bash -e | |||
There was a problem hiding this comment.
probably just "build_device_coupler" to keep it a bit more generic and also similar to other uses (so not dev)
| @@ -0,0 +1,15 @@ | |||
| #!/bin/bash -e | |||
There was a problem hiding this comment.
likewise: bin/start_device_coupler
| @@ -0,0 +1,18 @@ | |||
| { | |||
There was a problem hiding this comment.
What's this for? The coupler should be a drop-in functional replacement for other switch implementations... why a separate setup config?
There was a problem hiding this comment.
Just something I am using to test for now. Will get rid of it.
Codecov Report
@@ Coverage Diff @@
## master #936 +/- ##
==========================================
- Coverage 82.53% 82.47% -0.07%
==========================================
Files 45 45
Lines 5693 5701 +8
==========================================
+ Hits 4699 4702 +3
- Misses 994 999 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
device_coupler/daq_client.py
Outdated
| @@ -0,0 +1,121 @@ | |||
| """Server to handle incoming session requests""" | |||
There was a problem hiding this comment.
I think the comment isn't updated.
grafnu
left a comment
There was a problem hiding this comment.
Also, how is this being tested (or is it) in CI? I don't see any testing changes so I'm assuming there's something missing there as well...
Added a CI test |
| @@ -0,0 +1,9 @@ | |||
| #!/bin/bash -e | |||
There was a problem hiding this comment.
Should we have everything separate from the existing daq images build, testing, logging etc?
There was a problem hiding this comment.
The idea I am going for is a separate entity that can be integrated easily enough into DAQ. The logging can be merged fairly easily by using daq.utils instead. For now the idea is to get a test_device_coupler running separately like test_shunt that successfully runs the tests in test_aux and gets the same results. The config, logging and testing merging with DAQ is the next step
| device = self._devices.create_if_absent(request.device_mac) | ||
| device.port.flapping_start = None # In case this was set from last disconnect. | ||
| device.dhcp_mode = DhcpMode.EXTERNAL | ||
| device.dhcp_mode = DhcpMode.EXTERNAL if request.assigned_vlan else DhcpMode.NORMAL |
There was a problem hiding this comment.
I think it's probably worthwhile to leave a comment here.
daq/topology.py
Outdated
| acls[self.INCOMING_ACL_FORMAT % self.sec_name] = secondary_acl | ||
|
|
||
| acls[self.INCOMING_ACL_FORMAT % 'vxlan'] = [self._make_acl_rule(ports=[1])] | ||
| acls[self.INCOMING_ACL_FORMAT % 'vxlan_coupler'] = [ |
There was a problem hiding this comment.
maybe vxlan and vxlan_coupler can be converted to constants here
device_coupler/daq_client.py
Outdated
| CONNECT_TIMEOUT_SEC = 60 | ||
|
|
||
|
|
||
| # pylint: disable=too-many-arguments |
There was a problem hiding this comment.
Is this disable still necessary?
device_coupler/ovs_helper.py
Outdated
|
|
||
| def create_vxlan_endpoint(self, port, remote_ip, vni, local_ip=None): | ||
| def _set_interface_up(self, interface, no_raise=False): | ||
| if no_raise: |
There was a problem hiding this comment.
This can be simplified to
fn = self. _run_shell_no_raise if no_raise else self. _run_shell
fn('sudo ip link set %s up' % interface)
There was a problem hiding this comment.
Also no_raise with default False can also be simplified to raise=True
| iface = "faux-%s" % index | ||
| ovs_helper.add_iface_to_bridge(bridge, iface) | ||
| ovs_helper.set_native_vlan(iface, 200 + index * 10) | ||
| ovs_helper.set_native_vlan(iface, 200 + (index % 3) * 10) |
There was a problem hiding this comment.
Remnant from prev testing. Removed.
No description provided.