pio 0.23.1 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +2 -0
  4. data/Rakefile +1 -1
  5. data/features/open_flow10/barrier_reply.feature +58 -0
  6. data/features/open_flow10/barrier_request.feature +58 -0
  7. data/features/open_flow10/echo_reply.feature +50 -40
  8. data/features/open_flow10/echo_request.feature +54 -51
  9. data/features/open_flow10/features_reply.feature +62 -63
  10. data/features/open_flow10/features_request.feature +2 -19
  11. data/features/open_flow10/flow_mod.feature +1 -0
  12. data/features/open_flow10/hello.feature +38 -44
  13. data/features/open_flow10/packet_in.feature +1 -2
  14. data/features/open_flow10/packet_in.raw +0 -0
  15. data/features/open_flow10/packet_out.feature +14 -14
  16. data/features/open_flow10/port_status.feature +17 -17
  17. data/features/open_flow13/apply_actions.feature +15 -17
  18. data/features/open_flow13/echo_reply.feature +58 -58
  19. data/features/open_flow13/echo_request.feature +58 -58
  20. data/features/open_flow13/features_reply.feature +2 -6
  21. data/features/open_flow13/features_request.feature +3 -23
  22. data/features/open_flow13/flow_mod.feature +86 -93
  23. data/features/open_flow13/goto_table.feature +4 -4
  24. data/features/open_flow13/hello.feature +8 -15
  25. data/features/open_flow13/match.feature +14 -3
  26. data/features/open_flow13/meter.feature +3 -3
  27. data/features/open_flow13/oxm_experimenter_stratos_basic_dot11.raw +0 -0
  28. data/features/open_flow13/oxm_invalid_field.raw +0 -0
  29. data/features/open_flow13/packet_in.feature +15 -20
  30. data/features/open_flow13/packet_out.feature +39 -42
  31. data/features/open_flow13/send_out_port.feature +1 -5
  32. data/features/open_flow13/write_metadata.feature +3 -3
  33. data/features/open_flow_read.feature +43 -0
  34. data/features/open_flow_version.feature +10 -0
  35. data/features/step_definitions/open_flow_steps.rb +10 -2
  36. data/features/step_definitions/packet_data_steps.rb +4 -0
  37. data/features/support/hooks.rb +7 -0
  38. data/lib/pio.rb +1 -1
  39. data/lib/pio/monkey_patch/integer/ranges.rb +4 -0
  40. data/lib/pio/open_flow.rb +54 -16
  41. data/lib/pio/open_flow/datapath_id.rb +26 -0
  42. data/lib/pio/open_flow/echo.rb +44 -0
  43. data/lib/pio/open_flow/format.rb +45 -0
  44. data/lib/pio/open_flow/message.rb +88 -0
  45. data/lib/pio/open_flow/open_flow_header.rb +0 -14
  46. data/lib/pio/open_flow10.rb +3 -8
  47. data/lib/pio/open_flow10/actions.rb +1 -1
  48. data/lib/pio/open_flow10/barrier_reply.rb +21 -0
  49. data/lib/pio/open_flow10/barrier_request.rb +22 -0
  50. data/lib/pio/open_flow10/echo.rb +15 -11
  51. data/lib/pio/open_flow10/features.rb +99 -71
  52. data/lib/pio/open_flow10/flow_mod.rb +73 -66
  53. data/lib/pio/open_flow10/hello.rb +19 -4
  54. data/lib/pio/open_flow10/match.rb +133 -131
  55. data/lib/pio/open_flow10/packet_in.rb +55 -49
  56. data/lib/pio/open_flow10/packet_out.rb +31 -24
  57. data/lib/pio/open_flow10/port_status.rb +54 -27
  58. data/lib/pio/open_flow10/send_out_port.rb +66 -64
  59. data/lib/pio/open_flow13.rb +0 -15
  60. data/lib/pio/open_flow13/echo.rb +11 -68
  61. data/lib/pio/open_flow13/features_reply.rb +48 -77
  62. data/lib/pio/open_flow13/features_request.rb +16 -45
  63. data/lib/pio/open_flow13/flow_mod.rb +125 -148
  64. data/lib/pio/open_flow13/goto_table.rb +1 -0
  65. data/lib/pio/open_flow13/hello.rb +54 -84
  66. data/lib/pio/open_flow13/match.rb +69 -11
  67. data/lib/pio/open_flow13/meter.rb +1 -0
  68. data/lib/pio/open_flow13/packet_in.rb +38 -50
  69. data/lib/pio/open_flow13/packet_out.rb +50 -75
  70. data/lib/pio/open_flow13/send_out_port.rb +34 -34
  71. data/lib/pio/open_flow13/write_metadata.rb +1 -0
  72. data/lib/pio/parser.rb +3 -0
  73. data/lib/pio/version.rb +1 -1
  74. data/pio.gemspec +6 -6
  75. data/spec/pio/open_flow10/echo_reply_spec.rb +7 -0
  76. data/spec/pio/open_flow10/echo_request_spec.rb +7 -0
  77. data/spec/pio/open_flow10/features_reply_spec.rb +8 -0
  78. data/spec/pio/open_flow10/features_request_spec.rb +13 -0
  79. data/spec/pio/open_flow10/flow_mod_spec.rb +17 -16
  80. data/spec/pio/open_flow10/hello_spec.rb +7 -0
  81. data/spec/pio/open_flow10/match_spec.rb +8 -6
  82. data/spec/pio/open_flow10/packet_in_spec.rb +14 -0
  83. data/spec/pio/open_flow10/packet_out_spec.rb +21 -14
  84. data/spec/pio/open_flow10/send_out_port_spec.rb +4 -4
  85. data/spec/pio/open_flow10/wildcards_spec.rb +2 -2
  86. data/spec/pio/open_flow13/echo_reply_spec.rb +7 -0
  87. data/spec/pio/open_flow13/echo_request_spec.rb +7 -0
  88. data/spec/pio/open_flow13/features_reply_spec.rb +8 -0
  89. data/spec/pio/open_flow13/features_request_spec.rb +13 -0
  90. data/spec/pio/open_flow13/hello_spec.rb +14 -59
  91. data/spec/pio/open_flow13/packet_in_spec.rb +14 -0
  92. data/spec/pio/open_flow13/packet_out_spec.rb +7 -0
  93. data/spec/pio/open_flow_spec.rb +34 -0
  94. data/spec/spec_helper.rb +1 -0
  95. data/spec/support/shared_examples_for_openflow_messages.rb +75 -0
  96. metadata +215 -170
  97. data/bin/byebug +0 -16
  98. data/bin/terminal-notifier +0 -16
  99. data/lib/pio/open_flow10/message.rb +0 -78
  100. data/spec/pio/open_flow/type_spec.rb +0 -5
