Skip to content

Commit

Permalink
Merge branch 'hotfix/0.24.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhito committed Aug 4, 2015
2 parents 57fcb9b + c7e965f commit 360b67c
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,11 @@
## develop (unreleased)


## 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.


## 0.24.0 (8/1/2015)
### New features
* [#201](https://github.com/trema/pio/pull/201): Add oxm experimenter support (OpenFlow1.3).
Expand Down
42 changes: 42 additions & 0 deletions features/open_flow10/flow_mod.feature
@@ -1,5 +1,47 @@
@open_flow10
Feature: Pio::FlowMod
Scenario: new
When I try to create an OpenFlow message with:
"""
Pio::FlowMod.new(
actions: [],
buffer_id: 0,
command: :add,
flags: [],
hard_timeout: 0,
idle_timeout: 0,
match: Match.new(),
out_port: 0,
priority: 0
)
"""
Then it should finish successfully
And the message have the following fields and values:
| field | value |
| ofp_version | 1 |
| message_type | 14 |
| actions | [] |
| buffer_id | 0 |
| command | :add |
| flags | [] |
| hard_timeout | 0 |
| idle_timeout | 0 |
| match.wildcards.keys.size | 12 |
| match.wildcards.key?(:in_port) | true |
| match.wildcards.key?(:vlan_vid) | true |
| match.wildcards.key?(:ether_source_address) | true |
| match.wildcards.key?(:ether_destination_address) | true |
| match.wildcards.key?(:ether_type) | true |
| match.wildcards.key?(:ip_protocol) | true |
| match.wildcards.key?(:transport_source_port) | true |
| match.wildcards.key?(:transport_destination_port) | true |
| match.wildcards.key?(:ip_source_address_all) | true |
| match.wildcards.key?(:ip_destination_address_all) | true |
| match.wildcards.key?(:vlan_priority) | true |
| match.wildcards.key?(:ip_tos) | true |
| out_port | 0 |
| 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
Then it should finish successfully
Expand Down
2 changes: 2 additions & 0 deletions lib/pio/open_flow10/flow_mod.rb
Expand Up @@ -88,6 +88,8 @@ class Format < BinData::Record
body_option :command
body_option :cookie
body_option :flags
body_option :hard_timeout
body_option :idle_timeout
body_option :match
body_option :out_port
body_option :priority
Expand Down
2 changes: 1 addition & 1 deletion lib/pio/open_flow10/match.rb
Expand Up @@ -133,7 +133,7 @@ def self.read(binary)
# rubocop:disable MethodLength
# This method smells of :reek:FeatureEnvy
# This method smells of :reek:DuplicateMethodCall
def initialize(user_options)
def initialize(user_options = {})
flags = Wildcards::FLAGS.each_with_object({}) do |each, memo|
memo[each] = true unless user_options.key?(each)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pio/version.rb
@@ -1,5 +1,5 @@
# Base module.
module Pio
# gem version.
VERSION = '0.24.0'.freeze
VERSION = '0.24.1'.freeze
end

0 comments on commit 360b67c

Please sign in to comment.