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

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

e2e tests failed on April 5 #221

Closed viniarck closed 1 year ago

viniarck commented 1 year ago

The following e2e tests failed on April 5.

Most seem related to the fact that https://github.com/kytos-ng/sdntrace_cp/pull/85 hasn't landed but its e2e tests did. @gretelliz can you double check it and make sure that it won't fail on today's nightly execution? Thanks.

=================================== FAILURES ===================================
____________ TestE2ESDNTrace.test_080_validate_attribute_on_payload ____________
self = <tests.test_e2e_40_sdntrace.TestE2ESDNTrace object at 0x7f56d4f0edf0>
    def test_080_validate_attribute_on_payload(self):
        "Validate parameters"

        # Mandatory parameter missing (in_port):
        payload = [
                    {
                        "trace": {
                            "switch": {
                                "dpid": "00:00:00:00:00:00:00:01"
                            },
                            "eth": {
                                "dl_vlan": 10
                            }
                        }
                    }               ]

        api_url = KYTOS_API + '/amlight/sdntrace_cp/traces'
        response = requests.put(api_url, json=payload)
>       assert response.status_code == 400, response.text
E       AssertionError: {"result":[[]]}
E         
E       assert 200 == 400
E        +  where 200 = <Response [200]>.status_code
tests/test_e2e_40_sdntrace.py:849: AssertionError
=============================== warnings summary ===============================
../../../../usr/local/lib/python3.9/dist-packages/kytos/core/config.py:186
  /usr/local/lib/python3.9/dist-packages/kytos/core/config.py:186: UserWarning: Unknown arguments: ['tests/', '--reruns', '2', '-r', 'fEr']
    warnings.warn(f"Unknown arguments: {unknown}")
tests/test_e2e_01_kytos_startup.py: 17 warnings
tests/test_e2e_05_topology.py: 17 warnings
  /usr/lib/python3/dist-packages/mininet/node.py:1122: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
    StrictVersion( '1.10' ) )
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
------------------------------- start/stop times -------------------------------
rerun: 0
tests/test_e2e_20_flow_manager.py::TestE2EFlowManager::test_060_flow_another_table: 2023-04-05,06:01:18.047722 - 2023-04-05,06:01:32.739642
self = <tests.test_e2e_20_flow_manager.TestE2EFlowManager object at 0x7f56d56cd040>
    def test_060_flow_another_table(self):
>       self.flow_another_table()
tests/test_e2e_20_flow_manager.py:904: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <tests.test_e2e_20_flow_manager.TestE2EFlowManager object at 0x7f56d56cd040>
restart_kytos = False
    def flow_another_table(self, restart_kytos=False):
        """Tests if, after adding a flow in another
        table outside kytos, the flow is removed."""

        s1 = self.net.net.get('s1')
        s1.dpctl('add-flow', 'table=2,in_port=1,actions=output:2')
        if restart_kytos:
            # restart controller keeping configuration
            self.net.start_controller(enable_all=True)
            self.net.wait_switches_connect()
        else:
            self.net.reconnect_switches()

        time.sleep(10)

        s1 = self.net.net.get('s1')
        flows_s1 = s1.dpctl('dump-flows')
