pio 0.27.1 → 0.27.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/Rakefile +1 -1
  4. data/bin/{terminal-notifier → code_metrics} +2 -2
  5. data/bin/code_metrics-profile +16 -0
  6. data/features/icmpv6.pcap +0 -0
  7. data/features/open_flow10/aggregate_stats_reply.feature +1 -1
  8. data/features/open_flow10/aggregate_stats_request.feature +2 -2
  9. data/features/open_flow10/bad_request.feature +2 -2
  10. data/features/open_flow10/barrier_reply.feature +3 -18
  11. data/features/open_flow10/barrier_request.feature +3 -18
  12. data/features/open_flow10/description_stats_reply.feature +1 -1
  13. data/features/open_flow10/description_stats_request.feature +3 -3
  14. data/features/open_flow10/echo_reply.feature +4 -47
  15. data/features/open_flow10/echo_request.feature +4 -36
  16. data/features/open_flow10/exact_match.feature +20 -2
  17. data/features/open_flow10/features_reply.feature +65 -72
  18. data/features/open_flow10/features_request.feature +3 -22
  19. data/features/open_flow10/flow_mod.feature +5 -5
  20. data/features/open_flow10/flow_stats_reply.feature +2 -2
  21. data/features/open_flow10/flow_stats_request.feature +3 -4
  22. data/features/open_flow10/hello.feature +4 -20
  23. data/features/open_flow10/hello_failed.feature +4 -4
  24. data/features/open_flow10/packet_in.feature +2 -2
  25. data/features/open_flow10/packet_in_arp_reply.raw +0 -0
  26. data/features/open_flow10/packet_out.feature +1 -1
  27. data/features/open_flow10/port_status.feature +1 -1
  28. data/features/open_flow13/bad_request.feature +2 -2
  29. data/features/open_flow13/echo_reply.feature +5 -37
  30. data/features/open_flow13/echo_request.feature +5 -37
  31. data/features/open_flow13/features_reply.feature +3 -7
  32. data/features/open_flow13/features_request.feature +3 -18
  33. data/features/open_flow13/flow_mod.feature +5 -5
  34. data/features/open_flow13/hello.feature +4 -19
  35. data/features/open_flow13/hello_failed.feature +4 -4
  36. data/features/open_flow13/match.feature +4 -4
  37. data/features/open_flow13/packet_in.feature +3 -3
  38. data/features/open_flow13/packet_out.feature +3 -3
  39. data/features/parser.feature +10 -0
  40. data/lib/pio/arp/format.rb +20 -0
  41. data/lib/pio/ipv4_header.rb +20 -0
  42. data/lib/pio/open_flow.rb +0 -1
  43. data/lib/pio/open_flow/message.rb +51 -57
  44. data/lib/pio/open_flow/open_flow_header.rb +6 -10
  45. data/lib/pio/open_flow10.rb +20 -15
  46. data/lib/pio/open_flow10/aggregate_stats/reply.rb +20 -0
  47. data/lib/pio/open_flow10/aggregate_stats/request.rb +25 -0
  48. data/lib/pio/open_flow10/barrier/reply.rb +14 -0
  49. data/lib/pio/open_flow10/barrier/request.rb +14 -0
  50. data/lib/pio/open_flow10/description_stats/reply.rb +21 -0
  51. data/lib/pio/open_flow10/description_stats/request.rb +19 -0
  52. data/lib/pio/open_flow10/echo/reply.rb +16 -0
  53. data/lib/pio/open_flow10/echo/request.rb +16 -0
  54. data/lib/pio/open_flow10/error/bad_request.rb +27 -49
  55. data/lib/pio/open_flow10/error/hello_failed.rb +6 -28
  56. data/lib/pio/open_flow10/exact_match.rb +4 -39
  57. data/lib/pio/open_flow10/features/reply.rb +48 -72
  58. data/lib/pio/open_flow10/features/request.rb +4 -11
  59. data/lib/pio/open_flow10/flow_mod.rb +21 -51
  60. data/lib/pio/open_flow10/{flow_stats_reply.rb → flow_stats/reply.rb} +7 -23
  61. data/lib/pio/open_flow10/flow_stats/request.rb +25 -0
  62. data/lib/pio/open_flow10/hello.rb +3 -13
  63. data/lib/pio/open_flow10/match.rb +0 -18
  64. data/lib/pio/open_flow10/match10.rb +22 -0
  65. data/lib/pio/open_flow10/packet_in.rb +18 -42
  66. data/lib/pio/open_flow10/packet_out.rb +8 -31
  67. data/lib/pio/open_flow10/port_status.rb +11 -39
  68. data/lib/pio/open_flow10/stats_reply.rb +11 -8
  69. data/lib/pio/open_flow10/stats_request.rb +8 -8
  70. data/lib/pio/open_flow13.rb +13 -6
  71. data/lib/pio/open_flow13/echo/reply.rb +15 -0
  72. data/lib/pio/open_flow13/echo/request.rb +15 -0
  73. data/lib/pio/open_flow13/error/bad_request.rb +32 -49
  74. data/lib/pio/open_flow13/error/hello_failed.rb +7 -30
  75. data/lib/pio/open_flow13/features/reply.rb +27 -51
  76. data/lib/pio/open_flow13/features/request.rb +3 -10
  77. data/lib/pio/open_flow13/flow_mod.rb +29 -52
  78. data/lib/pio/open_flow13/hello.rb +18 -22
  79. data/lib/pio/open_flow13/packet_in.rb +26 -44
  80. data/lib/pio/open_flow13/packet_out.rb +16 -35
  81. data/lib/pio/open_flow13/stats_request.rb +5 -21
  82. data/lib/pio/parser.rb +5 -4
  83. data/lib/pio/version.rb +1 -1
  84. data/pio.gemspec +6 -6
  85. data/spec/pio/open_flow10/{echo_reply_spec.rb → echo/reply_spec.rb} +1 -1
  86. data/spec/pio/open_flow10/{echo_request_spec.rb → echo/request_spec.rb} +1 -1
  87. data/spec/pio/open_flow10/error/hello_failed_spec.rb +2 -2
  88. data/spec/pio/open_flow10/features/request_spec.rb +0 -5
  89. data/spec/pio/open_flow10/flow_mod_spec.rb +2 -4
  90. data/spec/pio/open_flow10/flow_stats_reply_spec.rb +1 -1
  91. data/spec/pio/open_flow10/flow_stats_request_spec.rb +2 -2
  92. data/spec/pio/open_flow10/packet_out_spec.rb +15 -18
  93. data/spec/pio/open_flow13/echo_reply_spec.rb +1 -1
  94. data/spec/pio/open_flow13/echo_request_spec.rb +1 -1
  95. data/spec/pio/open_flow13/error/hello_failed_spec.rb +2 -2
  96. data/spec/pio/open_flow13/features/request_spec.rb +5 -3
  97. data/spec/pio/open_flow13/hello_spec.rb +3 -3
  98. data/spec/support/shared_examples_for_openflow_messages.rb +5 -12
  99. metadata +92 -85
  100. data/lib/pio/open_flow/echo.rb +0 -44
  101. data/lib/pio/open_flow/format.rb +0 -46
  102. data/lib/pio/open_flow10/aggregate_stats_reply.rb +0 -38
  103. data/lib/pio/open_flow10/aggregate_stats_request.rb +0 -42
  104. data/lib/pio/open_flow10/barrier_reply.rb +0 -21
  105. data/lib/pio/open_flow10/barrier_request.rb +0 -22
  106. data/lib/pio/open_flow10/description_stats_reply.rb +0 -35
  107. data/lib/pio/open_flow10/description_stats_request.rb +0 -36
  108. data/lib/pio/open_flow10/echo.rb +0 -20
  109. data/lib/pio/open_flow10/flow_stats_request.rb +0 -64
  110. data/lib/pio/open_flow13/echo.rb +0 -20
  111. data/lib/pio/open_flow13/features.rb +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd270820e4430bee21347b008f91d1724d02ef47
