Skip to content

Commit

Permalink
Refactor OpenFlow classes
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhito committed Nov 26, 2015
1 parent 027de72 commit 4d97e69
Show file tree
Hide file tree
Showing 69 changed files with 385 additions and 426 deletions.
6 changes: 3 additions & 3 deletions features/open_flow10/aggregate_stats_request.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@open_flow10
Feature: Pio::AggregateStats::Request
Feature: Pio::OpenFlow::AggregateStats::Request
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::AggregateStats::Request.new(match: Match.new(in_port: 1))
Pio::OpenFlow::AggregateStats::Request.new(match: Pio::OpenFlow::Match.new(in_port: 1))
"""
Then it should finish successfully
And the message has the following fields and values:
Expand Down Expand Up @@ -32,7 +32,7 @@ Feature: Pio::AggregateStats::Request


Scenario: read
When I try to parse a file named "open_flow10/aggregate_stats_request.raw" with "AggregateStats::Request" class
When I try to parse a file named "open_flow10/aggregate_stats_request.raw" with "Pio::OpenFlow::AggregateStats::Request" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
Expand Down
6 changes: 3 additions & 3 deletions features/open_flow10/bad_request.feature
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@open_flow10
Feature: Pio::Error::BadRequest
Feature: Pio::OpenFlow::Error::BadRequest

Request was not understood error.

Scenario: new (raw_data = Echo request 1.3)
When I try to create an OpenFlow message with:
"""
Pio::Error::BadRequest.new(raw_data: Pio::OpenFlow13::Echo::Request.new.to_binary)
Pio::OpenFlow::Error::BadRequest.new(raw_data: Pio::OpenFlow13::Echo::Request.new.to_binary)
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -21,7 +21,7 @@ Feature: Pio::Error::BadRequest
| raw_data.length | 8 |

Scenario: read
When I try to parse a file named "open_flow10/bad_request.raw" with "Pio::Error::BadRequest" class
When I try to parse a file named "open_flow10/bad_request.raw" with "Pio::OpenFlow::Error::BadRequest" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
Expand Down
6 changes: 3 additions & 3 deletions features/open_flow10/barrier_reply.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@open_flow10
Feature: Pio::Barrier::Reply
Feature: Pio::OpenFlow::Barrier::Reply
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::Barrier::Reply.new
Pio::OpenFlow::Barrier::Reply.new
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -18,7 +18,7 @@ Feature: Pio::Barrier::Reply
Scenario: new(transaction_id: 123)
When I try to create an OpenFlow message with:
"""
Pio::Barrier::Reply.new(transaction_id: 123)
Pio::OpenFlow::Barrier::Reply.new(transaction_id: 123)
"""
Then it should finish successfully
And the message has the following fields and values:
Expand Down
6 changes: 3 additions & 3 deletions features/open_flow10/barrier_request.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@open_flow10
Feature: Pio::Barrier::Request
Feature: Pio::OpenFlow::Barrier::Request
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::Barrier::Request.new
Pio::OpenFlow::Barrier::Request.new
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -18,7 +18,7 @@ Feature: Pio::Barrier::Request
Scenario: new(transaction_id: 123)
When I try to create an OpenFlow message with:
"""
Pio::Barrier::Request.new(transaction_id: 123)
Pio::OpenFlow::Barrier::Request.new(transaction_id: 123)
"""
Then it should finish successfully
And the message has the following fields and values:
Expand Down
6 changes: 3 additions & 3 deletions features/open_flow10/description_stats_request.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@open_flow10
Feature: Pio::DescriptionStats::Request
Feature: Pio::OpenFlow::DescriptionStats::Request
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::DescriptionStats::Request.new
Pio::OpenFlow::DescriptionStats::Request.new
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -18,7 +18,7 @@ Feature: Pio::DescriptionStats::Request
Scenario: new(transaction_id: 123)
When I try to create an OpenFlow message with:
"""
Pio::DescriptionStats::Request.new(transaction_id: 123)
Pio::OpenFlow::DescriptionStats::Request.new(transaction_id: 123)
"""
Then it should finish successfully
And the message has the following fields and values:
Expand Down
21 changes: 4 additions & 17 deletions features/open_flow10/echo_reply.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@open_flow10
Feature: Pio::Echo::Reply
Feature: Pio::OpenFlow::Echo::Reply
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::Echo::Reply.new
Pio::OpenFlow::Echo::Reply.new
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -19,7 +19,7 @@ Feature: Pio::Echo::Reply
Scenario: new(transaction_id: 123)
When I try to create an OpenFlow message with:
"""
Pio::Echo::Reply.new(transaction_id: 123)
Pio::OpenFlow::Echo::Reply.new(transaction_id: 123)
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -35,7 +35,7 @@ Feature: Pio::Echo::Reply
Scenario: new(body: 'echo reply body')
When I try to create an OpenFlow message with:
"""
Pio::Echo::Reply.new(body: 'echo reply body')
Pio::OpenFlow::Echo::Reply.new(body: 'echo reply body')
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -47,16 +47,3 @@ Feature: Pio::Echo::Reply
| xid | 0 |
| body | echo reply body |
| user_data | echo reply body |