@@ -1,7 +1,5 @@
1
+ @open_flow13
1
2
  Feature: Pio::Echo::Reply
2
- Background:
3
- Given I use OpenFlow 1.3
4
-
5
3
  Scenario: new
6
4
  When I try to create an OpenFlow message with:
7
5
  """
@@ -9,14 +7,14 @@ Feature: Pio::Echo::Reply
9
7
  """
10
8
  Then it should finish successfully
11
9
  And the message have the following fields and values:
12
- | field | value |
13
- | class | Pio::Echo::Reply |
14
- | ofp_version | 4 |
15
- | message_type | 3 |
16
- | message_length | 8 |
17
- | transaction_id | 0 |
18
- | xid | 0 |
19
- | body | |
10
+ | field | value |
11
+ | ofp_version | 4 |
12
+ | message_type | 3 |
13
+ | message_length | 8 |
14
+ | transaction_id | 0 |
15
+ | xid | 0 |
16
+ | body | |
17
+ | user_data | |
20
18
 
21
19
  Scenario: new(transaction_id: 123)
22
20
  When I try to create an OpenFlow message with:
@@ -25,14 +23,14 @@ Feature: Pio::Echo::Reply
25
23
  """
26
24
  Then it should finish successfully
27
25
  And the message have the following fields and values:
28
- | field | value |
29
- | class | Pio::Echo::Reply |
30
- | ofp_version | 4 |
31
- | message_type | 3 |
32
- | message_length | 8 |
33
- | transaction_id | 123 |
34
- | xid | 123 |
35
- | body | |
26
+ | field | value |
27
+ | ofp_version | 4 |
28
+ | message_type | 3 |
29
+ | message_length | 8 |
30
+ | transaction_id | 123 |
31
+ | xid | 123 |
32
+ | body | |
33
+ | user_data | |
36
34
 
37
35
  Scenario: new(xid: 123)
38
36
  When I try to create an OpenFlow message with:
@@ -41,78 +39,80 @@ Feature: Pio::Echo::Reply
41
39
  """
