kytos-ng / sdntrace_cp

MIT License
1 stars 6 forks source link

fix: Check the `actions` field in flows when running a trace #70

Closed gretelliz closed 1 year ago

gretelliz commented 1 year ago

Closes #61

Summary

Now, it is checked if actions is a field of the flow See link.

Local Tests

Now, when running Sdntrace in a switch that has a Flow without actions:

Create a flow for drop packets (no actions):

curl -X POST -H 'Content-type: application/json' -d '{"flows": [{"priority": 10, "match": {"in_port": 60, "dl_vlan": 777}}]}' http://127.0.0.1:8181/api/kytos/flow_manager/v2/flows/00:00:00:00:00:00:00:01

Run a trace:

curl -H 'Content-type: application/json' -X PUT http://127.0.0.1:8181/api/amlight/sdntrace_cp/trace -d '{"trace": {"switch": {"dpid": "00:00:00:00:00:00:00:01", "in_port": 60}, "eth": {"dl_type": 33024, "dl_vlan": 777}}}

Response:

{"result":[{"dpid":"00:00:00:00:00:00:00:01","out":null,"port":60,"time":"2023-02-06 13:27:59.390535","type":"starting","vlan":777}]}
gretelliz commented 1 year ago

@gretelliz It looks fine, but could you please add a test with a stored flow with no actions?

@ajoaoff, thank you. Sure, I'll do it.

viniarck commented 1 year ago

@gretelliz thanks for updating the changelog, you ended up adding the information on section 2022.3.1, but this change landing on master is considered unreleased. Can you fix/move it please?

gretelliz commented 1 year ago

@viniarck, You are right, my bad.

viniarck commented 1 year ago

@viniarck, You are right, my bad.

Looks good now, feel free to merge this once the e2e is also ready to land. Thanks.