Scenario: read (no message body)
When I try to parse a file named "open_flow10/echo_reply.raw" with "Pio::Echo::Reply" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
| ofp_version | 1 |
| message_type | 3 |
| message_length | 8 |
| transaction_id | 6 |
| xid | 6 |
| body | |
| user_data | |
25 changes: 4 additions & 21 deletions features/open_flow10/echo_request.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@open_flow10
Feature: Pio::Echo::Request
Feature: Pio::OpenFlow::Echo::Request
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::Echo::Request.new
Pio::OpenFlow::Echo::Request.new
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -19,7 +19,7 @@ Feature: Pio::Echo::Request
Scenario: new(transaction_id: 123)
When I try to create an OpenFlow message with:
"""
Pio::Echo::Request.new(transaction_id: 123)
Pio::OpenFlow::Echo::Request.new(transaction_id: 123)
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -35,7 +35,7 @@ Feature: Pio::Echo::Request
Scenario: new(body: 'echo request body')
When I try to create an OpenFlow message with:
"""
Pio::Echo::Request.new(body: 'echo request body')
Pio::OpenFlow::Echo::Request.new(body: 'echo request body')
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -47,20 +47,3 @@ Feature: Pio::Echo::Request
| xid | 0 |
| body | echo request body |
| user_data | echo request body |

Scenario: read (no message body)
When I try to parse a file named "open_flow10/echo_request.raw" with "Pio::Echo::Request" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
| ofp_version | 1 |
| message_type | 2 |
| message_length | 8 |
| transaction_id | 0 |
| xid | 0 |
| body | |
| user_data | |