42
40
  Then it should finish successfully
43
41
  And the message have the following fields and values:
44
- | field | value |
45
- | class | Pio::Echo::Reply |
46
- | ofp_version | 4 |
47
- | message_type | 3 |
48
- | message_length | 8 |
49
- | transaction_id | 123 |
50
- | xid | 123 |
51
- | body | |
52
-
53
- Scenario: new(xid: -1) and error
54
- When I try to create an OpenFlow message with:
55
- """
56
- Pio::Echo::Reply.new(xid: -1)
57
- """
58
- Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
42
+ | field | value |
43
+ | ofp_version | 4 |
44
+ | message_type | 3 |
45
+ | message_length | 8 |
46
+ | transaction_id | 123 |
47
+ | xid | 123 |
48
+ | body | |
49
+ | user_data | |
59
50
 
60
- Scenario: new(xid: 2**32) and error
51
+ Scenario: new(body: 'echo reply body')
61
52
  When I try to create an OpenFlow message with:
62
53
  """
63
- Pio::Echo::Reply.new(xid: 2**32)
54
+ Pio::Echo::Reply.new(body: 'echo reply body')
64
55
  """
65
- Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
56
+ Then it should finish successfully
57
+ And the message have the following fields and values:
58
+ | field | value |
59
+ | ofp_version | 4 |
60
+ | message_type | 3 |
61
+ | message_length | 23 |
62
+ | transaction_id | 0 |
63
+ | xid | 0 |
64
+ | body | echo reply body |
65
+ | user_data | echo reply body |
66
66
 
67
- Scenario: new(body: 'echo reply body')
67
+ Scenario: new(user_data: 'echo reply body')
68
68
  When I try to create an OpenFlow message with:
69
69
  """
70
- Pio::Echo::Reply.new(body: 'echo reply body')
70
+ Pio::Echo::Reply.new(user_data: 'echo reply body')
71
71
  """
72
72
  Then it should finish successfully
73
73
  And the message have the following fields and values:
74
- | field | value |
75
- | class | Pio::Echo::Reply |
76
- | ofp_version | 4 |
77
- | message_type | 3 |
78
- | message_length | 23 |
79
- | transaction_id | 0 |
80
- | xid | 0 |
81
- | body | echo reply body |
74
+ | field | value |
75
+ | ofp_version | 4 |
76
+ | message_type | 3 |
77
+ | message_length | 23 |
78
+ | transaction_id | 0 |
79
+ | xid | 0 |
80
+ | body | echo reply body |
81
+ | user_data | echo reply body |
82
82
 
83
83
  Scenario: new(unknown_attr: 'foo') and error
84
84
  When I try to create an OpenFlow message with:
85
85
  """
86
86
  Pio::Echo::Reply.new(unknown_attr: 'foo')
87
87
  """
88
- Then it should fail with "RuntimeError", "Unknown keyword: unknown_attr"
88
+ Then it should fail with "RuntimeError", "Unknown option: unknown_attr"
89
89
 
90
90
  Scenario: read (no message body)
91
91
  When I try to parse a file named "open_flow13/echo_reply_no_body.raw" with "Pio::Echo::Reply" class
92
92
  Then it should finish successfully
93
93
  And the message have the following fields and values:
94
- | field | value |
95
- | class | Pio::Echo::Reply |
96
- | ofp_version | 4 |
97
- | message_type | 3 |
98
- | message_length | 8 |
99
- | transaction_id | 0 |
100
- | xid | 0 |
101
- | body | |
94
+ | field | value |
95
+ | ofp_version | 4 |
96
+ | message_type | 3 |
97
+ | message_length | 8 |
98
+ | transaction_id | 0 |
99
+ | xid | 0 |
100
+ | body | |
101
+ | user_data | |
102
102
 
