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

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

mef_eline EVC enabled test cases failures on kytos/kytos-end-to-end-mongo7 pipeline #318

Closed viniarck closed 1 week ago

viniarck commented 2 weeks ago

Only kytos/kytos-end-to-end-mongo7 had some test cases failures, kytos/kytos-end-to-end-tester didn't.

@Alopalao can you double check if we need to reschedule kytos/kytos-end-to-end-mongo7? Looks like it was using an older version of the kytos-end-to-end-tests repo, let's try to figure out and adapt just so this doesn't keep happening for future similar changes.

tests/test_e2e_10_mef_eline.py:455: AssertionError
rerun: 1
tests/test_e2e_10_mef_eline.py::TestE2EMefEline::test_040_disable_circuit_should_remove_openflow_rules: 2024-07-09,00:43:03.348136 - 2024-07-09,00:43:14.389587
self = <tests.test_e2e_10_mef_eline.TestE2EMefEline object at 0x7f2e2611c510>

    def test_040_disable_circuit_should_remove_openflow_rules(self):
        # let's suppose that xyz is the circuit id previously created
        # curl -X PATCH -H "Content-Type: application/json" -d '{"enabled": false}' https://urldefense.com/v3/__http://172.18.0.2:8181/api/kytos/mef_eline/v2/evc/xyz__;!!FjuHKAHQs5udqho!MVsbbMwzL50S1z8Xro2_oRLav2ux8Ors4tIB0oUUGZBRx4J-piFbyygE-iygluSJrl47UOYYS_oXvnDGHMq-92XlsheQKw$
        payload = {
            "name": "Vlan125_Test_evc1",
            "enabled": True,
            "dynamic_backup_path": True,
            "uni_a": {
                "interface_id": "00:00:00:00:00:00:00:01:1",
                "tag": {"tag_type": "vlan", "value": 125}
            },
            "uni_z": {
                "interface_id": "00:00:00:00:00:00:00:02:1",
                "tag": {"tag_type": 1, "value": 125}
            }
        }
        api_url = KYTOS_API + '/mef_eline/v2/evc/'
        response = requests.post(api_url, data=json.dumps(payload), headers={'Content-type': 'application/json'})
        assert response.status_code == 201, response.text
        data = response.json()
        assert 'circuit_id' in data
        evc1 = data['circuit_id']
        time.sleep(10)

        # It verifies EVC's status
        response = requests.get(api_url + evc1)
        data = response.json()
        assert data['enabled'] is True

        # It disables the circuit
        payload = {"enabled": False}
        response = requests.patch(api_url + evc1, data=json.dumps(payload), headers={'Content-type': 'application/json'})
>       assert response.status_code == 200, response.text
E       AssertionError: {"description":"The attribute \"enabled\" is invalid.","code":400}
E       assert 400 == 200
E        +  where 400 = <Response [400]>.status_code

tests/test_e2e_10_mef_eline.py:455: AssertionError
tests/test_e2e_10_mef_eline.py::TestE2EMefEline::test_040_disable_circuit_should_remove_openflow_rules: 2024-07-09,00:43:38.540558 - 2024-07-09,00:43:49.243047
=========================== rerun test summary info ============================
RERUN tests/test_e2e_10_mef_eline.py::TestE2EMefEline::test_040_disable_circuit_should_remove_openflow_rules
RERUN tests/test_e2e_10_mef_eline.py::TestE2EMefEline::test_040_disable_circuit_should_remove_openflow_rules
RERUN tests/test_e2e_12_mef_eline.py::TestE2EMefEline::test_create_schedule_by_frequency
RERUN tests/test_e2e_12_mef_eline.py::TestE2EMefEline::test_create_schedule_by_frequency
RERUN tests/test_e2e_12_mef_eline.py::TestE2EMefEline::test_create_schedule_by_date
RERUN tests/test_e2e_12_mef_eline.py::TestE2EMefEline::test_create_schedule_by_date
RERUN tests/test_e2e_12_mef_eline.py::TestE2EMefEline::test_patch_schedule
RERUN tests/test_e2e_12_mef_eline.py::TestE2EMefEline::test_patch_schedule
=========================== short test summary info ============================
FAILED tests/test_e2e_10_mef_eline.py::TestE2EMefEline::test_040_disable_circuit_should_remove_openflow_rules - AssertionError: {"description":"The attribute \"enabled\" is invalid.","code":400}
assert 400 == 200
 +  where 400 = <Response [400]>.status_code
ERROR tests/test_e2e_12_mef_eline.py::TestE2EMefEline::test_create_schedule_by_frequency - AssertionError: {"description":"The attribute \"enabled\" is invalid.","code":400}
assert 400 == 200
 +  where 400 = <Response [400]>.status_code
ERROR tests/test_e2e_12_mef_eline.py::TestE2EMefEline::test_create_schedule_by_date - AssertionError: {"description":"The attribute \"enabled\" is invalid.","code":400}
assert 400 == 200
 +  where 400 = <Response [400]>.status_code
ERROR tests/test_e2e_12_mef_eline.py::TestE2EMefEline::test_patch_schedule - AssertionError: {"description":"The attribute \"enabled\" is invalid.","code":400}
assert 400 == 200
 +  where 400 = <Response [400]>.status_code
Alopalao commented 2 weeks ago

The times from the last run were:

kytos/kytos-end-to-end-mongo7 seem to be running sometimes at ~3 am (of the next day) which interrupted the tests from mongo 5. Could kytos-docker be changed so it runs an hour or 30 minutes before ~11:50 p.m.? So it runs at 10:50 pm or 11:20 pm. All those times in ET.

viniarck commented 2 weeks ago

Right @Alopalao. I think so.

@italovalcy can we anticipate kytos-docker schedule a bit or do you have any other suggestions?

viniarck commented 1 week ago

It's been changed to 6pm ET, thanks, Italo.