4
- data.tar.gz: e223abe2cc4eecc229f81696781e970093f658f1
3
+ metadata.gz: 804a0c37ec9414b35256fc56c916d748597d8073
4
+ data.tar.gz: b261a60ba818e6957e298f556d9403c7e3134478
5
5
  SHA512:
6
- metadata.gz: 22047d4b49373c9a0b1d8aec4ac7bebc353ef161831c466c4928b043bbe9caae19584540a64cd1c7cad6523a954f76e195e388038f600b61809085b502c35de2
7
- data.tar.gz: 1fb20370716136a85aa396e56549cb84c7d81d7e8c53165df7999447e60af9ba8901f4cd46d82c53ee53946d5135ea82f60f50e4e51525c362de170e29d3f5b7
6
+ metadata.gz: 6420fee8b7890cc9be86fa3947a2b72a83a2891d6987125c6c529552135cd79b80c7ec29ee661ba3eaa91d98f7c66bf26caf260e0bcbe7b5b07a843d8e7ceab4
7
+ data.tar.gz: c62452bb130675ce0fa50a47df61358b691d6726f42ee1dac64e23d58dd195971daf47c06470e39e28283794ae556bc0279d722363e5933c8443cbb2eaacb565
data/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  ## develop (unreleased)
4
4
 