103
103
  Scenario: read
104
104
  When I try to parse a file named "open_flow13/echo_reply_body.raw" with "Pio::Echo::Reply" class
105
105
  Then it should finish successfully
106
106
  And the message have the following fields and values:
107
107
  | field | value |
108
- | class | Pio::Echo::Reply |
109
108
  | ofp_version | 4 |
110
109
  | message_type | 3 |
111
110
  | message_length | 28 |
112
111
  | transaction_id | 0 |
113
112
  | xid | 0 |
114
113
  | body | hogehogehogehogehoge |
114
+ | user_data | hogehogehogehogehoge |
115
115
 
116
116
  Scenario: parse error
117
117
  When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Echo::Reply" class
118
- Then it should fail with "Pio::ParseError", "Invalid Echo Reply 1.3 message."
118
+ Then it should fail with "Pio::ParseError", "Invalid OpenFlow13 Echo Reply message."
@@ -1,7 +1,5 @@
1
+ @open_flow13
1
2
  Feature: Pio::Echo::Request
2
- Background:
3
- Given I use OpenFlow 1.3
4
-
5
3
  Scenario: new
6
4
  When I try to create an OpenFlow message with:
7
5
  """
@@ -9,14 +7,14 @@ Feature: Pio::Echo::Request
9
7
  """
10
8
  Then it should finish successfully
11
9
  And the message have the following fields and values:
12
- | field | value |
13
- | class | Pio::Echo::Request |
14
- | ofp_version | 4 |
15
- | message_type | 2 |
16
- | message_length | 8 |
17
- | transaction_id | 0 |
18
- | xid | 0 |
19
- | body | |
10
+ | field | value |
11
+ | ofp_version | 4 |
12
+ | message_type | 2 |
13
+ | message_length | 8 |
14
+ | transaction_id | 0 |
15
+ | xid | 0 |
16
+ | body | |
17
+ | user_data | |
20
18
 
21
19
  Scenario: new(transaction_id: 123)
22
20
  When I try to create an OpenFlow message with:
@@ -25,14 +23,14 @@ Feature: Pio::Echo::Request
25
23
  """
26
24
  Then it should finish successfully
27
25
  And the message have the following fields and values:
28
- | field | value |
29
- | class | Pio::Echo::Request |
30
- | ofp_version | 4 |
31
- | message_type | 2 |
32
- | message_length | 8 |
33
- | transaction_id | 123 |
34
- | xid | 123 |
35
- | body | |
26
+ | field | value |
27
+ | ofp_version | 4 |
28
+ | message_type | 2 |
29
+ | message_length | 8 |
30
+ | transaction_id | 123 |
31
+ | xid | 123 |
32
+ | body | |
33
+ | user_data | |
36
34
 
37
35
  Scenario: new(xid: 123)
38
36
  When I try to create an OpenFlow message with:
@@ -41,78 +39,80 @@ Feature: Pio::Echo::Request
41
39
  """
42
40
  Then it should finish successfully
43
41
  And the message have the following fields and values:
44
- | field | value |
45
- | class | Pio::Echo::Request |
46
- | ofp_version | 4 |
47
- | message_type | 2 |
48
- | message_length | 8 |
49
- | transaction_id | 123 |
50
- | xid | 123 |
51
- | body | |
52
-
53
- Scenario: new(xid: -1) and error
54
- When I try to create an OpenFlow message with:
55
- """
56
- Pio::Echo::Request.new(xid: -1)
57
- """
58
- Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
42
+ | field | value |
43
+ | ofp_version | 4 |
44
+ | message_type | 2 |
45
+ | message_length | 8 |
46
+ | transaction_id | 123 |
47
+ | xid | 123 |
48
+ | body | |
49
+ | user_data | |
59
50
 
60
- Scenario: new(xid: 2**32) and error
51
+ Scenario: new(body: 'echo request body')
61
52
  When I try to create an OpenFlow message with:
62
53
  """
63
- Pio::Echo::Request.new(xid: 2**32)
54
+ Pio::Echo::Request.new(body: 'echo request body')
64
55
  """
