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

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

The action of patching the start_date attribute does not modify the flow information #89

Closed ArturoQuintana closed 3 years ago

ArturoQuintana commented 3 years ago

The test done bases its goal on modifying the start_date attribute of a scheduled circuit. Although the API calls seem to work, once it is checked the content of that attribute modified, the value remains untouched despite the action performed.

See example:

def test_patch_start_date_in_scheduled_circuit(self, disabled_circuit_id):

        # Schedule by date to next minute
        ts = datetime.now() + timedelta(seconds=60)
        schedule_time = ts.strftime("%Y-%m-%dT%H:%M:%S.000Z")

        payload = {
            "circuit_id": disabled_circuit_id,
            "schedule": {
                "date": schedule_time
            }
        }

        # create circuit schedule
        api_url = KYTOS_API + '/mef_eline/v2/evc/schedule/'
        requests.post(api_url, json=payload)

        # It verifies circuit schedule data
        response = requests.get(api_url)
        data = response.json()
        schedule_id = data[0]['schedule_id']

        start_delay = 180
        start = datetime.now() + timedelta(minutes=start_delay)

        payload2 = {
            "start_date": start.strftime(TIME_FMT)
        }

        # It sets a new circuit's start_date
        response = requests.patch(api_url + schedule_id, json=payload2)
        assert response.status_code == 200

        time.sleep(10)

        # It verifies EVC's data
        api_url = KYTOS_API + '/mef_eline/v2/evc/'
        response = requests.get(api_url + disabled_circuit_id)
        data = response.json()
        assert data['start_date'] == start.strftime(TIME_FMT)

Source

ArturoQuintana commented 3 years ago

Transferred to mef_eline https://github.com/kytos-ng/mef_eline/issues/51