5
5
 
6
+ ## 0.27.2 (10/25/2015)
7
+ ### New features
8
+ * [#244](https://github.com/trema/pio/pull/244): Support ARP in `ExactMatch.new`.
9
+
10
+ ### Changes
11
+ * [#242](https://github.com/trema/pio/issues/242): Fix `Parser#read` to avoid fail in parsing unsupported eth\_type frame.
12
+
13
+
6
14
  ## 0.27.1 (9/28/2015)
7
15
  ### Bugs fixed
8
16
  * [#238](https://github.com/trema/pio/issues/238): `Features::Reply#datapath_id` doesn't return an Integer.
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'bundler/gem_tasks'
2
2
 
3
3
  RELISH_PROJECT = 'trema/pio'
4
- FLAY_THRESHOLD = 919
4
+ FLAY_THRESHOLD = 1007
5
5
 
6
6
  task default: :travis
7
7
  task test: [:spec, :cucumber]
@@ -2,7 +2,7 @@
2
2
  #
3
3
  # This file was generated by Bundler.
4
4
  #
5
- # The application 'terminal-notifier' is installed as part of a gem, and
5
+ # The application 'code_metrics' is installed as part of a gem, and
6
6
  # this file is here to facilitate running it.
7
7
  #
8
8
 
@@ -13,4 +13,4 @@ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
13
13
  require 'rubygems'
14
14
  require 'bundler/setup'
15
15
 
16
- load Gem.bin_path('terminal-notifier', 'terminal-notifier')
16
+ load Gem.bin_path('code_metrics', 'code_metrics')
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'code_metrics-profile' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('code_metrics', 'code_metrics-profile')
Binary file
@@ -7,7 +7,7 @@ Feature: Pio::AggregateStats::Reply
7
7
  | field | value |
8
8
  | ofp_version | 1 |
9
9
  | message_type | 17 |
10
- | length | 36 |
10
+ | message_length | 36 |
11
11
  | transaction_id | 15 |
12
12
  | xid | 15 |
13
13
  | stats_type | :aggregate |
@@ -10,7 +10,7 @@ Feature: Pio::AggregateStats::Request
10
10
  | field | value |
11
11
  | ofp_version | 1 |
12
12
  | message_type | 16 |
13
- | length | 56 |
13
+ | message_length | 56 |
14
14
  | transaction_id | 0 |
15
15
  | xid | 0 |
16
16
  | stats_type | :aggregate |
@@ -38,7 +38,7 @@ Feature: Pio::AggregateStats::Request
38
38
  | field | value |
39
39
  | ofp_version | 1 |
40
40
  | message_type | 16 |
41
- | length | 56 |
41
+ | message_length | 56 |
42
42
  | transaction_id | 14 |
43
43
  | xid | 14 |
44
44
  | stats_type | :aggregate |
@@ -13,7 +13,7 @@ Feature: Pio::Error::BadRequest
13
13
  | field | value |
14
14
  | ofp_version | 1 |
15
15
  | message_type | 1 |
16
- | length | 20 |
16
+ | message_length | 20 |
17
17
  | transaction_id | 0 |
18
18
  | xid | 0 |
19
19
  | error_type | :bad_request |
@@ -27,7 +27,7 @@ Feature: Pio::Error::BadRequest
27
27
  | field | value |
28
28
  | ofp_version | 1 |
29
29
  | message_type | 1 |
30
- | length | 20 |
30
+ | message_length | 20 |
31
31
  | transaction_id | 0 |
32
32
  | xid | 0 |
33
33
  | error_type | :bad_request |
@@ -10,7 +10,7 @@ Feature: Pio::Barrier::Reply
10
10
  | field | value |
11
11
  | ofp_version | 1 |
12
12
  | message_type | 19 |
13
- | length | 8 |
13
+ | message_length | 8 |
14
14
  | transaction_id | 0 |
15
15
  | xid | 0 |
16
16
  | body | |
@@ -25,22 +25,7 @@ Feature: Pio::Barrier::Reply
25
25
  | field | value |
26
26
  | ofp_version | 1 |
27
27
  | message_type | 19 |
28
- | length | 8 |
29
- | transaction_id | 123 |
30
- | xid | 123 |
31
- | body | |
32
-
33
- Scenario: new(xid: 123)
34
- When I try to create an OpenFlow message with:
35
- """
36
- Pio::Barrier::Reply.new(xid: 123)
37
- """
38
- Then it should finish successfully
39
- And the message has the following fields and values:
40
- | field | value |
41
- | ofp_version | 1 |
42
- | message_type | 19 |
43
- | length | 8 |
28
+ | message_length | 8 |
44
29
  | transaction_id | 123 |
45
30
  | xid | 123 |
46
31
  | body | |
@@ -52,7 +37,7 @@ Feature: Pio::Barrier::Reply
52
37
  | field | value |
53
38
  | ofp_version | 1 |
54
39
  | message_type | 19 |
55
- | length | 8 |
40
+ | message_length | 8 |
56
41
  | transaction_id | 0 |
57
42
  | xid | 0 |
58
43
  | body | |
@@ -10,7 +10,7 @@ Feature: Pio::Barrier::Request
10
10
  | field | value |
11
11
  | ofp_version | 1 |
12
12
  | message_type | 18 |
13
- | length | 8 |
13
+ | message_length | 8 |
14
14
  | transaction_id | 0 |
15
15
  | xid | 0 |
16
16
  | body | |
@@ -25,26 +25,11 @@ Feature: Pio::Barrier::Request
25
25
  | field | value |
26
26
  | ofp_version | 1 |
27
27
  | message_type | 18 |
28
- | length | 8 |
28
+ | message_length | 8 |
29
29
  | transaction_id | 123 |
30
30
  | xid | 123 |
31
31
  | body | |
32
32
 
33
- Scenario: new(xid: 123)
34
- When I try to create an OpenFlow message with:
35
- """
36
- Pio::Barrier::Request.new(xid: 123)
37
- """
38
- Then it should finish successfully
39
- And the message has the following fields and values:
40
- | field | value |
41
- | ofp_version | 1 |
42
- | message_type | 18 |
43
- | length | 8 |
44
- | transaction_id | 123 |
45
- | xid | 123 |
46
- | body | |
47
-
48
33
  Scenario: read
49
34
  When I try to parse a file named "open_flow10/barrier_request.raw" with "Barrier::Request" class
50
35
  Then it should finish successfully
@@ -52,7 +37,7 @@ Feature: Pio::Barrier::Request
52
37
  | field | value |
53
38
  | ofp_version | 1 |
54
39
  | message_type | 18 |
55
- | length | 8 |
40
+ | message_length | 8 |
56
41
  | transaction_id | 0 |
57
42
  | xid | 0 |
58
43
  | body | |
@@ -7,7 +7,7 @@ Feature: Pio::DescriptionStats::Reply
7
7
  | field | value |
8
8
  | ofp_version | 1 |
9
9
  | message_type | 17 |
10
- | length | 1068 |
10
+ | message_length | 1068 |
11
11
  | transaction_id | 12 |
12
12
  | xid | 12 |
13
13
  | stats_type | :description |
@@ -10,7 +10,7 @@ Feature: Pio::DescriptionStats::Request
10
10
  | field | value |
11
11
  | ofp_version | 1 |
12
12
  | message_type | 16 |
13
- | length | 12 |
13
+ | message_length | 12 |
14
14
  | transaction_id | 0 |
15
15
  | xid | 0 |
16
16
  | stats_type | :description |
@@ -25,7 +25,7 @@ Feature: Pio::DescriptionStats::Request
25
25
  | field | value |
26
26
  | ofp_version | 1 |
27
27
  | message_type | 16 |
28
- | length | 12 |
28
+ | message_length | 12 |
29
29
  | transaction_id | 123 |
30
30
  | xid | 123 |
31
31
  | stats_type | :description |
@@ -37,7 +37,7 @@ Feature: Pio::DescriptionStats::Request
37
37
  | field | value |
38
38
  | ofp_version | 1 |
39
39
  | message_type | 16 |
40
- | length | 12 |
40
+ | message_length | 12 |
41
41
  | transaction_id | 12 |
42
42
  | xid | 12 |
43
43
  | stats_type | :description |
@@ -10,7 +10,7 @@ Feature: Pio::Echo::Reply
10
10
  | field | value |
11
11
  | ofp_version | 1 |
12
12
  | message_type | 3 |
13
- | length | 8 |
13
+ | message_length | 8 |
14
14
  | transaction_id | 0 |
15
15
  | xid | 0 |
16
16
  | body | |
@@ -26,35 +26,12 @@ Feature: Pio::Echo::Reply
26
26
  | field | value |
27
27
  | ofp_version | 1 |
28
28
  | message_type | 3 |
29
- | length | 8 |
29
+ | message_length | 8 |
30
30
  | transaction_id | 123 |
31
31
  | xid | 123 |
32
32
  | body | |
33
33
  | user_data | |
34
34
 
35
- Scenario: new(xid: 123)
36
- When I try to create an OpenFlow message with:
37
- """
38
- Pio::Echo::Reply.new(xid: 123)
39
- """
40
- Then it should finish successfully
41
- And the message has the following fields and values:
42
- | field | value |
43
- | ofp_version | 1 |
44
- | message_type | 3 |
45
- | length | 8 |
46
- | transaction_id | 123 |
47
- | xid | 123 |
48
- | body | |
49
- | user_data | |
50
-
51
- Scenario: new(unknown_attr: 'foo') and error
52
- When I try to create an OpenFlow message with:
53
- """
54
- Pio::Echo::Reply.new(unknown_attr: 'foo')
55
- """
56
- Then it should fail with "RuntimeError", "Unknown option: unknown_attr"
57
-
58
35
  Scenario: new(body: 'echo reply body')
59
36
  When I try to create an OpenFlow message with:
60
37
  """
@@ -65,23 +42,7 @@ Feature: Pio::Echo::Reply
65
42
  | field | value |
66
43
  | ofp_version | 1 |
67
44
  | message_type | 3 |
68
- | length | 23 |
69
- | transaction_id | 0 |
70
- | xid | 0 |
71
- | body | echo reply body |
72
- | user_data | echo reply body |
73
-
74
- Scenario: new(user_data: 'echo reply body')
75
- When I try to create an OpenFlow message with:
76
- """
77
- Pio::Echo::Reply.new(user_data: 'echo reply body')
78
- """
79
- Then it should finish successfully
80
- And the message has the following fields and values:
81
- | field | value |
82
- | ofp_version | 1 |
83
- | message_type | 3 |
84
- | length | 23 |
45
+ | message_length | 23 |
85
46
  | transaction_id | 0 |
86
47
  | xid | 0 |
87
48
  | body | echo reply body |
@@ -94,12 +55,8 @@ Feature: Pio::Echo::Reply
94
55
  | field | value |
95
56
  | ofp_version | 1 |
96
57
  | message_type | 3 |
97
- | length | 8 |
58
+ | message_length | 8 |
98
59
  | transaction_id | 6 |
99
60
  | xid | 6 |
100
61
  | body | |
101
62
  | user_data | |
102
-
103
- Scenario: parse error
104
- When I try to parse a file named "open_flow10/features_reply.raw" with "Pio::Echo::Reply" class
105
- Then it should fail with "Pio::ParseError", "Invalid OpenFlow10 Echo Reply message."
@@ -10,7 +10,7 @@ Feature: Pio::Echo::Request
10
10
  | field | value |
11
11
  | ofp_version | 1 |
12
12
  | message_type | 2 |
13
- | length | 8 |
13
+ | message_length | 8 |
14
14
  | transaction_id | 0 |
15
15
  | xid | 0 |
16
16
  | body | |
@@ -26,23 +26,7 @@ Feature: Pio::Echo::Request
26
26
  | field | value |
27
27
  | ofp_version | 1 |
28
28
  | message_type | 2 |
29
- | length | 8 |
30
- | transaction_id | 123 |
31
- | xid | 123 |
32
- | body | |
33
- | user_data | |
34
-
35
- Scenario: new(xid: 123)
36
- When I try to create an OpenFlow message with:
37
- """
38
- Pio::Echo::Request.new(xid: 123)
39
- """
40
- Then it should finish successfully
41
- And the message has the following fields and values:
42
- | field | value |
43
- | ofp_version | 1 |
44
- | message_type | 2 |
45
- | length | 8 |
29
+ | message_length | 8 |
46
30
  | transaction_id | 123 |
47
31
  | xid | 123 |
48
32
  | body | |
@@ -58,23 +42,7 @@ Feature: Pio::Echo::Request
58
42
  | field | value |
59
43
  | ofp_version | 1 |
60
44
  | message_type | 2 |
61
- | length | 25 |
62
- | transaction_id | 0 |
63
- | xid | 0 |
64
- | body | echo request body |
65
- | user_data | echo request body |
66
-
67
- Scenario: new(user_data: 'echo request body')
68
- When I try to create an OpenFlow message with:
69
- """
70
- Pio::Echo::Request.new(user_data: 'echo request body')
71
- """
72
- Then it should finish successfully
73
- And the message has the following fields and values:
74
- | field | value |
75
- | ofp_version | 1 |
76
- | message_type | 2 |
77
- | length | 25 |
45
+ | message_length | 25 |
78
46
  | transaction_id | 0 |
79
47
  | xid | 0 |
80
48
  | body | echo request body |
@@ -87,7 +55,7 @@ Feature: Pio::Echo::Request
87
55
  | field | value |
88
56
  | ofp_version | 1 |
89
57
  | message_type | 2 |
90
- | length | 8 |
58
+ | message_length | 8 |
91
59
  | transaction_id | 0 |
92
60
  | xid | 0 |
93
61
  | body | |
@@ -1,7 +1,7 @@
1
1
  Feature: Pio::ExactMatch
2
2
  Scenario: new (from ARP request Packet In)
3
3
  When I create an exact match from "open_flow10/packet_in_arp_request.raw"
4
- And the message has the following fields and values:
4
+ Then the message has the following fields and values:
5
5
  | field | value |
6
6
  | wildcards | {} |
7
7
  | in_port | 1 |
@@ -17,9 +17,27 @@ Feature: Pio::ExactMatch
17
17
  | transport_source_port | 0 |
18
18
  | transport_destination_port | 0 |
19
19
 
20
+ Scenario: new (from ARP reply Packet In)
21
+ When I create an exact match from "open_flow10/packet_in_arp_reply.raw"
22
+ Then the message has the following fields and values:
23
+ | field | value |
24
+ | wildcards | {} |
25
+ | in_port | 1 |
26
+ | ether_source_address | 11:11:11:11:11:11 |
27
+ | ether_destination_address | 22:22:22:22:22:22 |
28
+ | vlan_vid | 65535 |
29
+ | vlan_priority | 0 |
30
+ | ether_type | 2054 |
31
+ | ip_tos | 0 |
32
+ | ip_protocol | 2 |
33
+ | ip_source_address | 192.168.0.1 |
34
+ | ip_destination_address | 192.168.0.2 |
35
+ | transport_source_port | 0 |
36
+ | transport_destination_port | 0 |
37
+
20
38
  Scenario: new (from Cbench Packet In)
21
39
  When I create an exact match from "open_flow10/packet_in_cbench.raw"
22
- And the message has the following fields and values:
40
+ Then the message has the following fields and values:
23
41
  | field | value |
24
42
  | wildcards | {} |
25
43
  | in_port | 1 |
@@ -4,14 +4,11 @@ Feature: Pio::Features::Reply
4
4
  When I try to create an OpenFlow message with:
5
5
  """
6
6
  Pio::Features::Reply.new(
7
- dpid: 0x123,
7
+ datapath_id: 0x123,
8
8
  n_buffers: 0x100,
9
9
  n_tables: 0xfe,
10
- capabilities: [:flow_stats, :table_stats, :port_stats, :queue_stats,
11
- :arp_match_ip],
12
- actions: [:output, :set_vlan_vid, :set_vlan_pcp, :strip_vlan,
13
- :set_ether_source_address, :set_ether_destination_address, :set_ip_source_address, :set_ip_destination_address,
14
- :set_ip_tos, :set_transport_source_port, :set_transport_destination_port, :enqueue],
10
+ capabilities: [:flow_stats, :table_stats, :port_stats, :queue_stats, :arp_match_ip],
11
+ actions: [:output, :set_ether_source_address, :set_ether_destination_address],
15
12
  ports: [{ port_no: 1,
16
13
  hardware_address: '11:22:33:44:55:66',
17
14
  name: 'port123',
@@ -22,74 +19,70 @@ Feature: Pio::Features::Reply
22
19
  """
23
20
  Then it should finish successfully
24
21
  And the message has the following fields and values:
25
- | field | value |
26
- | ofp_version | 1 |
27
- | message_type | 6 |
28
- | length | 80 |
29
- | transaction_id | 0 |
30
- | xid | 0 |
31
- | datapath_id | 291 |
32
- | dpid | 291 |
33
- | n_buffers | 256 |
34
- | n_tables | 254 |
35
- | capabilities | [:flow_stats, :table_stats, :port_stats, :queue_stats, :arp_match_ip] |
36
- | actions | [:output, :set_vlan_vid, :set_vlan_pcp, :strip_vlan, :set_ether_source_address, :set_ether_destination_address, :set_ip_source_address, :set_ip_destination_address, :set_ip_tos, :set_transport_source_port, :set_transport_destination_port, :enqueue] |
37
- | ports.length | 1 |
38
- | ports.first.datapath_id | 291 |
39
- | ports.first.port_no | 1 |
40
- | ports.first.mac_address | 11:22:33:44:55:66 |
41
- | ports.first.hardware_address | 11:22:33:44:55:66 |
42
- | ports.first.name | port123 |
43
- | ports.first.config | [:port_down] |
44
- | ports.first.state | [:link_down] |
45
- | ports.first.curr | [:port_10gb_fd, :port_copper] |
46
- | ports.first.advertised | [] |
47
- | ports.first.supported | [] |
48
- | ports.first.peer | [] |
22
+ | field | value |
23
+ | ofp_version | 1 |
24
+ | message_type | 6 |
25
+ | message_length | 80 |
26
+ | transaction_id | 0 |
27
+ | xid | 0 |
28
+ | datapath_id | 291 |
29
+ | dpid | 291 |
30
+ | n_buffers | 256 |
31
+ | n_tables | 254 |
32
+ | capabilities | [:flow_stats, :table_stats, :port_stats, :queue_stats, :arp_match_ip] |
33
+ | actions | [:output, :set_ether_source_address, :set_ether_destination_address] |
34
+ | ports.length | 1 |
35
+ | ports[0].datapath_id | 291 |
36
+ | ports[0].port_no | 1 |
37
+ | ports[0].mac_address | 11:22:33:44:55:66 |
38
+ | ports[0].hardware_address | 11:22:33:44:55:66 |
39
+ | ports[0].name | port123 |
40
+ | ports[0].config | [:port_down] |
41
+ | ports[0].state | [:link_down] |
42
+ | ports[0].curr | [:port_10gb_fd, :port_copper] |
43
+ | ports[0].advertised | [] |
44
+ | ports[0].supported | [] |
45
+ | ports[0].peer | [] |
49
46
 
50
47
  Scenario: read
51
48
  When I try to parse a file named "open_flow10/features_reply.raw" with "Features::Reply" class
52
49
  Then it should finish successfully
53
50
  And the message has the following fields and values:
54
- | field | value |
55
- | ofp_version | 1 |
56
- | message_type | 6 |
57
- | length | 176 |
58
- | transaction_id | 2 |
59
- | xid | 2 |
60
- | datapath_id | 1 |
61
- | dpid | 1 |
62
- | n_buffers | 256 |
63
- | n_tables | 1 |
64
- | capabilities | [:flow_stats, :table_stats, :port_stats, :arp_match_ip] |
65
- | actions | [:output, :set_vlan_vid, :set_vlan_pcp, :strip_vlan, :set_ether_source_address, :set_ether_destination_address, :set_ip_source_address, :set_ip_destination_address, :set_ip_tos, :set_transport_source_port, :set_transport_destination_port, :enqueue] |
66
- | ports.length | 3 |
67
- | ports.first.datapath_id | 1 |
68
- | ports.first.port_no | 2 |
69
- | ports.first.mac_address | 16:7d:a4:37:ba:10 |
70
- | ports.first.hardware_address | 16:7d:a4:37:ba:10 |
71
- | ports.first.name | trema0-0 |
72
- | ports.first.config | [] |
73
- | ports.first.state | [] |
74
- | ports.first.curr | [:port_10gb_fd, :port_copper] |
75
- | ports.first.advertised | [] |
76
- | ports.first.supported | [] |
77
- | ports.first.peer | [] |
78
- | ports.last.port_no | 1 |
79
- | ports.last.number | 1 |
80
- | ports.last.mac_address | 62:94:3a:f6:40:db |
81
- | ports.last.hardware_address | 62:94:3a:f6:40:db |
82
- | ports.last.name | trema1-0 |
83
- | ports.last.config | [] |
84
- | ports.last.state | [] |
85
- | ports.last.curr | [:port_10gb_fd, :port_copper] |
86
- | ports.last.advertised | [] |
87
- | ports.last.supported | [] |
88
- | ports.last.peer | [] |
89
- | ports.last.up? | true |
90
- | ports.last.down? | false |
91
- | ports.last.local? | false |
92
-
93
- Scenario: parse error
94
- When I try to parse a file named "open_flow10/echo_reply.raw" with "Pio::Features::Reply" class
95
- Then it should fail with "Pio::ParseError", "Invalid OpenFlow10 Features Reply message."
51
+ | field | value |
52
+ | ofp_version | 1 |
53
+ | message_type | 6 |
54
+ | message_length | 176 |
55
+ | transaction_id | 2 |
56
+ | xid | 2 |
57
+ | datapath_id | 1 |
58
+ | dpid | 1 |
59
+ | n_buffers | 256 |
60
+ | n_tables | 1 |
61
+ | capabilities | [:flow_stats, :table_stats, :port_stats, :arp_match_ip] |
62
+ | actions | [:output, :set_vlan_vid, :set_vlan_pcp, :strip_vlan, :set_ether_source_address, :set_ether_destination_address, :set_ip_source_address, :set_ip_destination_address, :set_ip_tos, :set_transport_source_port, :set_transport_destination_port, :enqueue] |
63
+ | ports.length | 3 |
64
+ | ports[0].datapath_id | 1 |
65
+ | ports[0].port_no | 2 |
66
+ | ports[0].mac_address | 16:7d:a4:37:ba:10 |
67
+ | ports[0].hardware_address | 16:7d:a4:37:ba:10 |
68
+ | ports[0].name | trema0-0 |
69
+ | ports[0].config | [] |
70
+ | ports[0].state | [] |
71
+ | ports[0].curr | [:port_10gb_fd, :port_copper] |
72
+ | ports[0].advertised | [] |
73
+ | ports[0].supported | [] |
74
+ | ports[0].peer | [] |
75
+ | ports[2].port_no | 1 |
76
+ | ports[2].number | 1 |
77
+ | ports[2].mac_address | 62:94:3a:f6:40:db |
78
+ | ports[2].hardware_address | 62:94:3a:f6:40:db |
79
+ | ports[2].name | trema1-0 |
80
+ | ports[2].config | [] |
81
+ | ports[2].state | [] |
82
+ | ports[2].curr | [:port_10gb_fd, :port_copper] |
83
+ | ports[2].advertised | [] |
84
+ | ports[2].supported | [] |
85
+ | ports[2].peer | [] |
86
+ | ports[2].up? | true |
87
+ | ports[2].down? | false |
88
+ | ports[2].local? | false |