65
- Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
56
+ Then it should finish successfully
57
+ And the message have the following fields and values:
58
+ | field | value |
59
+ | ofp_version | 4 |
60
+ | message_type | 2 |
61
+ | message_length | 25 |
62
+ | transaction_id | 0 |
63
+ | xid | 0 |
64
+ | body | echo request body |
65
+ | user_data | echo request body |
66
66
 
67
- Scenario: new(body: 'echo request body')
67
+ Scenario: new(user_data: 'echo request body')
68
68
  When I try to create an OpenFlow message with:
69
69
  """
70
- Pio::Echo::Request.new(body: 'echo request body')
70
+ Pio::Echo::Request.new(user_data: 'echo request body')
71
71
  """
72
72
  Then it should finish successfully
73
73
  And the message have the following fields and values:
74
- | field | value |
75
- | class | Pio::Echo::Request |
76
- | ofp_version | 4 |
77
- | message_type | 2 |
78
- | message_length | 25 |
79
- | transaction_id | 0 |
80
- | xid | 0 |
81
- | body | echo request body |
74
+ | field | value |
75
+ | ofp_version | 4 |
76
+ | message_type | 2 |
77
+ | message_length | 25 |
78
+ | transaction_id | 0 |
79
+ | xid | 0 |
80
+ | body | echo request body |
81
+ | user_data | echo request body |
82
82
 
83
83
  Scenario: new(unknown_attr: 'foo') and error
84
84
  When I try to create an OpenFlow message with:
85
85
  """
86
86
  Pio::Echo::Request.new(unknown_attr: 'foo')
87
87
  """
88
- Then it should fail with "RuntimeError", "Unknown keyword: unknown_attr"
88
+ Then it should fail with "RuntimeError", "Unknown option: unknown_attr"
89
89
 
90
90
  Scenario: read (no message body)
91
91
  When I try to parse a file named "open_flow13/echo_request_no_body.raw" with "Pio::Echo::Request" class
92
92
  Then it should finish successfully
93
93
  And the message have the following fields and values:
94
- | field | value |
95
- | class | Pio::Echo::Request |
96
- | ofp_version | 4 |
97
- | message_type | 2 |
98
- | message_length | 8 |
99
- | transaction_id | 0 |
100
- | xid | 0 |
101
- | body | |
94
+ | field | value |
95
+ | ofp_version | 4 |
96
+ | message_type | 2 |
97
+ | message_length | 8 |
98
+ | transaction_id | 0 |
99
+ | xid | 0 |
100
+ | body | |
101
+ | user_data | |
102
102
 
103
103
  Scenario: read
104
104
  When I try to parse a file named "open_flow13/echo_request_body.raw" with "Pio::Echo::Request" class
105
105
  Then it should finish successfully
106
106
  And the message have the following fields and values:
107
107
  | field | value |
108
- | class | Pio::Echo::Request |
109
108
  | ofp_version | 4 |
110
109
  | message_type | 2 |
111
110
  | message_length | 28 |
112
111
  | transaction_id | 0 |
113
112
  | xid | 0 |
114
113
  | body | hogehogehogehogehoge |
114
+ | user_data | hogehogehogehogehoge |
115
115
 
116
116
  Scenario: parse error
117
117
  When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Echo::Request" class
118
- Then it should fail with "Pio::ParseError", "Invalid Echo Request 1.3 message."
118
+ Then it should fail with "Pio::ParseError", "Invalid OpenFlow13 Echo Request message."
@@ -1,7 +1,5 @@
1
+ @open_flow13
1
2
  Feature: Pio::Features::Reply
2
- Background:
3
- Given I use OpenFlow 1.3
4
-
5
3
  Scenario: new
6
4
  When I try to create an OpenFlow message with:
7
5
  """
@@ -15,7 +13,6 @@ Feature: Pio::Features::Reply
15
13
  Then it should finish successfully
16
14
  And the message have the following fields and values:
17
15
  | field | value |
18
- | class | Pio::Features::Reply |
19
16
  | ofp_version | 4 |
20
17
  | message_type | 6 |
21
18
  | message_length | 32 |
@@ -34,7 +31,6 @@ Feature: Pio::Features::Reply
34
31
  Then it should finish successfully
35
32
  And the message have the following fields and values:
36
33
  | field | value |
37
- | class | Pio::Features::Reply |
38
34
  | ofp_version | 4 |
39
35
  | message_type | 6 |
40
36
  | message_length | 32 |
@@ -50,4 +46,4 @@ Feature: Pio::Features::Reply
50
46
 
51
47
  Scenario: parse error
52
48
  When I try to parse a file named "open_flow10/echo_request.raw" with "Pio::Features::Reply" class
53
- Then it should fail with "Pio::ParseError", "Invalid Features Reply 1.3 message."
49
+ Then it should fail with "Pio::ParseError", "Invalid OpenFlow13 Features Reply message."
@@ -1,7 +1,5 @@
1
+ @open_flow13
1
2
  Feature: Pio::Features::Request
2
- Background:
3
- Given I use OpenFlow 1.3
4
-
5
3
  Scenario: new
6
4
  When I try to create an OpenFlow message with:
7
5
  """
@@ -10,7 +8,6 @@ Feature: Pio::Features::Request
10
8
  Then it should finish successfully
11
9
  And the message have the following fields and values:
12
10
  | field | value |
13
- | class | Pio::Features::Request |
14
11
  | ofp_version | 4 |
15
12
  | message_type | 5 |
16
13
  | message_length | 8 |
@@ -26,7 +23,6 @@ Feature: Pio::Features::Request
26
23
  Then it should finish successfully
27
24
  And the message have the following fields and values:
28
25
  | field | value |
29
- | class | Pio::Features::Request |
30
26
  | ofp_version | 4 |
31
27
  | message_type | 5 |
32
28
  | message_length | 8 |
@@ -42,7 +38,6 @@ Feature: Pio::Features::Request
42
38
  Then it should finish successfully
43
39
  And the message have the following fields and values:
44
40
  | field | value |
45
- | class | Pio::Features::Request |
46
41
  | ofp_version | 4 |
47
42
  | message_type | 5 |
48
43
  | message_length | 8 |
@@ -50,33 +45,18 @@ Feature: Pio::Features::Request
50
45
  | xid | 123 |
51
46
  | body | |
52
47
 
53
- Scenario: new(xid: -1) and error
54
- When I try to create an OpenFlow message with:
55
- """
56
- Pio::Features::Request.new(xid: -1)
57
- """
58
- Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
59
-
60
- Scenario: new(xid: 2**32) and error
61
- When I try to create an OpenFlow message with:
62
- """
63
- Pio::Features::Request.new(xid: 2**32)
64
- """
65
- Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
66
-
67
48
  Scenario: new(unknown_attr: 'foo') and error
68
49
  When I try to create an OpenFlow message with:
69
50
  """
70
51
  Pio::Features::Request.new(unknown_attr: 'foo')
71
52
  """
72
- Then it should fail with "RuntimeError", "Unknown keyword: unknown_attr"
53
+ Then it should fail with "RuntimeError", "Unknown option: unknown_attr"
73
54
 
74
55
  Scenario: read
75
56
  When I try to parse a file named "open_flow13/features_request.raw" with "Pio::Features::Request" class
76
57
  Then it should finish successfully
77
58
  And the message have the following fields and values:
78
59
  | field | value |
79
- | class | Pio::Features::Request |
80
60
  | ofp_version | 4 |
81
61
  | message_type | 5 |
82
62
  | message_length | 8 |
@@ -86,4 +66,4 @@ Feature: Pio::Features::Request
86
66
 
87
67
  Scenario: parse error
88
68
  When I try to parse a file named "open_flow10/hello.raw" with "Pio::Features::Request" class
89
- Then it should fail with "Pio::ParseError", "Invalid Features Request 1.3 message."
69
+ Then it should fail with "Pio::ParseError", "Invalid OpenFlow13 Features Request message."
@@ -1,7 +1,5 @@
1
+ @open_flow13
1
2
  Feature: Pio::FlowMod
2
- Background:
3
- Given I use OpenFlow 1.3
4
-
5
3
  Scenario: new
6
4
  When I try to create an OpenFlow message with:
