pio 0.19.0 → 0.20.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 +9 -0
- data/README.md +20 -18
- data/features/{packet_data/arp-storm.pcap → arp-storm.pcap} +0 -0
- data/features/arp.feature +1 -1
- data/features/{packet_data/arp.pcap → arp.pcap} +0 -0
- data/features/dhcp.feature +210 -3
- data/features/{packet_data/dhcp.pcap → dhcp.pcap} +0 -0
- data/features/icmp.feature +1 -1
- data/features/{packet_data/icmp.pcap → icmp.pcap} +0 -0
- data/features/{packet_data/lldp.detailed.pcap → lldp.detailed.pcap} +0 -0
- data/features/lldp.feature +5 -5
- data/features/{packet_data/lldp.minimal.pcap → lldp.minimal.pcap} +0 -0
- data/features/{packet_data → open_flow10}/aggregate_stats_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/aggregate_stats_request.raw +0 -0
- data/features/{packet_data → open_flow10}/barrier_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/barrier_request.raw +0 -0
- data/features/{packet_data → open_flow10}/desc_stats_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/desc_stats_request.raw +0 -0
- data/features/open_flow10/echo_reply.feature +10 -10
- data/features/{packet_data → open_flow10}/echo_reply.raw +0 -0
- data/features/open_flow10/echo_request.feature +10 -10
- data/features/{packet_data → open_flow10}/echo_request.raw +0 -0
- data/features/{packet_data → open_flow10}/error.raw +0 -0
- data/features/open_flow10/exact_match.feature +33 -33
- data/features/open_flow10/features_reply.feature +71 -71
- data/features/{packet_data → open_flow10}/features_reply.raw +0 -0
- data/features/open_flow10/features_request.feature +9 -9
- data/features/{packet_data → open_flow10}/features_request.raw +0 -0
- data/features/open_flow10/flow_mod.feature +167 -167
- data/features/{packet_data → open_flow10}/flow_mod_add.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_mod_delete.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_mod_delete_strict.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_mod_modify.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_mod_modify_strict.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_removed.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_stats_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/flow_stats_request.raw +0 -0
- data/features/{packet_data → open_flow10}/get_config_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/get_config_request.raw +0 -0
- data/features/open_flow10/hello.feature +9 -9
- data/features/{packet_data → open_flow10}/hello.raw +0 -0
- data/features/open_flow10/packet_in.feature +4 -4
- data/features/{packet_data → open_flow10}/packet_in_arp_request.raw +0 -0
- data/features/{packet_data → open_flow10}/packet_in_cbench.raw +0 -0
- data/features/open_flow10/packet_out.feature +3 -3
- data/features/{packet_data → open_flow10}/packet_out.raw +0 -0
- data/features/{packet_data → open_flow10}/port_mod.raw +0 -0
- data/features/{packet_data → open_flow10}/port_stats_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/port_stats_request.raw +0 -0
- data/features/open_flow10/port_status.feature +3 -3
- data/features/{packet_data → open_flow10}/port_status.raw +0 -0
- data/features/{packet_data → open_flow10}/queue_get_config_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/queue_get_config_request.raw +0 -0
- data/features/{packet_data → open_flow10}/set_config.raw +0 -0
- data/features/{packet_data → open_flow10}/table_stats_reply.raw +0 -0
- data/features/{packet_data → open_flow10}/table_stats_request.raw +0 -0
- data/features/{packet_data → open_flow10}/vendor.raw +0 -0
- data/features/{packet_data → open_flow10}/vendor_stats_request.raw +0 -0
- data/features/open_flow13/echo_reply.feature +64 -61
- data/features/{packet_data/echo13_reply_body.raw → open_flow13/echo_reply_body.raw} +0 -0
- data/features/{packet_data/echo13_reply_no_body.raw → open_flow13/echo_reply_no_body.raw} +0 -0
- data/features/open_flow13/echo_request.feature +64 -61
- data/features/{packet_data/echo13_request_body.raw → open_flow13/echo_request_body.raw} +0 -0
- data/features/{packet_data/echo13_request_no_body.raw → open_flow13/echo_request_no_body.raw} +0 -0
- data/features/open_flow13/features_reply.feature +53 -0
- data/features/open_flow13/features_reply.raw +0 -0
- data/features/open_flow13/features_request.feature +89 -0
- data/features/open_flow13/features_request.raw +0 -0
- data/features/open_flow13/hello.feature +26 -23
- data/features/{packet_data/hello13_no_version_bitmap.raw → open_flow13/hello_no_version_bitmap.raw} +0 -0
- data/features/{packet_data/hello13_version_bitmap.raw → open_flow13/hello_version_bitmap.raw} +0 -0
- data/features/step_definitions/open_flow_steps.rb +3 -0
- data/features/step_definitions/packet_data_steps.rb +9 -9
- data/features/udp.feature +3 -3
- data/features/{packet_data/udp_no_payload.raw → udp_no_payload.raw} +0 -0
- data/features/{packet_data/udp_with_payload.raw → udp_with_payload.raw} +0 -0
- data/lib/pio.rb +1 -9
- data/lib/pio/open_flow/actions.rb +8 -8
- data/lib/pio/open_flow/open_flow_header.rb +10 -0
- data/lib/pio/open_flow10.rb +15 -0
- data/lib/pio/open_flow10/echo.rb +15 -0
- data/lib/pio/open_flow10/exact_match.rb +51 -0
- data/lib/pio/{features.rb → open_flow10/features.rb} +8 -7
- data/lib/pio/{flow_mod.rb → open_flow10/flow_mod.rb} +1 -1
- data/lib/pio/{hello.rb → open_flow10/hello.rb} +0 -0
- data/lib/pio/{match.rb → open_flow10/match.rb} +46 -43
- data/lib/pio/{packet_in.rb → open_flow10/packet_in.rb} +0 -0
- data/lib/pio/{packet_out.rb → open_flow10/packet_out.rb} +0 -0
- data/lib/pio/{port_status.rb → open_flow10/port_status.rb} +0 -0
- data/lib/pio/open_flow13.rb +12 -0
- data/lib/pio/{echo.rb → open_flow13/echo.rb} +9 -13
- data/lib/pio/open_flow13/features_reply.rb +91 -0
- data/lib/pio/open_flow13/features_request.rb +54 -0
- data/lib/pio/{hello13.rb → open_flow13/hello.rb} +4 -1
- data/lib/pio/{set_eth_addr.rb → set_ether_address.rb} +7 -7
- data/lib/pio/{set_ip_addr.rb → set_ip_address.rb} +7 -7
- data/lib/pio/set_ip_tos.rb +1 -1
- data/lib/pio/set_transport_port.rb +2 -2
- data/lib/pio/version.rb +1 -1
- data/pio.gemspec +2 -2
- data/spec/pio/flow_mod_spec.rb +45 -45
- data/spec/pio/match_spec.rb +122 -120
- data/spec/pio/{hello13_spec.rb → open_flow13/hello_spec.rb} +11 -11
- data/spec/pio/packet_out_spec.rb +19 -19
- data/spec/pio/set_ether_destination_address_spec.rb +28 -0
- data/spec/pio/set_ether_source_address_spec.rb +28 -0
- data/spec/pio/set_ip_destination_address_spec.rb +27 -0
- data/spec/pio/set_ip_source_address_spec.rb +25 -0
- data/spec/pio/set_transport_destination_port_spec.rb +44 -0
- data/spec/pio/set_transport_source_port_spec.rb +44 -0
- data/spec/pio/wildcards_spec.rb +23 -21
- metadata +179 -165
- data/bin/byebug +0 -16
- data/lib/pio/exact_match.rb +0 -51
- data/spec/pio/set_eth_dst_addr_spec.rb +0 -28
- data/spec/pio/set_eth_src_addr_spec.rb +0 -28
- data/spec/pio/set_ip_dst_addr_spec.rb +0 -25
- data/spec/pio/set_ip_src_addr_spec.rb +0 -25
- data/spec/pio/set_transport_dst_port_spec.rb +0 -42
- data/spec/pio/set_transport_src_port_spec.rb +0 -42
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
|
-
Feature: Hello
|
2
|
-
Scenario:
|
1
|
+
Feature: Pio::Hello
|
2
|
+
Scenario: new
|
3
3
|
When I try to create an OpenFlow message with:
|
4
4
|
"""
|
5
5
|
Pio::Hello.new
|
@@ -15,7 +15,7 @@ Feature: Hello
|
|
15
15
|
| xid | 0 |
|
16
16
|
| body | |
|
17
17
|
|
18
|
-
Scenario:
|
18
|
+
Scenario: new(transaction_id: 123)
|
19
19
|
When I try to create an OpenFlow message with:
|
20
20
|
"""
|
21
21
|
Pio::Hello.new(transaction_id: 123)
|
@@ -31,7 +31,7 @@ Feature: Hello
|
|
31
31
|
| xid | 123 |
|
32
32
|
| body | |
|
33
33
|
|
34
|
-
Scenario:
|
34
|
+
Scenario: new(xid: 123)
|
35
35
|
When I try to create an OpenFlow message with:
|
36
36
|
"""
|
37
37
|
Pio::Hello.new(xid: 123)
|
@@ -47,22 +47,22 @@ Feature: Hello
|
|
47
47
|
| xid | 123 |
|
48
48
|
| body | |
|
49
49
|
|
50
|
-
Scenario:
|
50
|
+
Scenario: new(xid: -1) and error
|
51
51
|
When I try to create an OpenFlow message with:
|
52
52
|
"""
|
53
53
|
Pio::Hello.new(xid: -1)
|
54
54
|
"""
|
55
55
|
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
56
56
|
|
57
|
-
Scenario:
|
57
|
+
Scenario: new(xid: 2**32) and error
|
58
58
|
When I try to create an OpenFlow message with:
|
59
59
|
"""
|
60
60
|
Pio::Hello.new(xid: 2**32)
|
61
61
|
"""
|
62
62
|
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
63
63
|
|
64
|
-
Scenario:
|
65
|
-
When I try to parse a file named "hello.raw" with "Hello" class
|
64
|
+
Scenario: read
|
65
|
+
When I try to parse a file named "open_flow10/hello.raw" with "Hello" class
|
66
66
|
Then it should finish successfully
|
67
67
|
And the message have the following fields and values:
|
68
68
|
| field | value |
|
@@ -75,5 +75,5 @@ Feature: Hello
|
|
75
75
|
| body | |
|
76
76
|
|
77
77
|
Scenario: parse error
|
78
|
-
When I try to parse a file named "features_request.raw" with "Pio::Hello" class
|
78
|
+
When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Hello" class
|
79
79
|
Then it should fail with "Pio::ParseError", "Invalid Hello message."
|
File without changes
|
@@ -1,5 +1,5 @@
|
|
1
|
-
Feature:
|
2
|
-
Scenario:
|
1
|
+
Feature: Pio::PacketIn
|
2
|
+
Scenario: new
|
3
3
|
When I try to create an OpenFlow message with:
|
4
4
|
"""
|
5
5
|
data_dump = [
|
@@ -36,8 +36,8 @@ Feature: Packet In
|
|
36
36
|
| destination_mac | ff:ff:ff:ff:ff:ff |
|
37
37
|
| destination_mac.class | Pio::Mac |
|
38
38
|
|
39
|
-
Scenario:
|
40
|
-
When I try to parse a file named "packet_in_arp_request.raw" with "PacketIn" class
|
39
|
+
Scenario: read
|
40
|
+
When I try to parse a file named "open_flow10/packet_in_arp_request.raw" with "PacketIn" class
|
41
41
|
Then it should finish successfully
|
42
42
|
And the message have the following fields and values:
|
43
43
|
| field | value |
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Feature:
|
2
|
-
Scenario:
|
3
|
-
When I try to parse a file named "packet_out.raw" with "PacketOut" class
|
1
|
+
Feature: Pio::PacketOut
|
2
|
+
Scenario: read
|
3
|
+
When I try to parse a file named "open_flow10/packet_out.raw" with "PacketOut" class
|
4
4
|
Then it should finish successfully
|
5
5
|
And the message have the following fields and values:
|
6
6
|
| field | value |
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Feature:
|
2
|
-
Scenario:
|
3
|
-
When I try to parse a file named "port_status.raw" with "PortStatus" class
|
1
|
+
Feature: Pio::PortStatus
|
2
|
+
Scenario: read
|
3
|
+
When I try to parse a file named "open_flow10/port_status.raw" with "PortStatus" class
|
4
4
|
Then it should finish successfully
|
5
5
|
And the message have the following fields and values:
|
6
6
|
| field | value |
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,108 +1,111 @@
|
|
1
|
-
Feature: Echo
|
2
|
-
|
1
|
+
Feature: Pio::Echo::Reply
|
2
|
+
Background:
|
3
|
+
Given I use OpenFlow 1.3
|
4
|
+
|
5
|
+
Scenario: new
|
3
6
|
When I try to create an OpenFlow message with:
|
4
7
|
"""
|
5
|
-
Pio::
|
8
|
+
Pio::Echo::Reply.new
|
6
9
|
"""
|
7
10
|
Then it should finish successfully
|
8
11
|
And the message have the following fields and values:
|
9
|
-
| field |
|
10
|
-
| class | Pio::
|
11
|
-
| ofp_version |
|
12
|
-
| message_type |
|
13
|
-
| message_length |
|
14
|
-
| transaction_id |
|
15
|
-
| xid |
|
16
|
-
| body |
|
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 | |
|
17
20
|
|
18
|
-
Scenario:
|
21
|
+
Scenario: new(transaction_id: 123)
|
19
22
|
When I try to create an OpenFlow message with:
|
20
23
|
"""
|
21
|
-
Pio::
|
24
|
+
Pio::Echo::Reply.new(transaction_id: 123)
|
22
25
|
"""
|
23
26
|
Then it should finish successfully
|
24
27
|
And the message have the following fields and values:
|
25
|
-
| field |
|
26
|
-
| class | Pio::
|
27
|
-
| ofp_version |
|
28
|
-
| message_type |
|
29
|
-
| message_length |
|
30
|
-
| transaction_id |
|
31
|
-
| xid |
|
32
|
-
| body |
|
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 | |
|
33
36
|
|
34
|
-
Scenario:
|
37
|
+
Scenario: new(xid: 123)
|
35
38
|
When I try to create an OpenFlow message with:
|
36
39
|
"""
|
37
|
-
Pio::
|
40
|
+
Pio::Echo::Reply.new(xid: 123)
|
38
41
|
"""
|
39
42
|
Then it should finish successfully
|
40
43
|
And the message have the following fields and values:
|
41
|
-
| field |
|
42
|
-
| class | Pio::
|
43
|
-
| ofp_version |
|
44
|
-
| message_type |
|
45
|
-
| message_length |
|
46
|
-
| transaction_id |
|
47
|
-
| xid |
|
48
|
-
| body |
|
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 | |
|
49
52
|
|
50
|
-
Scenario:
|
53
|
+
Scenario: new(xid: -1) and error
|
51
54
|
When I try to create an OpenFlow message with:
|
52
55
|
"""
|
53
|
-
Pio::
|
56
|
+
Pio::Echo::Reply.new(xid: -1)
|
54
57
|
"""
|
55
58
|
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
56
59
|
|
57
|
-
Scenario:
|
60
|
+
Scenario: new(xid: 2**32) and error
|
58
61
|
When I try to create an OpenFlow message with:
|
59
62
|
"""
|
60
|
-
Pio::
|
63
|
+
Pio::Echo::Reply.new(xid: 2**32)
|
61
64
|
"""
|
62
65
|
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
63
66
|
|
64
|
-
Scenario:
|
67
|
+
Scenario: new(body: 'echo reply body')
|
65
68
|
When I try to create an OpenFlow message with:
|
66
69
|
"""
|
67
|
-
Pio::
|
70
|
+
Pio::Echo::Reply.new(body: 'echo reply body')
|
68
71
|
"""
|
69
72
|
Then it should finish successfully
|
70
73
|
And the message have the following fields and values:
|
71
|
-
| field |
|
72
|
-
| class | Pio::
|
73
|
-
| ofp_version |
|
74
|
-
| message_type |
|
75
|
-
| message_length |
|
76
|
-
| transaction_id |
|
77
|
-
| xid |
|
78
|
-
| body |
|
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 |
|
79
82
|
|
80
|
-
Scenario:
|
83
|
+
Scenario: new(unknown_attr: 'foo') and error
|
81
84
|
When I try to create an OpenFlow message with:
|
82
85
|
"""
|
83
|
-
Pio::
|
86
|
+
Pio::Echo::Reply.new(unknown_attr: 'foo')
|
84
87
|
"""
|
85
88
|
Then it should fail with "RuntimeError", "Unknown keyword: unknown_attr"
|
86
89
|
|
87
|
-
Scenario:
|
88
|
-
When I try to parse a file named "
|
90
|
+
Scenario: read (no message body)
|
91
|
+
When I try to parse a file named "open_flow13/echo_reply_no_body.raw" with "Pio::Echo::Reply" class
|
89
92
|
Then it should finish successfully
|
90
93
|
And the message have the following fields and values:
|
91
|
-
| field |
|
92
|
-
| class | Pio::
|
93
|
-
| ofp_version |
|
94
|
-
| message_type |
|
95
|
-
| message_length |
|
96
|
-
| transaction_id |
|
97
|
-
| xid |
|
98
|
-
| body |
|
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 | |
|
99
102
|
|
100
|
-
Scenario:
|
101
|
-
When I try to parse a file named "
|
103
|
+
Scenario: read
|
104
|
+
When I try to parse a file named "open_flow13/echo_reply_body.raw" with "Pio::Echo::Reply" class
|
102
105
|
Then it should finish successfully
|
103
106
|
And the message have the following fields and values:
|
104
107
|
| field | value |
|
105
|
-
| class |
|
108
|
+
| class | Pio::Echo::Reply |
|
106
109
|
| ofp_version | 4 |
|
107
110
|
| message_type | 3 |
|
108
111
|
| message_length | 28 |
|
@@ -111,5 +114,5 @@ Feature: Echo Reply
|
|
111
114
|
| body | hogehogehogehogehoge |
|
112
115
|
|
113
116
|
Scenario: parse error
|
114
|
-
When I try to parse a file named "features_request.raw" with "Pio::
|
117
|
+
When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Echo::Reply" class
|
115
118
|
Then it should fail with "Pio::ParseError", "Invalid Echo Reply 1.3 message."
|
File without changes
|
File without changes
|
@@ -1,108 +1,111 @@
|
|
1
|
-
Feature: Echo
|
2
|
-
|
1
|
+
Feature: Pio::Echo::Request
|
2
|
+
Background:
|
3
|
+
Given I use OpenFlow 1.3
|
4
|
+
|
5
|
+
Scenario: new
|
3
6
|
When I try to create an OpenFlow message with:
|
4
7
|
"""
|
5
|
-
Pio::
|
8
|
+
Pio::Echo::Request.new
|
6
9
|
"""
|
7
10
|
Then it should finish successfully
|
8
11
|
And the message have the following fields and values:
|
9
|
-
| field |
|
10
|
-
| class | Pio::
|
11
|
-
| ofp_version |
|
12
|
-
| message_type |
|
13
|
-
| message_length |
|
14
|
-
| transaction_id |
|
15
|
-
| xid |
|
16
|
-
| body |
|
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 | |
|
17
20
|
|
18
|
-
Scenario:
|
21
|
+
Scenario: new(transaction_id: 123)
|
19
22
|
When I try to create an OpenFlow message with:
|
20
23
|
"""
|
21
|
-
Pio::
|
24
|
+
Pio::Echo::Request.new(transaction_id: 123)
|
22
25
|
"""
|
23
26
|
Then it should finish successfully
|
24
27
|
And the message have the following fields and values:
|
25
|
-
| field |
|
26
|
-
| class | Pio::
|
27
|
-
| ofp_version |
|
28
|
-
| message_type |
|
29
|
-
| message_length |
|
30
|
-
| transaction_id |
|
31
|
-
| xid |
|
32
|
-
| body |
|
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 | |
|
33
36
|
|
34
|
-
Scenario:
|
37
|
+
Scenario: new(xid: 123)
|
35
38
|
When I try to create an OpenFlow message with:
|
36
39
|
"""
|
37
|
-
Pio::
|
40
|
+
Pio::Echo::Request.new(xid: 123)
|
38
41
|
"""
|
39
42
|
Then it should finish successfully
|
40
43
|
And the message have the following fields and values:
|
41
|
-
| field |
|
42
|
-
| class | Pio::
|
43
|
-
| ofp_version |
|
44
|
-
| message_type |
|
45
|
-
| message_length |
|
46
|
-
| transaction_id |
|
47
|
-
| xid |
|
48
|
-
| body |
|
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 | |
|
49
52
|
|
50
|
-
Scenario:
|
53
|
+
Scenario: new(xid: -1) and error
|
51
54
|
When I try to create an OpenFlow message with:
|
52
55
|
"""
|
53
|
-
Pio::
|
56
|
+
Pio::Echo::Request.new(xid: -1)
|
54
57
|
"""
|
55
58
|
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
56
59
|
|
57
|
-
Scenario:
|
60
|
+
Scenario: new(xid: 2**32) and error
|
58
61
|
When I try to create an OpenFlow message with:
|
59
62
|
"""
|
60
|
-
Pio::
|
63
|
+
Pio::Echo::Request.new(xid: 2**32)
|
61
64
|
"""
|
62
65
|
Then it should fail with "ArgumentError", "Transaction ID should be an unsigned 32-bit integer."
|
63
66
|
|
64
|
-
Scenario:
|
67
|
+
Scenario: new(body: 'echo request body')
|
65
68
|
When I try to create an OpenFlow message with:
|
66
69
|
"""
|
67
|
-
Pio::
|
70
|
+
Pio::Echo::Request.new(body: 'echo request body')
|
68
71
|
"""
|
69
72
|
Then it should finish successfully
|
70
73
|
And the message have the following fields and values:
|
71
|
-
| field |
|
72
|
-
| class | Pio::
|
73
|
-
| ofp_version |
|
74
|
-
| message_type |
|
75
|
-
| message_length |
|
76
|
-
| transaction_id |
|
77
|
-
| xid |
|
78
|
-
| body |
|
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 |
|
79
82
|
|
80
|
-
Scenario:
|
83
|
+
Scenario: new(unknown_attr: 'foo') and error
|
81
84
|
When I try to create an OpenFlow message with:
|
82
85
|
"""
|
83
|
-
Pio::
|
86
|
+
Pio::Echo::Request.new(unknown_attr: 'foo')
|
84
87
|
"""
|
85
88
|
Then it should fail with "RuntimeError", "Unknown keyword: unknown_attr"
|
86
89
|
|
87
|
-
Scenario:
|
88
|
-
When I try to parse a file named "
|
90
|
+
Scenario: read (no message body)
|
91
|
+
When I try to parse a file named "open_flow13/echo_request_no_body.raw" with "Pio::Echo::Request" class
|
89
92
|
Then it should finish successfully
|
90
93
|
And the message have the following fields and values:
|
91
|
-
| field |
|
92
|
-
| class | Pio::
|
93
|
-
| ofp_version |
|
94
|
-
| message_type |
|
95
|
-
| message_length |
|
96
|
-
| transaction_id |
|
97
|
-
| xid |
|
98
|
-
| body |
|
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 | |
|
99
102
|
|
100
|
-
Scenario:
|
101
|
-
When I try to parse a file named "
|
103
|
+
Scenario: read
|
104
|
+
When I try to parse a file named "open_flow13/echo_request_body.raw" with "Pio::Echo::Request" class
|
102
105
|
Then it should finish successfully
|
103
106
|
And the message have the following fields and values:
|
104
107
|
| field | value |
|
105
|
-
| class |
|
108
|
+
| class | Pio::Echo::Request |
|
106
109
|
| ofp_version | 4 |
|
107
110
|
| message_type | 2 |
|
108
111
|
| message_length | 28 |
|
@@ -111,5 +114,5 @@ Feature: Echo Request
|
|
111
114
|
| body | hogehogehogehogehoge |
|
112
115
|
|
113
116
|
Scenario: parse error
|
114
|
-
When I try to parse a file named "features_request.raw" with "Pio::
|
117
|
+
When I try to parse a file named "open_flow10/features_request.raw" with "Pio::Echo::Request" class
|
115
118
|
Then it should fail with "Pio::ParseError", "Invalid Echo Request 1.3 message."
|