Scenario: parse error
When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Echo::Request" class
Then it should fail with "Pio::ParseError", "Invalid OpenFlow10 Echo Request message."
2 changes: 1 addition & 1 deletion features/open_flow10/exact_match.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: Pio::ExactMatch
Feature: Pio::OpenFlow::ExactMatch
Scenario: new (from ARP request Packet In)
When I create an exact match from "open_flow10/packet_in_arp_request.raw"
Then the message has the following fields and values:
Expand Down
4 changes: 2 additions & 2 deletions features/open_flow10/features_reply.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@open_flow10
Feature: Pio::Features::Reply
Feature: Pio::OpenFlow::Features::Reply
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::Features::Reply.new(
Pio::OpenFlow::Features::Reply.new(
datapath_id: 0x123,
n_buffers: 0x100,
n_tables: 0xfe,
Expand Down
8 changes: 4 additions & 4 deletions features/open_flow10/features_request.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@open_flow10
Feature: Pio::Features::Request
Feature: Pio::OpenFlow::Features::Request
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::Features::Request.new
Pio::OpenFlow::Features::Request.new
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -18,7 +18,7 @@ Feature: Pio::Features::Request
Scenario: new(transaction_id: 123)
When I try to create an OpenFlow message with:
"""
Pio::Features::Request.new(transaction_id: 123)
Pio::OpenFlow::Features::Request.new(transaction_id: 123)
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -31,7 +31,7 @@ Feature: Pio::Features::Request
| user_data | |

Scenario: read
When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Features::Request" class
When I try to parse a file named "open_flow10/features_request.raw" with "Pio::OpenFlow::Features::Request" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
Expand Down
16 changes: 8 additions & 8 deletions features/open_flow10/flow_mod.feature
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
@open_flow10
Feature: Pio::FlowMod
Feature: Pio::OpenFlow::FlowMod
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::FlowMod.new(
Pio::OpenFlow::FlowMod.new(
actions: [],
buffer_id: 0,
command: :add,
flags: [],
hard_timeout: 0,
idle_timeout: 0,
match: Match.new(),
match: Pio::OpenFlow::Match.new(),
out_port: 0,
priority: 0
)
Expand Down Expand Up @@ -43,7 +43,7 @@ Feature: Pio::FlowMod
| priority | 0 |

Scenario: read (Flow Mod Add)
When I try to parse a file named "open_flow10/flow_mod_add.raw" with "Pio::FlowMod" class
When I try to parse a file named "open_flow10/flow_mod_add.raw" with "Pio::OpenFlow::FlowMod" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
Expand Down Expand Up @@ -80,7 +80,7 @@ Feature: Pio::FlowMod
| actions.first.vlan_id | 10 |

Scenario: read (Flow Mod Modify)
When I try to parse a file named "open_flow10/flow_mod_modify.raw" with "Pio::FlowMod" class
When I try to parse a file named "open_flow10/flow_mod_modify.raw" with "Pio::OpenFlow::FlowMod" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
Expand Down Expand Up @@ -117,7 +117,7 @@ Feature: Pio::FlowMod
| actions.first.vlan_id | 10 |

Scenario: read (Flow Mod Modify Strict)
When I try to parse a file named "open_flow10/flow_mod_modify_strict.raw" with "Pio::FlowMod" class
When I try to parse a file named "open_flow10/flow_mod_modify_strict.raw" with "Pio::OpenFlow::FlowMod" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
Expand Down Expand Up @@ -154,7 +154,7 @@ Feature: Pio::FlowMod
| actions.first.vlan_id | 10 |

Scenario: read (Flow Mod Delete)
When I try to parse a file named "open_flow10/flow_mod_delete.raw" with "Pio::FlowMod" class
When I try to parse a file named "open_flow10/flow_mod_delete.raw" with "Pio::OpenFlow::FlowMod" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
Expand Down Expand Up @@ -189,7 +189,7 @@ Feature: Pio::FlowMod
| actions | [] |

Scenario: read (Flow Mod Delete Strict)
When I try to parse a file named "open_flow10/flow_mod_delete_strict.raw" with "Pio::FlowMod" class
When I try to parse a file named "open_flow10/flow_mod_delete_strict.raw" with "Pio::OpenFlow::FlowMod" class
Then it should finish successfully
And the message has the following fields and values:
| field | value |
Expand Down
3 changes: 1 addition & 2 deletions features/open_flow10/flow_removed.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@open_flow10
Feature: Pio::FlowRemoved
Feature: Pio::OpenFlow::FlowRemoved

@open_flow10
Scenario: read
When I try to parse a file named "open_flow10/flow_removed.raw" with "FlowRemoved" class
Then it should finish successfully
Expand Down
6 changes: 3 additions & 3 deletions features/open_flow10/flow_stats_reply.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@open_flow10
Feature: Pio::FlowStats::Reply
Feature: Pio::OpenFlow::FlowStats::Reply
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::FlowStats::Reply.new
Pio::OpenFlow::FlowStats::Reply.new
"""
Then it should finish successfully
And the message has the following fields and values:
Expand All @@ -20,7 +20,7 @@ Feature: Pio::FlowStats::Reply
Scenario: new(more options)
When I try to create an OpenFlow message with:
"""
Pio::FlowStats::Reply.new(more options)
Pio::OpenFlow::FlowStats::Reply.new(more options)
"""
Then it should finish successfully

Expand Down
6 changes: 3 additions & 3 deletions features/open_flow10/flow_stats_request.feature
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@open_flow10
Feature: Pio::FlowStats::Request
Feature: Pio::OpenFlow::FlowStats::Request
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::FlowStats::Request.new
Pio::OpenFlow::FlowStats::Request.new
"""
Then it should finish successfully
And the message has the following fields and values:
Expand Down Expand Up @@ -33,7 +33,7 @@ Feature: Pio::FlowStats::Request
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::FlowStats::Request.new(match: Match.new(in_port: 1))
Pio::OpenFlow::FlowStats::Request.new(match: Pio::OpenFlow::Match.new(in_port: 1))
"""
Then it should finish successfully
And the message has the following fields and values:
Expand Down
Loading

0 comments on commit 4d97e69

Please sign in to comment.