7
5
  """
@@ -10,7 +8,6 @@ Feature: Pio::FlowMod
10
8
  Then it should finish successfully
11
9
  And the message have the following fields and values:
12
10
  | field | value |
13
- | class | Pio::FlowMod |
14
11
  | ofp_version | 4 |
15
12
  | message_type | 14 |
16
13
  | message_length | 56 |
@@ -38,29 +35,28 @@ Feature: Pio::FlowMod
38
35
  """
39
36
  Then it should finish successfully
40
37
  And the message have the following fields and values:
41
- | field | value |
42
- | class | Pio::FlowMod |
43
- | ofp_version | 4 |
44
- | message_type | 14 |
45
- | message_length | 80 |
46
- | transaction_id | 0 |
47
- | xid | 0 |
48
- | cookie | 0 |
49
- | cookie_mask | 0 |
50
- | table_id | 0 |
51
- | command | :add |
52
- | idle_timeout | 0 |
53
- | hard_timeout | 0 |
54
- | priority.to_hex | 0xffff |
55
- | buffer_id | :no_buffer |
56
- | out_port | :any |
57
- | out_group | :any |
58
- | flags | [] |
59
- | match.match_fields | [] |
60
- | instructions.size | 1 |
61
- | instructions.at(0).class | Pio::Apply |
62
- | instructions.at(0).actions.at(0).class | Pio::SendOutPort |
63
- | instructions.at(0).actions.at(0).port | 1 |
38
+ | field | value |
39
+ | ofp_version | 4 |
40
+ | message_type | 14 |
41
+ | message_length | 80 |
42
+ | transaction_id | 0 |
43
+ | xid | 0 |
44
+ | cookie | 0 |
45
+ | cookie_mask | 0 |
46
+ | table_id | 0 |
47
+ | command | :add |
48
+ | idle_timeout | 0 |
49
+ | hard_timeout | 0 |
50
+ | priority.to_hex | 0xffff |
51
+ | buffer_id | :no_buffer |
52
+ | out_port | :any |
53
+ | out_group | :any |
54
+ | flags | [] |
55
+ | match.match_fields | [] |
56
+ | instructions.size | 1 |
57
+ | instructions.at(0).class | Pio::Apply |
58
+ | instructions.at(0).actions.at(0).class | Pio::OpenFlow13::SendOutPort |
59
+ | instructions.at(0).actions.at(0).port | 1 |
64
60
 
65
61
  Scenario: new(match: Pio::Match.new(in_port: 1), instructions: Pio::Apply.new(SendOutPort.new(1)))
66
62
  When I try to create an OpenFlow message with:
@@ -69,79 +65,76 @@ Feature: Pio::FlowMod
69
65
  """
70
66
  Then it should finish successfully
71
67
  And the message have the following fields and values:
72
- | field | value |
73
- | class | Pio::FlowMod |
74
- | ofp_version | 4 |
75
- | message_type | 14 |
76
- | message_length | 88 |
77
- | transaction_id | 0 |
78
- | xid | 0 |
79
- | cookie | 0 |
80
- | cookie_mask | 0 |
81
- | table_id | 0 |
82
- | command | :add |
83
- | idle_timeout | 0 |
84
- | hard_timeout | 0 |
85
- | priority.to_hex | 0xffff |
86
- | buffer_id | :no_buffer |
87
- | out_port | :any |
88
- | out_group | :any |
89
- | flags | [] |
90
- | match.in_port | 1 |
91
- | instructions.size | 1 |
92
- | instructions.at(0).class | Pio::Apply |
93
- | instructions.at(0).actions.at(0).class | Pio::SendOutPort |
94
- | instructions.at(0).actions.at(0).port | 1 |
68
+ | field | value |
69
+ | ofp_version | 4 |
70
+ | message_type | 14 |
71
+ | message_length | 88 |
72
+ | transaction_id | 0 |
73
+ | xid | 0 |
74
+ | cookie | 0 |
75
+ | cookie_mask | 0 |
76
+ | table_id | 0 |
77
+ | command | :add |
78
+ | idle_timeout | 0 |
79
+ | hard_timeout | 0 |
80
+ | priority.to_hex | 0xffff |
81
+ | buffer_id | :no_buffer |
82
+ | out_port | :any |
83
+ | out_group | :any |
84
+ | flags | [] |
85
+ | match.in_port | 1 |
86
+ | instructions.size | 1 |
87
+ | instructions.at(0).class | Pio::Apply |
88
+ | instructions.at(0).actions.at(0).class | Pio::OpenFlow13::SendOutPort |
89
+ | instructions.at(0).actions.at(0).port | 1 |
95
90
 
96
91
  Scenario: read (no match or instructions)
97
92
  When I try to parse a file named "open_flow13/flow_mod_no_match_or_instructions.raw" with "Pio::FlowMod" class
98
93
  Then it should finish successfully
99
94
  And the message have the following fields and values:
100
- | field | value |
101
- | class | Pio::FlowMod |
102
- | ofp_version | 4 |
103
- | message_type | 14 |
104
- | message_length | 56 |
105
- | transaction_id | 0 |
106
- | xid | 0 |
107
- | cookie | 0 |
108
- | cookie_mask | 0 |
109
- | table_id | 0 |
110
- | command | :add |
111
- | idle_timeout | 0 |
112
- | hard_timeout | 0 |
113
- | priority.to_hex | 0xffff |
114
- | buffer_id | :no_buffer |
115
- | out_port | :any |
116
- | out_group | :any |
117
- | flags | [] |
118
- | match.match_fields | [] |
119
- | instructions | [] |
95
+ | field | value |
96
+ | ofp_version | 4 |
97
+ | message_type | 14 |
98
+ | message_length | 56 |
99
+ | transaction_id | 0 |
100
+ | xid | 0 |
101
+ | cookie | 0 |
102
+ | cookie_mask | 0 |
103
+ | table_id | 0 |
104
+ | command | :add |
105
+ | idle_timeout | 0 |
106
+ | hard_timeout | 0 |
107
+ | priority.to_hex | 0xffff |
108
+ | buffer_id | :no_buffer |
109
+ | out_port | :any |
110
+ | out_group | :any |
111
+ | flags | [] |
112
+ | match.match_fields | [] |
113
+ | instructions | [] |
120
114
 
121
115
  Scenario: read (instruction = apply, action = SendOutPort(port: 1))
122
116
  When I try to parse a file named "open_flow13/flow_mod_add_apply_no_match.raw" with "Pio::FlowMod" class
123
117
  Then it should finish successfully
124
118
  And the message have the following fields and values:
125
- | field | value |
126
- | class | Pio::FlowMod |
127
- | ofp_version | 4 |
128
- | message_type | 14 |
129
- | message_length | 80 |
130
- | transaction_id | 0 |
131
- | xid | 0 |
132
- | cookie | 0 |
133
- | cookie_mask | 0 |
134
- | table_id | 0 |
135
- | command | :add |
136
- | idle_timeout | 0 |
137
- | hard_timeout | 0 |
138
- | priority.to_hex | 0xffff |
139
- | buffer_id | :no_buffer |
140
- | out_port | :any |
141
- | out_group | :any |
142
- | flags | [] |
143
- | match.match_fields | [] |
144
- | instructions.size | 1 |
145
- | instructions.at(0).class | Pio::Apply |
146
- | instructions.at(0).actions.at(0).class | Pio::SendOutPort |
147
- | instructions.at(0).actions.at(0).port | 1 |
119
+ | field | value |
120
+ | ofp_version | 4 |
121
+ | message_type | 14 |
122
+ | message_length | 80 |
123
+ | transaction_id | 0 |
124
+ | xid | 0 |
125
+ | cookie | 0 |
126
+ | cookie_mask | 0 |
127
+ | table_id | 0 |
128
+ | command | :add |
129
+ | idle_timeout | 0 |
130
+ | hard_timeout | 0 |
131
+ | priority.to_hex | 0xffff |
132
+ | buffer_id | :no_buffer |
133
+ | out_port | :any |
134
+ | out_group | :any |
135
+ | flags | [] |
136
+ | match.match_fields | [] |
137
+ | instructions.size | 1 |
138
+ | instructions.at(0).class | Pio::Apply |
139
+ | instructions.at(0).actions.at(0).class | Pio::OpenFlow13::SendOutPort |
140
+ | instructions.at(0).actions.at(0).port | 1 |