pio 0.18.2 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +40 -344
- data/Rakefile +32 -0
- data/bin/_guard-core +16 -0
- data/bin/byebug +16 -0
- data/bin/cc-tddium-post-worker +16 -0
- data/bin/cdiff +16 -0
- data/bin/coderay +16 -0
- data/bin/colortab +16 -0
- data/bin/coveralls +16 -0
- data/bin/cucumber +16 -0
- data/bin/decolor +16 -0
- data/bin/flay +16 -0
- data/bin/flog +16 -0
- data/bin/guard +16 -0
- data/bin/htmldiff +16 -0
- data/bin/inch +16 -0
- data/bin/ldiff +16 -0
- data/bin/listen +16 -0
- data/bin/minitar +16 -0
- data/bin/pry +16 -0
- data/bin/rake +16 -0
- data/bin/reek +16 -0
- data/bin/relish +16 -0
- data/bin/restclient +16 -0
- data/bin/rspec +16 -0
- data/bin/rubocop +16 -0
- data/bin/ruby-parse +16 -0
- data/bin/ruby-rewrite +16 -0
- data/bin/ruby_parse +16 -0
- data/bin/ruby_parse_extract_error +16 -0
- data/bin/sparkr +16 -0
- data/bin/term_display +16 -0
- data/bin/term_mandel +16 -0
- data/bin/thor +16 -0
- data/bin/unparser +16 -0
- data/bin/yard +16 -0
- data/bin/yardoc +16 -0
- data/bin/yri +16 -0
- data/features/arp.feature +61 -0
- data/features/dhcp.feature +4 -0
- data/features/icmp.feature +130 -0
- data/features/lldp.feature +47 -0
- data/features/open_flow10/echo_reply.feature +95 -0
- data/features/open_flow10/echo_request.feature +95 -0
- data/features/open_flow10/exact_match.feature +36 -0
- data/features/{features_read.feature → open_flow10/features_reply.feature} +54 -17
- data/features/open_flow10/features_request.feature +79 -0
- data/features/{flow_mod_read.feature → open_flow10/flow_mod.feature} +16 -21
- data/features/open_flow10/hello.feature +79 -0
- data/features/open_flow10/packet_in.feature +58 -0
- data/features/{packet_out_read.feature → open_flow10/packet_out.feature} +4 -5
- data/features/open_flow10/port_status.feature +23 -0
- data/features/open_flow13/echo_reply.feature +115 -0
- data/features/open_flow13/echo_request.feature +115 -0
- data/features/open_flow13/hello.feature +74 -0
- data/features/packet_data/echo13_reply_body.raw +0 -0
- data/features/packet_data/echo13_reply_no_body.raw +0 -0
- data/features/packet_data/echo13_request_body.raw +0 -0
- data/features/packet_data/echo13_request_no_body.raw +0 -0
- data/features/packet_data/hello13_no_version_bitmap.raw +0 -0
- data/features/packet_data/hello13_version_bitmap.raw +0 -0
- data/features/packet_data/udp_no_payload.raw +0 -0
- data/features/packet_data/udp_with_payload.raw +0 -0
- data/features/step_definitions/packet_data_steps.rb +49 -29
- data/features/support/env.rb +3 -0
- data/features/{udp_read.feature → udp.feature} +3 -4
- data/lib/pio.rb +1 -0
- data/lib/pio/echo.rb +67 -0
- data/lib/pio/hello13.rb +111 -0
- data/lib/pio/open_flow/message.rb +2 -1
- data/lib/pio/open_flow/open_flow_header.rb +21 -38
- data/lib/pio/open_flow/transaction_id.rb +25 -0
- data/lib/pio/version.rb +1 -1
- data/pio.gemspec +9 -14
- data/spec/pio/flow_mod_spec.rb +1 -1
- data/spec/pio/hello13_spec.rb +114 -0
- metadata +182 -138
- data/examples/arp_new.rb +0 -16
- data/examples/arp_read.rb +0 -4
- data/examples/dhcp_new.rb +0 -34
- data/examples/dhcp_read.rb +0 -4
- data/examples/echo_new.rb +0 -9
- data/examples/echo_read.rb +0 -4
- data/examples/features_new.rb +0 -28
- data/examples/features_read.rb +0 -4
- data/examples/flow_mod_new.rb +0 -13
- data/examples/flow_mod_read.rb +0 -6
- data/examples/hello_new.rb +0 -4
- data/examples/hello_read.rb +0 -4
- data/examples/icmp_new.rb +0 -21
- data/examples/icmp_read.rb +0 -4
- data/examples/lldp_new.rb +0 -4
- data/examples/lldp_read.rb +0 -4
- data/examples/packet_in_new.rb +0 -17
- data/examples/packet_in_read.rb +0 -5
- data/examples/packet_out_new.rb +0 -18
- data/examples/packet_out_read.rb +0 -6
- data/features/arp_read.feature +0 -10
- data/features/dhcp_read.feature +0 -6
- data/features/echo_read.feature +0 -29
- data/features/exact_match.feature +0 -38
- data/features/hello_read.feature +0 -14
- data/features/icmp_read.feature +0 -55
- data/features/lldp_read.feature +0 -26
- data/features/packet_in_read.feature +0 -22
- data/features/port_status_read.feature +0 -24
- data/features/step_definitions/pending_steps.rb +0 -3
- data/spec/pio/echo/reply_spec.rb +0 -135
- data/spec/pio/echo/request_spec.rb +0 -137
- data/spec/pio/features/reply_spec.rb +0 -137
- data/spec/pio/features/request_spec.rb +0 -112
- data/spec/pio/hello_spec.rb +0 -106
- data/spec/pio/lldp_spec.rb +0 -244
- data/spec/pio/packet_in_spec.rb +0 -146
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Feature: Echo Reply
|
|
2
|
+
Scenario: create
|
|
3
|
+
When I try to create an OpenFlow message with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Echo::Reply.new
|
|
6
|
+
"""
|
|
7
|
+
Then it should finish successfully
|
|
8
|
+
And the message have the following fields and values:
|
|
9
|
+
| field | value |
|
|
10
|
+
| class | Pio::Echo::Reply |
|
|
11
|
+
| ofp_version | 1 |
|
|
12
|
+
| message_type | 3 |
|
|
13
|
+
| message_length | 8 |
|
|
14
|
+
| transaction_id | 0 |
|
|
15
|
+
| xid | 0 |
|
|
16
|
+
| user_data | |
|
|
17
|
+
|
|
18
|
+
Scenario: create (transaction_id: 123)
|
|
19
|
+
When I try to create an OpenFlow message with:
|
|
20
|
+
"""
|
|
21
|
+
Pio::Echo::Reply.new(transaction_id: 123)
|
|
22
|
+
"""
|
|
23
|
+
Then it should finish successfully
|
|
24
|
+
And the message have the following fields and values:
|
|
25
|
+
| field | value |
|
|
26
|
+
| class | Pio::Echo::Reply |
|
|
27
|
+
| ofp_version | 1 |
|
|
28
|
+
| message_type | 3 |
|
|
29
|
+
| message_length | 8 |
|
|
30
|
+
| transaction_id | 123 |
|
|
31
|
+
| xid | 123 |
|
|
32
|
+
| user_data | |
|
|
33
|
+
|
|
34
|
+
Scenario: create (xid: 123)
|
|
35
|
+
When I try to create an OpenFlow message with:
|
|
36
|
+
"""
|
|
37
|
+
Pio::Echo::Reply.new(xid: 123)
|
|
38
|
+
"""
|
|
39
|
+
Then it should finish successfully
|
|
40
|
+
And the message have the following fields and values:
|
|
41
|
+
| field | value |
|
|
42
|
+
| class | Pio::Echo::Reply |
|
|
43
|
+
| ofp_version | 1 |
|
|
44
|
+
| message_type | 3 |
|
|
45
|
+
| message_length | 8 |
|
|
46
|
+
| transaction_id | 123 |
|
|
47
|
+
| xid | 123 |
|
|
48
|
+
| user_data | |
|
|
49
|
+
|
|
50
|
+
Scenario: create (xid: -1) and error
|
|
51
|
+
When I try to create an OpenFlow message with:
|
|
52
|
+
"""
|
|
53
|
+
Pio::Echo::Reply.new(xid: -1)
|
|
54
|
+
"""
|
|
55
|
+
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
|
56
|
+
|
|
57
|
+
Scenario: create (xid: 2**32) and error
|
|
58
|
+
When I try to create an OpenFlow message with:
|
|
59
|
+
"""
|
|
60
|
+
Pio::Echo::Reply.new(xid: 2**32)
|
|
61
|
+
"""
|
|
62
|
+
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
|
63
|
+
|
|
64
|
+
Scenario: create (user_data: 'echo reply body')
|
|
65
|
+
When I try to create an OpenFlow message with:
|
|
66
|
+
"""
|
|
67
|
+
Pio::Echo::Reply.new(user_data: 'echo reply body')
|
|
68
|
+
"""
|
|
69
|
+
Then it should finish successfully
|
|
70
|
+
And the message have the following fields and values:
|
|
71
|
+
| field | value |
|
|
72
|
+
| class | Pio::Echo::Reply |
|
|
73
|
+
| ofp_version | 1 |
|
|
74
|
+
| message_type | 3 |
|
|
75
|
+
| message_length | 23 |
|
|
76
|
+
| transaction_id | 0 |
|
|
77
|
+
| xid | 0 |
|
|
78
|
+
| user_data | echo reply body |
|
|
79
|
+
|
|
80
|
+
Scenario: parse (no message body)
|
|
81
|
+
When I try to parse a file named "echo_reply.raw" with "Pio::Echo::Reply" class
|
|
82
|
+
Then it should finish successfully
|
|
83
|
+
And the message have the following fields and values:
|
|
84
|
+
| field | value |
|
|
85
|
+
| class | Pio::Echo::Reply |
|
|
86
|
+
| ofp_version | 1 |
|
|
87
|
+
| message_type | 3 |
|
|
88
|
+
| message_length | 8 |
|
|
89
|
+
| transaction_id | 6 |
|
|
90
|
+
| xid | 6 |
|
|
91
|
+
| user_data | |
|
|
92
|
+
|
|
93
|
+
Scenario: parse error
|
|
94
|
+
When I try to parse a file named "features_reply.raw" with "Pio::Echo::Reply" class
|
|
95
|
+
Then it should fail with "Pio::ParseError", "Invalid Echo Reply message."
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Feature: Echo Request
|
|
2
|
+
Scenario: create
|
|
3
|
+
When I try to create an OpenFlow message with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Echo::Request.new
|
|
6
|
+
"""
|
|
7
|
+
Then it should finish successfully
|
|
8
|
+
And the message have the following fields and values:
|
|
9
|
+
| field | value |
|
|
10
|
+
| class | Pio::Echo::Request |
|
|
11
|
+
| ofp_version | 1 |
|
|
12
|
+
| message_type | 2 |
|
|
13
|
+
| message_length | 8 |
|
|
14
|
+
| transaction_id | 0 |
|
|
15
|
+
| xid | 0 |
|
|
16
|
+
| user_data | |
|
|
17
|
+
|
|
18
|
+
Scenario: create (transaction_id: 123)
|
|
19
|
+
When I try to create an OpenFlow message with:
|
|
20
|
+
"""
|
|
21
|
+
Pio::Echo::Request.new(transaction_id: 123)
|
|
22
|
+
"""
|
|
23
|
+
Then it should finish successfully
|
|
24
|
+
And the message have the following fields and values:
|
|
25
|
+
| field | value |
|
|
26
|
+
| class | Pio::Echo::Request |
|
|
27
|
+
| ofp_version | 1 |
|
|
28
|
+
| message_type | 2 |
|
|
29
|
+
| message_length | 8 |
|
|
30
|
+
| transaction_id | 123 |
|
|
31
|
+
| xid | 123 |
|
|
32
|
+
| user_data | |
|
|
33
|
+
|
|
34
|
+
Scenario: create (xid: 123)
|
|
35
|
+
When I try to create an OpenFlow message with:
|
|
36
|
+
"""
|
|
37
|
+
Pio::Echo::Request.new(xid: 123)
|
|
38
|
+
"""
|
|
39
|
+
Then it should finish successfully
|
|
40
|
+
And the message have the following fields and values:
|
|
41
|
+
| field | value |
|
|
42
|
+
| class | Pio::Echo::Request |
|
|
43
|
+
| ofp_version | 1 |
|
|
44
|
+
| message_type | 2 |
|
|
45
|
+
| message_length | 8 |
|
|
46
|
+
| transaction_id | 123 |
|
|
47
|
+
| xid | 123 |
|
|
48
|
+
| user_data | |
|
|
49
|
+
|
|
50
|
+
Scenario: create (xid: -1) and error
|
|
51
|
+
When I try to create an OpenFlow message with:
|
|
52
|
+
"""
|
|
53
|
+
Pio::Echo::Request.new(xid: -1)
|
|
54
|
+
"""
|
|
55
|
+
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
|
56
|
+
|
|
57
|
+
Scenario: create (xid: 2**32) and error
|
|
58
|
+
When I try to create an OpenFlow message with:
|
|
59
|
+
"""
|
|
60
|
+
Pio::Echo::Request.new(xid: 2**32)
|
|
61
|
+
"""
|
|
62
|
+
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
|
63
|
+
|
|
64
|
+
Scenario: create (user_data: 'echo request body')
|
|
65
|
+
When I try to create an OpenFlow message with:
|
|
66
|
+
"""
|
|
67
|
+
Pio::Echo::Request.new(user_data: 'echo request body')
|
|
68
|
+
"""
|
|
69
|
+
Then it should finish successfully
|
|
70
|
+
And the message have the following fields and values:
|
|
71
|
+
| field | value |
|
|
72
|
+
| class | Pio::Echo::Request |
|
|
73
|
+
| ofp_version | 1 |
|
|
74
|
+
| message_type | 2 |
|
|
75
|
+
| message_length | 25 |
|
|
76
|
+
| transaction_id | 0 |
|
|
77
|
+
| xid | 0 |
|
|
78
|
+
| user_data | echo request body |
|
|
79
|
+
|
|
80
|
+
Scenario: parse (no message body)
|
|
81
|
+
When I try to parse a file named "echo_request.raw" with "Pio::Echo::Request" class
|
|
82
|
+
Then it should finish successfully
|
|
83
|
+
And the message have the following fields and values:
|
|
84
|
+
| field | value |
|
|
85
|
+
| class | Pio::Echo::Request |
|
|
86
|
+
| ofp_version | 1 |
|
|
87
|
+
| message_type | 2 |
|
|
88
|
+
| message_length | 8 |
|
|
89
|
+
| transaction_id | 0 |
|
|
90
|
+
| xid | 0 |
|
|
91
|
+
| user_data | |
|
|
92
|
+
|
|
93
|
+
Scenario: parse error
|
|
94
|
+
When I try to parse a file named "features_request.raw" with "Pio::Echo::Request" class
|
|
95
|
+
Then it should fail with "Pio::ParseError", "Invalid Echo Request message."
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Feature: Exact Match
|
|
2
|
+
Scenario: parse #1
|
|
3
|
+
When I create an exact match from "packet_in_arp_request.raw"
|
|
4
|
+
And the message have the following fields and values:
|
|
5
|
+
| field | value |
|
|
6
|
+
| wildcards | {} |
|
|
7
|
+
| in_port | 1 |
|
|
8
|
+
| dl_src | ac:5d:10:31:37:79 |
|
|
9
|
+
| dl_dst | ff:ff:ff:ff:ff:ff |
|
|
10
|
+
| dl_vlan | 65535 |
|
|
11
|
+
| dl_vlan_pcp | 0 |
|
|
12
|
+
| dl_type | 2054 |
|
|
13
|
+
| nw_tos | 0 |
|
|
14
|
+
| nw_proto | 1 |
|
|
15
|
+
| nw_src | 192.168.2.254 |
|
|
16
|
+
| nw_dst | 192.168.2.5 |
|
|
17
|
+
| tp_src | 0 |
|
|
18
|
+
| tp_dst | 0 |
|
|
19
|
+
|
|
20
|
+
Scenario: parse #2
|
|
21
|
+
When I create an exact match from "packet_in_cbench.raw"
|
|
22
|
+
And the message have the following fields and values:
|
|
23
|
+
| field | value |
|
|
24
|
+
| wildcards | {} |
|
|
25
|
+
| in_port | 1 |
|
|
26
|
+
| dl_src | 00:00:00:00:00:01 |
|
|
27
|
+
| dl_dst | 80:00:00:00:00:01 |
|
|
28
|
+
| dl_vlan | 65535 |
|
|
29
|
+
| dl_vlan_pcp | 0 |
|
|
30
|
+
| dl_type | 2048 |
|
|
31
|
+
| nw_tos | 0 |
|
|
32
|
+
| nw_proto | 255 |
|
|
33
|
+
| nw_src | 192.168.0.40 |
|
|
34
|
+
| nw_dst | 192.168.1.40 |
|
|
35
|
+
| tp_src | 31256 |
|
|
36
|
+
| tp_dst | 22635 |
|
|
@@ -1,23 +1,56 @@
|
|
|
1
|
-
Feature:
|
|
2
|
-
Scenario:
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
Feature: Features Reply
|
|
2
|
+
Scenario: create
|
|
3
|
+
When I try to create an OpenFlow message with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Features::Reply.new(
|
|
6
|
+
dpid: 0x123,
|
|
7
|
+
n_buffers: 0x100,
|
|
8
|
+
n_tables: 0xfe,
|
|
9
|
+
capabilities: [:flow_stats, :table_stats, :port_stats, :queue_stats,
|
|
10
|
+
:arp_match_ip],
|
|
11
|
+
actions: [:output, :set_vlan_vid, :set_vlan_pcp, :strip_vlan,
|
|
12
|
+
:set_dl_src, :set_dl_dst, :set_nw_src, :set_nw_dst,
|
|
13
|
+
:set_nw_tos, :set_tp_src, :set_tp_dst, :enqueue],
|
|
14
|
+
ports: [{ port_no: 1,
|
|
15
|
+
hardware_address: '11:22:33:44:55:66',
|
|
16
|
+
name: 'port123',
|
|
17
|
+
config: [:port_down],
|
|
18
|
+
state: [:link_down],
|
|
19
|
+
curr: [:port_10gb_fd, :port_copper] }]
|
|
20
|
+
)
|
|
21
|
+
"""
|
|
5
22
|
Then it should finish successfully
|
|
6
|
-
And the
|
|
7
|
-
| field
|
|
8
|
-
| class
|
|
9
|
-
| ofp_version
|
|
10
|
-
| message_type
|
|
11
|
-
| message_length
|
|
12
|
-
| transaction_id
|
|
13
|
-
| xid
|
|
14
|
-
|
|
|
23
|
+
And the message have the following fields and values:
|
|
24
|
+
| field | value |
|
|
25
|
+
| class | Pio::Features::Reply |
|
|
26
|
+
| ofp_version | 1 |
|
|
27
|
+
| message_type | 6 |
|
|
28
|
+
| message_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_dl_src, :set_dl_dst, :set_nw_src, :set_nw_dst, :set_nw_tos, :set_tp_src, :set_tp_dst, :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 | [] |
|
|
15
49
|
|
|
16
|
-
Scenario:
|
|
17
|
-
|
|
18
|
-
When I try to parse the file with "Features::Reply" class
|
|
50
|
+
Scenario: parse
|
|
51
|
+
When I try to parse a file named "features_reply.raw" with "Features::Reply" class
|
|
19
52
|
Then it should finish successfully
|
|
20
|
-
And the
|
|
53
|
+
And the message have the following fields and values:
|
|
21
54
|
| field | value |
|
|
22
55
|
| class | Pio::Features::Reply |
|
|
23
56
|
| ofp_version | 1 |
|
|
@@ -57,3 +90,7 @@ Feature: Pio::Features.read
|
|
|
57
90
|
| ports.last.up? | true |
|
|
58
91
|
| ports.last.down? | false |
|
|
59
92
|
| ports.last.local? | false |
|
|
93
|
+
|
|
94
|
+
Scenario: parse error
|
|
95
|
+
When I try to parse a file named "echo_reply.raw" with "Pio::Features::Reply" class
|
|
96
|
+
Then it should fail with "Pio::ParseError", "Invalid Features Reply message."
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Feature: Features Request
|
|
2
|
+
Scenario: create
|
|
3
|
+
When I try to create an OpenFlow message with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Features::Request.new
|
|
6
|
+
"""
|
|
7
|
+
Then it should finish successfully
|
|
8
|
+
And the message have the following fields and values:
|
|
9
|
+
| field | value |
|
|
10
|
+
| class | Pio::Features::Request |
|
|
11
|
+
| ofp_version | 1 |
|
|
12
|
+
| message_type | 5 |
|
|
13
|
+
| message_length | 8 |
|
|
14
|
+
| transaction_id | 0 |
|
|
15
|
+
| xid | 0 |
|
|
16
|
+
| user_data | |
|
|
17
|
+
|
|
18
|
+
Scenario: create (transaction_id: 123)
|
|
19
|
+
When I try to create an OpenFlow message with:
|
|
20
|
+
"""
|
|
21
|
+
Pio::Features::Request.new(transaction_id: 123)
|
|
22
|
+
"""
|
|
23
|
+
Then it should finish successfully
|
|
24
|
+
And the message have the following fields and values:
|
|
25
|
+
| field | value |
|
|
26
|
+
| class | Pio::Features::Request |
|
|
27
|
+
| ofp_version | 1 |
|
|
28
|
+
| message_type | 5 |
|
|
29
|
+
| message_length | 8 |
|
|
30
|
+
| transaction_id | 123 |
|
|
31
|
+
| xid | 123 |
|
|
32
|
+
| user_data | |
|
|
33
|
+
|
|
34
|
+
Scenario: create (xid: 123)
|
|
35
|
+
When I try to create an OpenFlow message with:
|
|
36
|
+
"""
|
|
37
|
+
Pio::Features::Request.new(xid: 123)
|
|
38
|
+
"""
|
|
39
|
+
Then it should finish successfully
|
|
40
|
+
And the message have the following fields and values:
|
|
41
|
+
| field | value |
|
|
42
|
+
| class | Pio::Features::Request |
|
|
43
|
+
| ofp_version | 1 |
|
|
44
|
+
| message_type | 5 |
|
|
45
|
+
| message_length | 8 |
|
|
46
|
+
| transaction_id | 123 |
|
|
47
|
+
| xid | 123 |
|
|
48
|
+
| user_data | |
|
|
49
|
+
|
|
50
|
+
Scenario: create (xid: -1) and error
|
|
51
|
+
When I try to create an OpenFlow message with:
|
|
52
|
+
"""
|
|
53
|
+
Pio::Features::Request.new(xid: -1)
|
|
54
|
+
"""
|
|
55
|
+
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
|
56
|
+
|
|
57
|
+
Scenario: create (xid: 2**32) and error
|
|
58
|
+
When I try to create an OpenFlow message with:
|
|
59
|
+
"""
|
|
60
|
+
Pio::Features::Request.new(xid: 2**32)
|
|
61
|
+
"""
|
|
62
|
+
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
|
63
|
+
|
|
64
|
+
Scenario: parse
|
|
65
|
+
When I try to parse a file named "features_request.raw" with "Pio::Features::Request" class
|
|
66
|
+
Then it should finish successfully
|
|
67
|
+
And the message have the following fields and values:
|
|
68
|
+
| field | value |
|
|
69
|
+
| class | Pio::Features::Request |
|
|
70
|
+
| ofp_version | 1 |
|
|
71
|
+
| message_type | 5 |
|
|
72
|
+
| message_length | 8 |
|
|
73
|
+
| transaction_id | 2 |
|
|
74
|
+
| xid | 2 |
|
|
75
|
+
| user_data | |
|
|
76
|
+
|
|
77
|
+
Scenario: parse error
|
|
78
|
+
When I try to parse a file named "echo_request.raw" with "Pio::Features::Request" class
|
|
79
|
+
Then it should fail with "Pio::ParseError", "Invalid Features Request message."
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
Feature:
|
|
2
|
-
Scenario:
|
|
3
|
-
|
|
4
|
-
When I try to parse the file with "FlowMod" class
|
|
1
|
+
Feature: Flow Mod
|
|
2
|
+
Scenario: parse (Flow Mod Add)
|
|
3
|
+
When I try to parse a file named "flow_mod_add.raw" with "FlowMod" class
|
|
5
4
|
Then it should finish successfully
|
|
6
|
-
And the
|
|
5
|
+
And the message have the following fields and values:
|
|
7
6
|
| field | value |
|
|
8
7
|
| ofp_version | 1 |
|
|
9
8
|
| message_type | 14 |
|
|
@@ -37,11 +36,10 @@ Feature: Pio::FlowMod.read
|
|
|
37
36
|
| actions.first.class | Pio::SetVlanVid |
|
|
38
37
|
| actions.first.vlan_id | 10 |
|
|
39
38
|
|
|
40
|
-
Scenario:
|
|
41
|
-
|
|
42
|
-
When I try to parse the file with "FlowMod" class
|
|
39
|
+
Scenario: parse (Flow Mod Modify)
|
|
40
|
+
When I try to parse a file named "flow_mod_modify.raw" with "FlowMod" class
|
|
43
41
|
Then it should finish successfully
|
|
44
|
-
And the
|
|
42
|
+
And the message have the following fields and values:
|
|
45
43
|
| field | value |
|
|
46
44
|
| ofp_version | 1 |
|
|
47
45
|
| message_type | 14 |
|
|
@@ -75,11 +73,10 @@ Feature: Pio::FlowMod.read
|
|
|
75
73
|
| actions.first.class | Pio::SetVlanVid |
|
|
76
74
|
| actions.first.vlan_id | 10 |
|
|
77
75
|
|
|
78
|
-
Scenario:
|
|
79
|
-
|
|
80
|
-
When I try to parse the file with "FlowMod" class
|
|
76
|
+
Scenario: parse (Flow Mod Modify Strict)
|
|
77
|
+
When I try to parse a file named "flow_mod_modify_strict.raw" with "FlowMod" class
|
|
81
78
|
Then it should finish successfully
|
|
82
|
-
And the
|
|
79
|
+
And the message have the following fields and values:
|
|
83
80
|
| field | value |
|
|
84
81
|
| ofp_version | 1 |
|
|
85
82
|
| message_type | 14 |
|
|
@@ -113,11 +110,10 @@ Scenario: flow_mod_modify_strict.raw
|
|
|
113
110
|
| actions.first.class | Pio::SetVlanVid |
|
|
114
111
|
| actions.first.vlan_id | 10 |
|
|
115
112
|
|
|
116
|
-
Scenario:
|
|
117
|
-
|
|
118
|
-
When I try to parse the file with "FlowMod" class
|
|
113
|
+
Scenario: parse (Flow Mod Delete)
|
|
114
|
+
When I try to parse a file named "flow_mod_delete.raw" with "FlowMod" class
|
|
119
115
|
Then it should finish successfully
|
|
120
|
-
And the
|
|
116
|
+
And the message have the following fields and values:
|
|
121
117
|
| field | value |
|
|
122
118
|
| ofp_version | 1 |
|
|
123
119
|
| message_type | 14 |
|
|
@@ -149,11 +145,10 @@ Scenario: flow_mod_modify_strict.raw
|
|
|
149
145
|
| flags | [] |
|
|
150
146
|
| actions | [] |
|
|
151
147
|
|
|
152
|
-
Scenario:
|
|
153
|
-
|
|
154
|
-
When I try to parse the file with "FlowMod" class
|
|
148
|
+
Scenario: parse (Flow Mod Delete Strict)
|
|
149
|
+
When I try to parse a file named "flow_mod_delete_strict.raw" with "FlowMod" class
|
|
155
150
|
Then it should finish successfully
|
|
156
|
-
And the
|
|
151
|
+
And the message have the following fields and values:
|
|
157
152
|
| field | value |
|
|
158
153
|
| ofp_version | 1 |
|
|
159
154
|
| message_type | 14 |
|