kytos-ng / kytos-end-to-end-tests

Kytos End-to-End Tests
0 stars 10 forks source link

`pytest.mark.skip` instead of `xfail` to avoid tracebacks on validations that aren't in place yet #224

Closed viniarck closed 1 year ago

viniarck commented 1 year ago

There are marked xfail tests testing invalid values of a range, which we want to cover, but flow_manager for instance, hasn't implemented complete API validation yet https://github.com/kytos-ng/flow_manager/issues/43, so these tests can result in tracebacks generating more noise in the tests logs, so we should skip them for now instead of xfail. Once it's in place then we can allow them to run again.

Examples of tracebcks, when a dl_vlan: -1 is sent:

Apr  7 05:19:20 runner-rmtk68xb-project-107-concurrent-0 2023-04-07 05:19:20,689 (Thread-111) kytos.napps.kytos/flow_manager:INFO main:603:  Send FlowMod from request dpid: 00:00:00:00:00:00:00:01, command: add, force: False, flows_dict: {'flows': [{'match': {'in_port': 1, 'dl_vlan': -1}, 'cookie': 12310717364402421068, 'actions': [{'action_type': 'set_vlan', 'vlan_id': 100}, {'action_type': 'push_vlan', 'tag_type': 's'}, {'action_type': 'set_vlan', 'vlan_id': 2}, {'action_type': 'output', 'port': 3}], 'priority': 20000}, {'match': {'in_port': 3, 'dl_vlan': 2}, 'cookie': 12310717364402421068, 'actions': [{'action_type': 'pop_vlan'}, {'action_type': 'output', 'port': 1}], 'priority': 20000}], 'force': False}
Apr  7 05:19:20 runner-rmtk68xb-project-107-concurrent-0 2023-04-07 05:19:20,690 (Thread-111) kytos.core.controller:ERROR app:1449:  Exception on /api/kytos/flow_manager/v2/flows/00:00:00:00:00:00:00:01 [POST]#012Traceback (most recent call last):#012  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 2073, in wsgi_app#012    response = self.full_dispatch_request()#012  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1519, in full_dispatch_request#012    rv = self.handle_user_exception(e)#012  File "/usr/local/lib/python3.9/dist-packages/flask_cors/extension.py", line 165, in wrapped_function#012    return cors_after_request(app.make_response(f(*args, **kwargs)))#012  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1517, in full_dispatch_request#012    rv = self.dispatch_request()#012  File "/usr/local/lib/python3.9/dist-packages/flask/app.py", line 1503, in dispatch_request#012    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)#012  File "//var/lib/kytos/napps/kytos/flow_manager/main.py", line 561, in add#012    return self._send_flow_mods_from_request(dpid, "add")#012  File "//var/lib/kytos/napps/kytos/flow_manager/main.py", line 624, in _send_flow_mods_from_request#012    self._install_flows(command, flows_dict, [switch], reraise_conn=not force)#012  File "//var/lib/kytos/napps/kytos/flow_manager/main.py", line 657, in _install_flows#012    flow_mod = build_flow_mod_from_command(flow, command)#012  File "//var/lib/kytos/napps/../napps/kytos/flow_manager/utils.py", line 46, in build_flow_mod_from_command#012    flow_mod = flow.as_of_add_flow_mod()#012  File "//var/lib/kytos/napps/../napps/kytos/of_core/flow.py", line 192, in as_of_add_flow_mod#012    return self._as_of_flow_mod(FlowModCommand.OFPFC_ADD)#012  File "//var/lib/kytos/napps/../napps/kytos/of_core/v0x04/flow.py", line 402, in _as_of_flow_mod#012    of_flow_mod = super()._as_of_flow_mod(command)#012  File "//var/lib/kytos/napps/../napps/kytos/of_core/flow.py", line 207, in _as_of_flow_mod#012    flow_mod.match = self.match.as_of_match()#012  File "//var/lib/kytos/napps/../napps/kytos/of_core/v0x04/flow.py", line 62, in as_of_match#012    tlv = field.as_of_tlv()#012  File "//var/lib/kytos/napps/../napps/kytos/of_core/v0x04/match_fields.py", line 49, in as_of_tlv#012    value_bytes = value.to_bytes(2, 'big')#012OverflowError: can't convert negative int to unsigned

Similarly, dl_vlan > 4095 will result in OverflowError: int too big to convert when of_core/pyof tries to serialize it.