>       assert len(flows_s1.split('\r\n ')) == BASIC_FLOWS, flows_s1
E       AssertionError:  cookie=0xac00000000000001, duration=25.092s, table=0, n_packets=0, n_bytes=0, priority=50000,dl_src=ee:ee:ee:ee:ee:02 actions=CONTROLLER:65535
E          cookie=0xac00000000000001, duration=25s, table=0, n_packets=0, n_bytes=0, priority=50000,dl_src=ee:ee:ee:ee:ee:03 actions=CONTROLLER:65535
E          cookie=0xab00000000000001, duration=13.802s, table=0, n_packets=17, n_bytes=714, priority=1000,dl_vlan=[379](https://gitlab.ampath.net/kytos/kytos-end-to-end-tester/-/jobs/42559#L379)9,dl_type=0x88cc actions=CONTROLLER:65535
E          cookie=0x0, duration=14.669s, table=2, n_packets=0, n_bytes=0, in_port="s1-eth1" actions=output:"s1-eth2"
E         
E       assert 4 == 3
E        +  where 4 = len([' cookie=0xac00000000000001, duration=25.092s, table=0, n_packets=0, n_bytes=0, priority=50000,dl_src=ee:ee:ee:ee:ee:...5535', 'cookie=0x0, duration=14.669s, table=2, n_packets=0, n_bytes=0, in_port="s1-eth1" actions=output:"s1-eth2"\r\n'])
E        +    where [' cookie=0xac00000000000001, duration=25.092s, table=0, n_packets=0, n_bytes=0, priority=50000,dl_src=ee:ee:ee:ee:ee:...5535', 'cookie=0x0, duration=14.669s, table=2, n_packets=0, n_bytes=0, in_port="s1-eth1" actions=output:"s1-eth2"\r\n'] = <built-in method split of str object at 0x7f56b40285d0>('\r\n ')
E        +      where <built-in method split of str object at 0x7f56b40285d0> = ' cookie=0xac00000000000001, duration=25.092s, table=0, n_packets=0, n_bytes=0, priority=50000,dl_src=ee:ee:ee:ee:ee:0...5535\r\n cookie=0x0, duration=14.669s, table=2, n_packets=0, n_bytes=0, in_port="s1-eth1" actions=output:"s1-eth2"\r\n'.split
tests/test_e2e_20_flow_manager.py:901: AssertionError
rerun: 0
tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_080_validate_attribute_on_payload: 2023-04-05,06:45:02.488472 - 2023-04-05,06:45:02.514223
self = <tests.test_e2e_40_sdntrace.TestE2ESDNTrace object at 0x7f56d4f0edf0>
    def test_080_validate_attribute_on_payload(self):
        "Validate parameters"

        # Mandatory parameter missing (in_port):
        payload = [
                    {
                        "trace": {
                            "switch": {
                                "dpid": "00:00:00:00:00:00:00:01"
                            },
                            "eth": {
                                "dl_vlan": 10
                            }
                        }
                    }               ]

        api_url = KYTOS_API + '/amlight/sdntrace_cp/traces'
        response = requests.put(api_url, json=payload)
>       assert response.status_code == [400](https://gitlab.ampath.net/kytos/kytos-end-to-end-tester/-/jobs/42559#L400), response.text
E       AssertionError: {"result":[[]]}
E         
E       assert 200 == 400
E        +  where 200 = <Response [200]>.status_code
tests/test_e2e_40_sdntrace.py:849: AssertionError
rerun: 1
tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_080_validate_attribute_on_payload: 2023-04-05,06:46:11.645154 - 2023-04-05,06:46:11.692036
self = <tests.test_e2e_40_sdntrace.TestE2ESDNTrace object at 0x7f56d4f0edf0>
    def test_080_validate_attribute_on_payload(self):
        "Validate parameters"

        # Mandatory parameter missing (in_port):
        payload = [
                    {
                        "trace": {
                            "switch": {
                                "dpid": "00:00:00:00:00:00:00:01"
                            },
                            "eth": {
                                "dl_vlan": 10
                            }
                        }
                    }               ]

        api_url = KYTOS_API + '/amlight/sdntrace_cp/traces'
        response = requests.put(api_url, json=payload)
>       assert response.status_code == 400, response.text
E       AssertionError: {"result":[[]]}
E         
E       assert 200 == 400
E        +  where 200 = <Response [200]>.status_code
tests/test_e2e_40_sdntrace.py:849: AssertionError
tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_080_validate_attribute_on_payload: 2023-04-05,06:47:22.488853 - 2023-04-05,06:47:22.675581
=========================== rerun test summary info ============================
RERUN tests/test_e2e_20_flow_manager.py::TestE2EFlowManager::test_060_flow_another_table
RERUN tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_080_validate_attribute_on_payload
RERUN tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_080_validate_attribute_on_payload
=========================== short test summary info ============================
FAILED tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_080_validate_attribute_on_payload - AssertionError: {"result":[[]]}
gretelliz commented 1 year ago

@viniarck, PR_85 is now merged. So, this test shouldn't fail again.

viniarck commented 1 year ago

@viniarck, PR_85 is now merged. So, this test shouldn't fail again.

Right. Appreciated your help. Please, keep an eye on the tests and if after today's execution it's passing you can close this issue.

viniarck commented 1 year ago

@gretelliz, e2e tests are still failing can you fix the errors?

tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_070_run_sdntrace_untagged_vlan: 2023-04-06,06:44:55.816490 - 2023-04-06,06:44:57.836634
cls = <tests.test_e2e_40_sdntrace.TestE2ESDNTrace object at 0x7fb08a90b430>
    def test_070_run_sdntrace_untagged_vlan(cls):
        """Run SDNTrace to test /traces endpoint when vlan is untagged in evc"""

        cls.create_evc("untagged")
        payload = [
                    {
                        "trace": {
                            "switch": {
                                "dpid": "00:00:00:00:00:00:00:01",
                                "in_port": 1
                            }
                        }
                    }
        ]

        api_url = KYTOS_API + '/amlight/sdntrace_cp/traces'
        response = requests.put(api_url, json=payload)
>       assert response.status_code == 200, response.text
E       AssertionError: {"code":500,"description":"The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.","name":"Internal Server Error"}
E         
E       assert 500 == 200
E        +  where 500 = <Response [500]>.status_code
tests/test_e2e_40_sdntrace.py:793: AssertionError
rerun: 1
tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_070_run_sdntrace_untagged_vlan: 2023-04-06,06:44:57.889713 - 2023-04-06,06:44:57.955504
cls = <tests.test_e2e_40_sdntrace.TestE2ESDNTrace object at 0x7fb08a90b430>
    def test_070_run_sdntrace_untagged_vlan(cls):
        """Run SDNTrace to test /traces endpoint when vlan is untagged in evc"""

>       cls.create_evc("untagged")
tests/test_e2e_40_sdntrace.py:779: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
vlan_id = 'untagged', interface_a = '00:00:00:00:00:00:00:01:1'
interface_z = '00:00:00:00:00:00:00:0a:1'
    @staticmethod
    def create_evc(vlan_id, interface_a="00:00:00:00:00:00:00:01:1", interface_z="00:00:00:00:00:00:00:0a:1"):
        payload = {
            "name": "Vlan_%s" % vlan_id,
            "enabled": True,
            "dynamic_backup_path": True,
            "uni_a": {
                "interface_id": interface_a,
                "tag": {"tag_type": 1, "value": vlan_id}
            },
            "uni_z": {
                "interface_id": interface_z,
                "tag": {"tag_type": 1, "value": vlan_id}
            }
        }
        api_url = KYTOS_API + '/kytos/mef_eline/v2/evc/'
        response = requests.post(api_url, json=payload)
>       assert response.status_code == 201, response.text
E       AssertionError: {"code":[409](https://gitlab.ampath.net/kytos/kytos-end-to-end-tester/-/jobs/42602#L409),"description":"The EVC already exists.","name":"Conflict"}
E         
E       assert 409 == 201
E        +  where 409 = <Response [409]>.status_code
tests/test_e2e_40_sdntrace.py:46: AssertionError
tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_070_run_sdntrace_untagged_vlan: 2023-04-06,06:44:58.019760 - 2023-04-06,06:44:58.081101
=========================== rerun test summary info ============================
RERUN tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_070_run_sdntrace_untagged_vlan
RERUN tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_070_run_sdntrace_untagged_vlan
=========================== short test summary info ============================
FAILED tests/test_e2e_40_sdntrace.py::TestE2ESDNTrace::test_070_run_sdntrace_untagged_vlan - AssertionError: {"code":409,"description":"The EVC already exists.","name":"Conflict"}

assert 409 == 201
 +  where 409 = <Response [409]>.status_code