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,79 @@
|
|
|
1
|
+
Feature: Hello
|
|
2
|
+
Scenario: create
|
|
3
|
+
When I try to create an OpenFlow message with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Hello.new
|
|
6
|
+
"""
|
|
7
|
+
Then it should finish successfully
|
|
8
|
+
And the message have the following fields and values:
|
|
9
|
+
| field | value |
|
|
10
|
+
| class | Pio::Hello |
|
|
11
|
+
| ofp_version | 1 |
|
|
12
|
+
| message_type | 0 |
|
|
13
|
+
| message_length | 8 |
|
|
14
|
+
| transaction_id | 0 |
|
|
15
|
+
| xid | 0 |
|
|
16
|
+
| body | |
|
|
17
|
+
|
|
18
|
+
Scenario: create (transaction_id: 123)
|
|
19
|
+
When I try to create an OpenFlow message with:
|
|
20
|
+
"""
|
|
21
|
+
Pio::Hello.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::Hello |
|
|
27
|
+
| ofp_version | 1 |
|
|
28
|
+
| message_type | 0 |
|
|
29
|
+
| message_length | 8 |
|
|
30
|
+
| transaction_id | 123 |
|
|
31
|
+
| xid | 123 |
|
|
32
|
+
| body | |
|
|
33
|
+
|
|
34
|
+
Scenario: create (xid: 123)
|
|
35
|
+
When I try to create an OpenFlow message with:
|
|
36
|
+
"""
|
|
37
|
+
Pio::Hello.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::Hello |
|
|
43
|
+
| ofp_version | 1 |
|
|
44
|
+
| message_type | 0 |
|
|
45
|
+
| message_length | 8 |
|
|
46
|
+
| transaction_id | 123 |
|
|
47
|
+
| xid | 123 |
|
|
48
|
+
| body | |
|
|
49
|
+
|
|
50
|
+
Scenario: create (xid: -1) and error
|
|
51
|
+
When I try to create an OpenFlow message with:
|
|
52
|
+
"""
|
|
53
|
+
Pio::Hello.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::Hello.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 "hello.raw" with "Hello" class
|
|
66
|
+
Then it should finish successfully
|
|
67
|
+
And the message have the following fields and values:
|
|
68
|
+
| field | value |
|
|
69
|
+
| class | Pio::Hello |
|
|
70
|
+
| ofp_version | 1 |
|
|
71
|
+
| message_type | 0 |
|
|
72
|
+
| message_length | 8 |
|
|
73
|
+
| transaction_id | 23 |
|
|
74
|
+
| xid | 23 |
|
|
75
|
+
| body | |
|
|
76
|
+
|
|
77
|
+
Scenario: parse error
|
|
78
|
+
When I try to parse a file named "features_request.raw" with "Pio::Hello" class
|
|
79
|
+
Then it should fail with "Pio::ParseError", "Invalid Hello message."
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Feature: Packet In
|
|
2
|
+
Scenario: create
|
|
3
|
+
When I try to create an OpenFlow message with:
|
|
4
|
+
"""
|
|
5
|
+
data_dump = [
|
|
6
|
+
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xac, 0x5d, 0x10, 0x31, 0x37,
|
|
7
|
+
0x79, 0x08, 0x06, 0x00, 0x01, 0x08, 0x00, 0x06, 0x04, 0x00, 0x01,
|
|
8
|
+
0xac, 0x5d, 0x10, 0x31, 0x37, 0x79, 0xc0, 0xa8, 0x02, 0xfe, 0xff,
|
|
9
|
+
0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xa8, 0x02, 0x05, 0x00, 0x00,
|
|
10
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
11
|
+
0x00, 0x00, 0x00, 0x00, 0x00
|
|
12
|
+
].pack('C*')
|
|
13
|
+
|
|
14
|
+
Pio::PacketIn.new(transaction_id: 0,
|
|
15
|
+
buffer_id: 0xffffff00,
|
|
16
|
+
in_port: 1,
|
|
17
|
+
reason: :no_match,
|
|
18
|
+
raw_data: data_dump)
|
|
19
|
+
"""
|
|
20
|
+
Then it should finish successfully
|
|
21
|
+
And the message have the following fields and values:
|
|
22
|
+
| field | value |
|
|
23
|
+
| class | Pio::PacketIn |
|
|
24
|
+
| ofp_version | 1 |
|
|
25
|
+
| message_type | 10 |
|
|
26
|
+
| message_length | 78 |
|
|
27
|
+
| transaction_id | 0 |
|
|
28
|
+
| xid | 0 |
|
|
29
|
+
| buffer_id | 4294967040 |
|
|
30
|
+
| total_len | 60 |
|
|
31
|
+
| in_port | 1 |
|
|
32
|
+
| reason | no_match |
|
|
33
|
+
| raw_data.length | 60 |
|
|
34
|
+
| source_mac | ac:5d:10:31:37:79 |
|
|
35
|
+
| source_mac.class | Pio::Mac |
|
|
36
|
+
| destination_mac | ff:ff:ff:ff:ff:ff |
|
|
37
|
+
| destination_mac.class | Pio::Mac |
|
|
38
|
+
|
|
39
|
+
Scenario: parse
|
|
40
|
+
When I try to parse a file named "packet_in_arp_request.raw" with "PacketIn" class
|
|
41
|
+
Then it should finish successfully
|
|
42
|
+
And the message have the following fields and values:
|
|
43
|
+
| field | value |
|
|
44
|
+
| class | Pio::PacketIn |
|
|
45
|
+
| ofp_version | 1 |
|
|
46
|
+
| message_type | 10 |
|
|
47
|
+
| message_length | 78 |
|
|
48
|
+
| transaction_id | 0 |
|
|
49
|
+
| xid | 0 |
|
|
50
|
+
| buffer_id | 4294967040 |
|
|
51
|
+
| total_len | 60 |
|
|
52
|
+
| in_port | 1 |
|
|
53
|
+
| reason | no_match |
|
|
54
|
+
| raw_data.length | 60 |
|
|
55
|
+
| source_mac | ac:5d:10:31:37:79 |
|
|
56
|
+
| source_mac.class | Pio::Mac |
|
|
57
|
+
| destination_mac | ff:ff:ff:ff:ff:ff |
|
|
58
|
+
| destination_mac.class | Pio::Mac |
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
Feature:
|
|
2
|
-
Scenario:
|
|
3
|
-
|
|
4
|
-
When I try to parse the file with "PacketOut" class
|
|
1
|
+
Feature: Packet Out
|
|
2
|
+
Scenario: parse
|
|
3
|
+
When I try to parse a file named "packet_out.raw" with "PacketOut" 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
|
| class | Pio::PacketOut |
|
|
9
8
|
| ofp_version | 1 |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Feature: Port Status
|
|
2
|
+
Scenario: parse
|
|
3
|
+
When I try to parse a file named "port_status.raw" with "PortStatus" class
|
|
4
|
+
Then it should finish successfully
|
|
5
|
+
And the message have the following fields and values:
|
|
6
|
+
| field | value |
|
|
7
|
+
| class | Pio::PortStatus |
|
|
8
|
+
| ofp_version | 1 |
|
|
9
|
+
| message_type | 12 |
|
|
10
|
+
| message_length | 64 |
|
|
11
|
+
| transaction_id | 4 |
|
|
12
|
+
| xid | 4 |
|
|
13
|
+
| reason | delete |
|
|
14
|
+
| desc.port_no | 65533 |
|
|
15
|
+
| desc.hardware_address | 01:02:03:04:05:06 |
|
|
16
|
+
| desc.name | foo |
|
|
17
|
+
| desc.config | [:no_flood] |
|
|
18
|
+
| desc.state | [:stp_forward, :stp_block] |
|
|
19
|
+
| desc.curr | [:port_10mb_hd] |
|
|
20
|
+
| desc.advertised | [:port_1gb_fd] |
|
|
21
|
+
| desc.supported | [:port_autoneg] |
|
|
22
|
+
| desc.peer | [:port_pause_asym] |
|
|
23
|
+
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Feature: Echo Reply
|
|
2
|
+
Scenario: create
|
|
3
|
+
When I try to create an OpenFlow message with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Echo13::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::Echo13::Reply |
|
|
11
|
+
| ofp_version | 4 |
|
|
12
|
+
| message_type | 3 |
|
|
13
|
+
| message_length | 8 |
|
|
14
|
+
| transaction_id | 0 |
|
|
15
|
+
| xid | 0 |
|
|
16
|
+
| body | |
|
|
17
|
+
|
|
18
|
+
Scenario: create (transaction_id: 123)
|
|
19
|
+
When I try to create an OpenFlow message with:
|
|
20
|
+
"""
|
|
21
|
+
Pio::Echo13::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::Echo13::Reply |
|
|
27
|
+
| ofp_version | 4 |
|
|
28
|
+
| message_type | 3 |
|
|
29
|
+
| message_length | 8 |
|
|
30
|
+
| transaction_id | 123 |
|
|
31
|
+
| xid | 123 |
|
|
32
|
+
| body | |
|
|
33
|
+
|
|
34
|
+
Scenario: create (xid: 123)
|
|
35
|
+
When I try to create an OpenFlow message with:
|
|
36
|
+
"""
|
|
37
|
+
Pio::Echo13::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::Echo13::Reply |
|
|
43
|
+
| ofp_version | 4 |
|
|
44
|
+
| message_type | 3 |
|
|
45
|
+
| message_length | 8 |
|
|
46
|
+
| transaction_id | 123 |
|
|
47
|
+
| xid | 123 |
|
|
48
|
+
| body | |
|
|
49
|
+
|
|
50
|
+
Scenario: create (xid: -1) and error
|
|
51
|
+
When I try to create an OpenFlow message with:
|
|
52
|
+
"""
|
|
53
|
+
Pio::Echo13::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::Echo13::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 (body: 'echo reply body')
|
|
65
|
+
When I try to create an OpenFlow message with:
|
|
66
|
+
"""
|
|
67
|
+
Pio::Echo13::Reply.new(body: '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::Echo13::Reply |
|
|
73
|
+
| ofp_version | 4 |
|
|
74
|
+
| message_type | 3 |
|
|
75
|
+
| message_length | 23 |
|
|
76
|
+
| transaction_id | 0 |
|
|
77
|
+
| xid | 0 |
|
|
78
|
+
| body | echo reply body |
|
|
79
|
+
|
|
80
|
+
Scenario: create (unknown_attr: 'foo') and error
|
|
81
|
+
When I try to create an OpenFlow message with:
|
|
82
|
+
"""
|
|
83
|
+
Pio::Echo13::Reply.new(unknown_attr: 'foo')
|
|
84
|
+
"""
|
|
85
|
+
Then it should fail with "RuntimeError", "Unknown keyword: unknown_attr"
|
|
86
|
+
|
|
87
|
+
Scenario: parse (no message body)
|
|
88
|
+
When I try to parse a file named "echo13_reply_no_body.raw" with "Pio::Echo13::Reply" class
|
|
89
|
+
Then it should finish successfully
|
|
90
|
+
And the message have the following fields and values:
|
|
91
|
+
| field | value |
|
|
92
|
+
| class | Pio::Echo13::Reply |
|
|
93
|
+
| ofp_version | 4 |
|
|
94
|
+
| message_type | 3 |
|
|
95
|
+
| message_length | 8 |
|
|
96
|
+
| transaction_id | 0 |
|
|
97
|
+
| xid | 0 |
|
|
98
|
+
| body | |
|
|
99
|
+
|
|
100
|
+
Scenario: parse
|
|
101
|
+
When I try to parse a file named "echo13_reply_body.raw" with "Pio::Echo13::Reply" class
|
|
102
|
+
Then it should finish successfully
|
|
103
|
+
And the message have the following fields and values:
|
|
104
|
+
| field | value |
|
|
105
|
+
| class | Pio::Echo13::Reply |
|
|
106
|
+
| ofp_version | 4 |
|
|
107
|
+
| message_type | 3 |
|
|
108
|
+
| message_length | 28 |
|
|
109
|
+
| transaction_id | 0 |
|
|
110
|
+
| xid | 0 |
|
|
111
|
+
| body | hogehogehogehogehoge |
|
|
112
|
+
|
|
113
|
+
Scenario: parse error
|
|
114
|
+
When I try to parse a file named "features_request.raw" with "Pio::Echo13::Reply" class
|
|
115
|
+
Then it should fail with "Pio::ParseError", "Invalid Echo Reply 1.3 message."
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Feature: Echo Request
|
|
2
|
+
Scenario: create
|
|
3
|
+
When I try to create an OpenFlow message with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Echo13::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::Echo13::Request |
|
|
11
|
+
| ofp_version | 4 |
|
|
12
|
+
| message_type | 2 |
|
|
13
|
+
| message_length | 8 |
|
|
14
|
+
| transaction_id | 0 |
|
|
15
|
+
| xid | 0 |
|
|
16
|
+
| body | |
|
|
17
|
+
|
|
18
|
+
Scenario: create (transaction_id: 123)
|
|
19
|
+
When I try to create an OpenFlow message with:
|
|
20
|
+
"""
|
|
21
|
+
Pio::Echo13::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::Echo13::Request |
|
|
27
|
+
| ofp_version | 4 |
|
|
28
|
+
| message_type | 2 |
|
|
29
|
+
| message_length | 8 |
|
|
30
|
+
| transaction_id | 123 |
|
|
31
|
+
| xid | 123 |
|
|
32
|
+
| body | |
|
|
33
|
+
|
|
34
|
+
Scenario: create (xid: 123)
|
|
35
|
+
When I try to create an OpenFlow message with:
|
|
36
|
+
"""
|
|
37
|
+
Pio::Echo13::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::Echo13::Request |
|
|
43
|
+
| ofp_version | 4 |
|
|
44
|
+
| message_type | 2 |
|
|
45
|
+
| message_length | 8 |
|
|
46
|
+
| transaction_id | 123 |
|
|
47
|
+
| xid | 123 |
|
|
48
|
+
| body | |
|
|
49
|
+
|
|
50
|
+
Scenario: create (xid: -1) and error
|
|
51
|
+
When I try to create an OpenFlow message with:
|
|
52
|
+
"""
|
|
53
|
+
Pio::Echo13::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::Echo13::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 (body: 'echo request body')
|
|
65
|
+
When I try to create an OpenFlow message with:
|
|
66
|
+
"""
|
|
67
|
+
Pio::Echo13::Request.new(body: '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::Echo13::Request |
|
|
73
|
+
| ofp_version | 4 |
|
|
74
|
+
| message_type | 2 |
|
|
75
|
+
| message_length | 25 |
|
|
76
|
+
| transaction_id | 0 |
|
|
77
|
+
| xid | 0 |
|
|
78
|
+
| body | echo request body |
|
|
79
|
+
|
|
80
|
+
Scenario: create (unknown_attr: 'foo') and error
|
|
81
|
+
When I try to create an OpenFlow message with:
|
|
82
|
+
"""
|
|
83
|
+
Pio::Echo13::Request.new(unknown_attr: 'foo')
|
|
84
|
+
"""
|
|
85
|
+
Then it should fail with "RuntimeError", "Unknown keyword: unknown_attr"
|
|
86
|
+
|
|
87
|
+
Scenario: parse (no message body)
|
|
88
|
+
When I try to parse a file named "echo13_request_no_body.raw" with "Pio::Echo13::Request" class
|
|
89
|
+
Then it should finish successfully
|
|
90
|
+
And the message have the following fields and values:
|
|
91
|
+
| field | value |
|
|
92
|
+
| class | Pio::Echo13::Request |
|
|
93
|
+
| ofp_version | 4 |
|
|
94
|
+
| message_type | 2 |
|
|
95
|
+
| message_length | 8 |
|
|
96
|
+
| transaction_id | 0 |
|
|
97
|
+
| xid | 0 |
|
|
98
|
+
| body | |
|
|
99
|
+
|
|
100
|
+
Scenario: parse
|
|
101
|
+
When I try to parse a file named "echo13_request_body.raw" with "Pio::Echo13::Request" class
|
|
102
|
+
Then it should finish successfully
|
|
103
|
+
And the message have the following fields and values:
|
|
104
|
+
| field | value |
|
|
105
|
+
| class | Pio::Echo13::Request |
|
|
106
|
+
| ofp_version | 4 |
|
|
107
|
+
| message_type | 2 |
|
|
108
|
+
| message_length | 28 |
|
|
109
|
+
| transaction_id | 0 |
|
|
110
|
+
| xid | 0 |
|
|
111
|
+
| body | hogehogehogehogehoge |
|
|
112
|
+
|
|
113
|
+
Scenario: parse error
|
|
114
|
+
When I try to parse a file named "features_request.raw" with "Pio::Echo13::Request" class
|
|
115
|
+
Then it should fail with "Pio::ParseError", "Invalid Echo Request 1.3 message."
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Feature: Hello
|
|
2
|
+
Scenario: create
|
|
3
|
+
When I try to create an OpenFlow message with:
|
|
4
|
+
"""
|
|
5
|
+
Pio::Hello13.new
|
|
6
|
+
"""
|
|
7
|
+
Then it should finish successfully
|
|
8
|
+
And the message have the following fields and values:
|
|
9
|
+
| field | value |
|
|
10
|
+
| class | Pio::Hello13 |
|
|
11
|
+
| ofp_version | 4 |
|
|
12
|
+
| message_type | 0 |
|
|
13
|
+
| message_length | 16 |
|
|
14
|
+
| transaction_id | 0 |
|
|
15
|
+
| xid | 0 |
|
|
16
|
+
| supported_versions | [:open_flow13] |
|
|
17
|
+
|
|
18
|
+
Scenario: create (transaction_id: 123)
|
|
19
|
+
When I try to create an OpenFlow message with:
|
|
20
|
+
"""
|
|
21
|
+
Pio::Hello13.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::Hello13 |
|
|
27
|
+
| ofp_version | 4 |
|
|
28
|
+
| message_type | 0 |
|
|
29
|
+
| message_length | 16 |
|
|
30
|
+
| transaction_id | 123 |
|
|
31
|
+
| xid | 123 |
|
|
32
|
+
| supported_versions | [:open_flow13] |
|
|
33
|
+
|
|
34
|
+
Scenario: create (xid: 123)
|
|
35
|
+
When I try to create an OpenFlow message with:
|
|
36
|
+
"""
|
|
37
|
+
Pio::Hello13.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::Hello13 |
|
|
43
|
+
| ofp_version | 4 |
|
|
44
|
+
| message_type | 0 |
|
|
45
|
+
| message_length | 16 |
|
|
46
|
+
| transaction_id | 123 |
|
|
47
|
+
| xid | 123 |
|
|
48
|
+
| supported_versions | [:open_flow13] |
|
|
49
|
+
|
|
50
|
+
Scenario: parse (no version bitmap)
|
|
51
|
+
When I try to parse a file named "hello13_no_version_bitmap.raw" with "Hello13" class
|
|
52
|
+
Then it should finish successfully
|
|
53
|
+
And the message have the following fields and values:
|
|
54
|
+
| field | value |
|
|
55
|
+
| class | Pio::Hello13 |
|
|
56
|
+
| ofp_version | 4 |
|
|
57
|
+
| message_type | 0 |
|
|
58
|
+
| message_length | 8 |
|
|
59
|
+
| transaction_id | 0 |
|
|
60
|
+
| xid | 0 |
|
|
61
|
+
| supported_versions | [] |
|
|
62
|
+
|
|
63
|
+
Scenario: parse
|
|
64
|
+
When I try to parse a file named "hello13_version_bitmap.raw" with "Hello13" class
|
|
65
|
+
Then it should finish successfully
|
|
66
|
+
And the message have the following fields and values:
|
|
67
|
+
| field | value |
|
|
68
|
+
| class | Pio::Hello13 |
|
|
69
|
+
| ofp_version | 4 |
|
|
70
|
+
| message_type | 0 |
|
|
71
|
+
| message_length | 16 |
|
|
72
|
+
| transaction_id | 0 |
|
|
73
|
+
| xid | 0 |
|
|
74
|
+
| supported_versions | [:open_flow10, :open_flow13] |
|