Skip to content

Commit

Permalink
Merge tag '0.24.2' into develop
Browse files Browse the repository at this point in the history
0.24.2
  • Loading branch information
yasuhito committed Aug 4, 2015
2 parents 4e74190 + 60ad876 commit f6f1ad2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 44 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
## develop (unreleased)


## 0.24.2 (8/4/2015)
### Bugs fixed
* [#209](https://github.com/trema/pio/issues/209): `Pio::OpenFlow.read` cannot parse Barrier messages.


## 0.24.1 (8/4/2015)
### Bugs fixed
* [#208](https://github.com/trema/pio/issues/208): `Pio::FlowMod.new` doesn't allow `:idle_timeout` and `:hard_timeout` options.
Expand Down
55 changes: 13 additions & 42 deletions features/open_flow_read.feature
Original file line number Diff line number Diff line change
@@ -1,43 +1,14 @@
Feature: Pio::OpenFlow.read
Scenario: Hello
Given I switch the Pio::OpenFlow version to "OpenFlow10"
When I try to parse a file named "open_flow10/hello.raw" with "OpenFlow" class
Then it should finish successfully
And the message should be a "Pio::OpenFlow10::Hello"

Scenario: Echo::Request
Given I switch the Pio::OpenFlow version to "OpenFlow10"
When I try to parse a file named "open_flow10/echo_request.raw" with "OpenFlow" class
Then it should finish successfully
And the message should be a "Pio::OpenFlow10::Echo::Request"

Scenario: Echo::Reply
Given I switch the Pio::OpenFlow version to "OpenFlow10"
When I try to parse a file named "open_flow10/echo_reply.raw" with "OpenFlow" class
Then it should finish successfully
And the message should be a "Pio::OpenFlow10::Echo::Reply"

Scenario: Features::Request
Given I switch the Pio::OpenFlow version to "OpenFlow10"
When I try to parse a file named "open_flow10/features_request.raw" with "OpenFlow" class
Then it should finish successfully
And the message should be a "Pio::OpenFlow10::Features::Request"

Scenario: Features::Reply
Given I switch the Pio::OpenFlow version to "OpenFlow10"
When I try to parse a file named "open_flow10/features_reply.raw" with "OpenFlow" class
Then it should finish successfully
And the message should be a "Pio::OpenFlow10::Features::Reply"

Scenario: PacketIn
Given I switch the Pio::OpenFlow version to "OpenFlow10"
When I try to parse a file named "open_flow10/packet_in.raw" with "OpenFlow" class
Then it should finish successfully
And the message should be a "Pio::OpenFlow10::PacketIn"

Scenario: PortStatus
Given I switch the Pio::OpenFlow version to "OpenFlow10"
When I try to parse a file named "open_flow10/port_status.raw" with "OpenFlow" class
Then it should finish successfully
And the message should be a "Pio::OpenFlow10::PortStatus"

Scenario: OpenFlow10
Given I switch the Pio::OpenFlow version to "OpenFlow10"
Then the following each raw file should be parsed into its corresponding object using OpenFlow.read
| raw file | result object |
| open_flow10/hello.raw | Pio::OpenFlow10::Hello |
| open_flow10/echo_request.raw | Pio::OpenFlow10::Echo::Request |
| open_flow10/echo_reply.raw | Pio::OpenFlow10::Echo::Reply |
| open_flow10/features_request.raw | Pio::OpenFlow10::Features::Request |
| open_flow10/features_reply.raw | Pio::OpenFlow10::Features::Reply |
| open_flow10/packet_in.raw | Pio::OpenFlow10::PacketIn |
| open_flow10/port_status.raw | Pio::OpenFlow10::PortStatus |
| open_flow10/barrier_request.raw | Pio::OpenFlow10::Barrier::Request |
| open_flow10/barrier_reply.raw | Pio::OpenFlow10::Barrier::Reply |
10 changes: 10 additions & 0 deletions features/step_definitions/open_flow_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@
When(/^I try to create an OpenFlow instruction with:$/) do |ruby_code|
step 'I try to create a packet with:', ruby_code
end

# rubocop:disable LineLength
Then(/^the following each raw file should be parsed into its corresponding object using OpenFlow\.read$/) do |table|
table.hashes.each do |each|
step %(I try to parse a file named "#{each['raw file']}" with "OpenFlow" class)
step 'it should finish successfully'
step %(the message should be a "#{each['result object']}")
end
end
# rubocop:enable LineLength
4 changes: 3 additions & 1 deletion lib/pio/open_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ def self.read(binary)
5 => Pio::Features::Request,
6 => Pio::Features::Reply,
10 => Pio::PacketIn,
12 => Pio::PortStatus
12 => Pio::PortStatus,
18 => Pio::Barrier::Request,
19 => Pio::Barrier::Reply
}
header = OpenFlowHeaderParser.read(binary)
parser.fetch(header.message_type).read(binary)
Expand Down
2 changes: 1 addition & 1 deletion lib/pio/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base module.
module Pio
# gem version.
VERSION = '0.24.1'.freeze
VERSION = '0.24.2'.freeze
end

0 comments on commit f6f1ad2

Please sign in to comment.