pio 0.23.1 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +2 -0
- data/Rakefile +1 -1
- data/features/open_flow10/barrier_reply.feature +58 -0
- data/features/open_flow10/barrier_request.feature +58 -0
- data/features/open_flow10/echo_reply.feature +50 -40
- data/features/open_flow10/echo_request.feature +54 -51
- data/features/open_flow10/features_reply.feature +62 -63
- data/features/open_flow10/features_request.feature +2 -19
- data/features/open_flow10/flow_mod.feature +1 -0
- data/features/open_flow10/hello.feature +38 -44
- data/features/open_flow10/packet_in.feature +1 -2
- data/features/open_flow10/packet_in.raw +0 -0
- data/features/open_flow10/packet_out.feature +14 -14
- data/features/open_flow10/port_status.feature +17 -17
- data/features/open_flow13/apply_actions.feature +15 -17
- data/features/open_flow13/echo_reply.feature +58 -58
- data/features/open_flow13/echo_request.feature +58 -58
- data/features/open_flow13/features_reply.feature +2 -6
- data/features/open_flow13/features_request.feature +3 -23
- data/features/open_flow13/flow_mod.feature +86 -93
- data/features/open_flow13/goto_table.feature +4 -4
- data/features/open_flow13/hello.feature +8 -15
- data/features/open_flow13/match.feature +14 -3
- data/features/open_flow13/meter.feature +3 -3
- data/features/open_flow13/oxm_experimenter_stratos_basic_dot11.raw +0 -0
- data/features/open_flow13/oxm_invalid_field.raw +0 -0
- data/features/open_flow13/packet_in.feature +15 -20
- data/features/open_flow13/packet_out.feature +39 -42
- data/features/open_flow13/send_out_port.feature +1 -5
- data/features/open_flow13/write_metadata.feature +3 -3
- data/features/open_flow_read.feature +43 -0
- data/features/open_flow_version.feature +10 -0
- data/features/step_definitions/open_flow_steps.rb +10 -2
- data/features/step_definitions/packet_data_steps.rb +4 -0
- data/features/support/hooks.rb +7 -0
- data/lib/pio.rb +1 -1
- data/lib/pio/monkey_patch/integer/ranges.rb +4 -0
- data/lib/pio/open_flow.rb +54 -16
- data/lib/pio/open_flow/datapath_id.rb +26 -0
- data/lib/pio/open_flow/echo.rb +44 -0
- data/lib/pio/open_flow/format.rb +45 -0
- data/lib/pio/open_flow/message.rb +88 -0
- data/lib/pio/open_flow/open_flow_header.rb +0 -14
- data/lib/pio/open_flow10.rb +3 -8
- data/lib/pio/open_flow10/actions.rb +1 -1
- data/lib/pio/open_flow10/barrier_reply.rb +21 -0
- data/lib/pio/open_flow10/barrier_request.rb +22 -0
- data/lib/pio/open_flow10/echo.rb +15 -11
- data/lib/pio/open_flow10/features.rb +99 -71
- data/lib/pio/open_flow10/flow_mod.rb +73 -66
- data/lib/pio/open_flow10/hello.rb +19 -4
- data/lib/pio/open_flow10/match.rb +133 -131
- data/lib/pio/open_flow10/packet_in.rb +55 -49
- data/lib/pio/open_flow10/packet_out.rb +31 -24
- data/lib/pio/open_flow10/port_status.rb +54 -27
- data/lib/pio/open_flow10/send_out_port.rb +66 -64
- data/lib/pio/open_flow13.rb +0 -15
- data/lib/pio/open_flow13/echo.rb +11 -68
- data/lib/pio/open_flow13/features_reply.rb +48 -77
- data/lib/pio/open_flow13/features_request.rb +16 -45
- data/lib/pio/open_flow13/flow_mod.rb +125 -148
- data/lib/pio/open_flow13/goto_table.rb +1 -0
- data/lib/pio/open_flow13/hello.rb +54 -84
- data/lib/pio/open_flow13/match.rb +69 -11
- data/lib/pio/open_flow13/meter.rb +1 -0
- data/lib/pio/open_flow13/packet_in.rb +38 -50
- data/lib/pio/open_flow13/packet_out.rb +50 -75
- data/lib/pio/open_flow13/send_out_port.rb +34 -34
- data/lib/pio/open_flow13/write_metadata.rb +1 -0
- data/lib/pio/parser.rb +3 -0
- data/lib/pio/version.rb +1 -1
- data/pio.gemspec +6 -6
- data/spec/pio/open_flow10/echo_reply_spec.rb +7 -0
- data/spec/pio/open_flow10/echo_request_spec.rb +7 -0
- data/spec/pio/open_flow10/features_reply_spec.rb +8 -0
- data/spec/pio/open_flow10/features_request_spec.rb +13 -0
- data/spec/pio/open_flow10/flow_mod_spec.rb +17 -16
- data/spec/pio/open_flow10/hello_spec.rb +7 -0
- data/spec/pio/open_flow10/match_spec.rb +8 -6
- data/spec/pio/open_flow10/packet_in_spec.rb +14 -0
- data/spec/pio/open_flow10/packet_out_spec.rb +21 -14
- data/spec/pio/open_flow10/send_out_port_spec.rb +4 -4
- data/spec/pio/open_flow10/wildcards_spec.rb +2 -2
- data/spec/pio/open_flow13/echo_reply_spec.rb +7 -0
- data/spec/pio/open_flow13/echo_request_spec.rb +7 -0
- data/spec/pio/open_flow13/features_reply_spec.rb +8 -0
- data/spec/pio/open_flow13/features_request_spec.rb +13 -0
- data/spec/pio/open_flow13/hello_spec.rb +14 -59
- data/spec/pio/open_flow13/packet_in_spec.rb +14 -0
- data/spec/pio/open_flow13/packet_out_spec.rb +7 -0
- data/spec/pio/open_flow_spec.rb +34 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/shared_examples_for_openflow_messages.rb +75 -0
- metadata +215 -170
- data/bin/byebug +0 -16
- data/bin/terminal-notifier +0 -16
- data/lib/pio/open_flow10/message.rb +0 -78
- 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 |
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
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(
|
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(
|
54
|
+
Pio::Echo::Reply.new(body: 'echo reply body')
|
64
55
|
"""
|
65
|
-
Then it should
|
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(
|
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(
|
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 |
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
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 |
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
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 |
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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 |
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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 |
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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(
|
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(
|
54
|
+
Pio::Echo::Request.new(body: 'echo request body')
|
64
55
|
"""
|
65
|
-
Then it should
|
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(
|
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(
|
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 |
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
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 |
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
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
|
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
|
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
|
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 |
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
| instructions.
|
61
|
-
| instructions.at(0).class
|
62
|
-
| instructions.at(0).actions.at(0).
|
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 |
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
| instructions.
|
92
|
-
| instructions.at(0).class
|
93
|
-
| instructions.at(0).actions.at(0).
|
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 |
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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 |
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
| instructions.
|
145
|
-
| instructions.at(0).class
|
146
|
-
| instructions.at(0).actions.at(0).
|
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 |
|