kytos-ng / sdntrace_cp

MIT License
1 stars 6 forks source link

Delete `incomplete` type. #106

Closed gretelliz closed 1 year ago

gretelliz commented 1 year ago

Closes #102

Summary

This update tracepath to remove incomplete type. There are 4 types now: starting, intermediary, last and loop. The only step_trace of traces with size 1 has the type last.

Local Test

The step in issue #102 where followed:

kytos $> controller.napps[('kytos', 'mef_eline')].circuits                                                                         
Out[5]: 
{'166a91c6cd5941': EVC(166a91c6cd5941, pw_s3),
 '302ef6216c7642': EVC(302ef6216c7642, pw_s2),
 '9ebdbd584ee149': EVC(9ebdbd584ee149, evc-vlan-999)}
kytos $> cid = '166a91c6cd5941'

kytos $> from napps.kytos.mef_eline.models import EVCDeploy

kytos $> EVCDeploy.check_list_traces([controller.napps[('kytos', 'mef_eline')].circuits[cid]])

kytos $> EVCDeploy.check_list_traces([controller.napps[('kytos', 'mef_eline')].circuits[cid]])                                     

2023-07-26 16:32:44,198 - INFO [uvicorn.access] (MainThread) 127.0.0.1:37080 - "GET /api/kytos/flow_manager/v2/stored_flows/?state=installed HTTP/1.1" 200
2023-07-26 16:32:44,206 - INFO [uvicorn.access] (MainThread) 127.0.0.1:37066 - "PUT /api/amlight/sdntrace_cp/v1/traces HTTP/1.1" 200
Out[4]: {'166a91c6cd5941': True}

End-to-end Test

In progress.

gretelliz commented 1 year ago

@viniarck, note that now the result is:

curl -H 'Content-type: application/json' -X PUT http://127.0.0.1:8181/api/amlight/sdntrace_cp/v1/trace -d '{"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:03", "in_port": 2}}}' | jq
 {
  "result": [
    {
      "dpid": "00:00:00:00:00:00:00:03",
      "port": 2,
      "time": "2023-07-28 11:29:32.309321",
      "type": "last",
      "out": {
        "port": 3
      }
    }
  ]
}

In this case an endpoint was found, that is why the type didn't change.