pio 0.25.0 → 0.26.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 +8 -0
- data/README.md +4 -0
- data/Rakefile +1 -1
- data/bin/terminal-notifier +16 -0
- data/features/open_flow10/bad_request.feature +35 -0
- data/features/open_flow10/bad_request.raw +0 -0
- data/features/open_flow10/barrier_reply.feature +4 -4
- data/features/open_flow10/barrier_request.feature +4 -4
- data/features/open_flow10/echo_reply.feature +13 -13
- data/features/open_flow10/echo_request.feature +6 -6
- data/features/open_flow10/enqueue.feature +17 -0
- data/features/open_flow10/features_reply.feature +2 -2
- data/features/open_flow10/features_request.feature +28 -28
- data/features/open_flow10/flow_mod.feature +5 -5
- data/features/open_flow10/flow_stats_reply.feature +12 -12
- data/features/open_flow10/flow_stats_request.feature +3 -3
- data/features/open_flow10/hello.feature +8 -15
- data/features/open_flow10/hello_failed.feature +69 -0
- data/features/open_flow10/hello_failed.raw +0 -0
- data/features/open_flow10/nxast_learn.raw +0 -0
- data/features/open_flow10/packet_in.feature +2 -2
- data/features/open_flow10/packet_out.feature +13 -13
- data/features/open_flow10/port_status.feature +1 -1
- data/features/open_flow10/send_out_port.feature +106 -0
- data/features/open_flow10/set_ether_destination_address.feature +16 -0
- data/features/open_flow10/set_ether_source_address.feature +16 -0
- data/features/open_flow10/set_ip_destination_address.feature +16 -0
- data/features/open_flow10/set_ip_source_address.feature +16 -0
- data/features/open_flow10/set_ip_tos.feature +16 -0
- data/features/open_flow10/set_transport_destination_port.feature +16 -0
- data/features/open_flow10/set_transport_source_port.feature +16 -0
- data/features/open_flow10/set_vlan_priority.feature +16 -0
- data/features/open_flow10/set_vlan_vid.feature +16 -0
- data/features/open_flow10/strip_vlan_header.feature +15 -0
- data/features/open_flow10/vendor_action.feature +14 -0
- data/features/open_flow13/bad_request.feature +35 -0
- data/features/open_flow13/bad_request.raw +0 -0
- data/features/open_flow13/echo_reply.feature +7 -7
- data/features/open_flow13/echo_request.feature +7 -7
- data/features/open_flow13/features_reply.feature +2 -2
- data/features/open_flow13/features_request.feature +28 -28
- data/features/open_flow13/flow_mod.feature +24 -24
- data/features/open_flow13/hello.feature +5 -5
- data/features/open_flow13/hello_failed.feature +69 -0
- data/features/open_flow13/hello_failed.raw +0 -0
- data/features/open_flow13/packet_in.feature +3 -3
- data/features/open_flow13/packet_out.feature +3 -3
- data/features/open_flow13/send_out_port.feature +101 -10
- data/features/open_flow13/table_stats_reply.raw +0 -0
- data/features/open_flow13/table_stats_request.raw +0 -0
- data/features/open_flow_read.feature +6 -0
- data/features/step_definitions/Gemfile +9 -0
- data/features/step_definitions/Gemfile.lock +76 -0
- data/features/step_definitions/Guardfile +4 -0
- data/features/step_definitions/LICENSE +675 -0
- data/features/step_definitions/README.md +7 -0
- data/features/step_definitions/Rakefile +10 -0
- data/features/step_definitions/dump_flows_steps.rb +13 -0
- data/features/step_definitions/packet_data_steps.rb +4 -0
- data/features/step_definitions/rest_api_steps.rb +40 -0
- data/features/step_definitions/show_stats_steps.rb +83 -0
- data/features/step_definitions/trema_steps.rb +33 -0
- data/features/step_definitions/virtual_link_steps.rb +8 -0
- data/lib/pio/open_flow.rb +5 -5
- data/lib/pio/open_flow/echo.rb +1 -1
- data/lib/pio/open_flow/error.rb +19 -0
- data/lib/pio/open_flow/format.rb +2 -1
- data/lib/pio/open_flow/hello_failed_code.rb +21 -0
- data/lib/pio/open_flow/open_flow_header.rb +11 -2
- data/lib/pio/open_flow/port.rb +69 -0
- data/lib/pio/open_flow10.rb +5 -0
- data/lib/pio/open_flow10/actions.rb +8 -6
- data/lib/pio/open_flow10/enqueue.rb +13 -13
- data/lib/pio/open_flow10/error.rb +28 -0
- data/lib/pio/open_flow10/error/bad_request.rb +66 -0
- data/lib/pio/open_flow10/error/error_type10.rb +26 -0
- data/lib/pio/open_flow10/error/hello_failed.rb +41 -0
- data/lib/pio/open_flow10/features.rb +6 -10
- data/lib/pio/open_flow10/flow_mod.rb +1 -1
- data/lib/pio/open_flow10/flow_stats_request.rb +1 -1
- data/lib/pio/open_flow10/hello.rb +2 -2
- data/lib/pio/open_flow10/match.rb +2 -2
- data/lib/pio/{open_flow/phy_port.rb → open_flow10/phy_port16.rb} +4 -4
- data/lib/pio/open_flow10/port16.rb +21 -0
- data/lib/pio/open_flow10/port_status.rb +1 -1
- data/lib/pio/open_flow10/send_out_port.rb +16 -40
- data/lib/pio/open_flow10/set_ether_address.rb +9 -8
- data/lib/pio/open_flow10/set_ip_address.rb +4 -4
- data/lib/pio/open_flow10/set_ip_tos.rb +4 -4
- data/lib/pio/open_flow10/set_transport_port.rb +12 -12
- data/lib/pio/open_flow10/set_vlan.rb +4 -4
- data/lib/pio/open_flow10/set_vlan_vid.rb +0 -12
- data/lib/pio/open_flow10/strip_vlan_header.rb +7 -7
- data/lib/pio/open_flow10/vendor_action.rb +33 -0
- data/lib/pio/open_flow13.rb +3 -0
- data/lib/pio/open_flow13/actions.rb +3 -3
- data/lib/pio/open_flow13/error.rb +28 -0
- data/lib/pio/open_flow13/error/bad_request.rb +66 -0
- data/lib/pio/open_flow13/error/error_type13.rb +37 -0
- data/lib/pio/open_flow13/error/hello_failed.rb +42 -0
- data/lib/pio/open_flow13/features_reply.rb +33 -33
- data/lib/pio/open_flow13/features_request.rb +3 -3
- data/lib/pio/open_flow13/flow_mod.rb +2 -2
- data/lib/pio/open_flow13/goto_table.rb +2 -0
- data/lib/pio/open_flow13/packet_out.rb +1 -1
- data/lib/pio/open_flow13/port32.rb +21 -0
- data/lib/pio/open_flow13/send_out_port.rb +3 -2
- data/lib/pio/version.rb +1 -1
- data/pio.gemspec +5 -5
- data/spec/pio/open_flow10/enqueue_spec.rb +22 -22
- data/spec/pio/open_flow10/error/hello_failed_spec.rb +26 -0
- data/spec/pio/open_flow10/flow_mod_spec.rb +6 -6
- data/spec/pio/open_flow10/flow_stats_request_spec.rb +1 -1
- data/spec/pio/open_flow10/hello_spec.rb +3 -3
- data/spec/pio/open_flow10/packet_out_spec.rb +33 -33
- data/spec/pio/{open_flow/phy_port_spec.rb → open_flow10/phy_port16_spec.rb} +7 -7
- data/spec/pio/open_flow10/send_out_port_spec.rb +28 -28
- data/spec/pio/open_flow10/set_ether_destination_address_spec.rb +2 -2
- data/spec/pio/open_flow10/set_ether_source_address_spec.rb +2 -2
- data/spec/pio/open_flow10/set_ip_destination_address_spec.rb +4 -4
- data/spec/pio/open_flow10/set_ip_source_address_spec.rb +4 -4
- data/spec/pio/open_flow10/set_ip_tos_spec.rb +4 -4
- data/spec/pio/open_flow10/set_transport_destination_port_spec.rb +11 -11
- data/spec/pio/open_flow10/set_transport_source_port_spec.rb +11 -11
- data/spec/pio/open_flow10/set_vlan_priority_spec.rb +4 -4
- data/spec/pio/open_flow10/set_vlan_vid_spec.rb +4 -4
- data/spec/pio/open_flow10/strip_vlan_header_spec.rb +6 -6
- data/spec/pio/open_flow13/error/bad_request_spec.rb +6 -0
- data/spec/pio/open_flow13/error/hello_failed_spec.rb +26 -0
- data/spec/pio/open_flow13/hello_spec.rb +3 -3
- data/spec/support/shared_examples_for_openflow_messages.rb +40 -27
- metadata +106 -16
- data/lib/pio/open_flow/port_number.rb +0 -39
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'pio'
|
2
2
|
|
3
|
-
describe Pio::
|
3
|
+
describe Pio::OpenFlow10::PhyPort16 do
|
4
4
|
describe '.new' do
|
5
5
|
When(:phy_port) do
|
6
|
-
Pio::
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
Pio::OpenFlow10::PhyPort16.new(port_no: 1,
|
7
|
+
hardware_address: '11:22:33:44:55:66',
|
8
|
+
name: 'port123',
|
9
|
+
config: [:port_down],
|
10
|
+
state: [:link_down],
|
11
|
+
curr: [:port_10gb_fd, :port_copper])
|
12
12
|
end
|
13
13
|
|
14
14
|
Then { phy_port.port_no == 1 }
|
@@ -6,8 +6,8 @@ describe Pio::OpenFlow10::SendOutPort do
|
|
6
6
|
|
7
7
|
context 'with 1' do
|
8
8
|
Given(:options) { 1 }
|
9
|
-
Then { send_out_port.
|
10
|
-
Then { send_out_port.
|
9
|
+
Then { send_out_port.port == 1 }
|
10
|
+
Then { send_out_port.max_length == 2**16 - 1 }
|
11
11
|
|
12
12
|
describe '#==' do
|
13
13
|
When(:result) { send_out_port == other }
|
@@ -28,7 +28,7 @@ describe Pio::OpenFlow10::SendOutPort do
|
|
28
28
|
Given(:options) { 0 }
|
29
29
|
Then do
|
30
30
|
send_out_port ==
|
31
|
-
Failure(ArgumentError, 'The
|
31
|
+
Failure(ArgumentError, 'The port should be > 0')
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -36,81 +36,81 @@ describe Pio::OpenFlow10::SendOutPort do
|
|
36
36
|
Given(:options) { 0xff01 }
|
37
37
|
Then do
|
38
38
|
send_out_port ==
|
39
|
-
Failure(ArgumentError, 'The
|
39
|
+
Failure(ArgumentError, 'The port should be < 0xff00')
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
context 'with :in_port' do
|
44
44
|
Given(:options) { :in_port }
|
45
|
-
Then { send_out_port.
|
45
|
+
Then { send_out_port.port == :in_port }
|
46
46
|
end
|
47
47
|
|
48
48
|
context 'with :table' do
|
49
49
|
Given(:options) { :table }
|
50
|
-
Then { send_out_port.
|
50
|
+
Then { send_out_port.port == :table }
|
51
51
|
end
|
52
52
|
|
53
53
|
context 'with :normal' do
|
54
54
|
Given(:options) { :normal }
|
55
|
-
Then { send_out_port.
|
55
|
+
Then { send_out_port.port == :normal }
|
56
56
|
end
|
57
57
|
|
58
58
|
context 'with :flood' do
|
59
59
|
Given(:options) { :flood }
|
60
|
-
Then { send_out_port.
|
60
|
+
Then { send_out_port.port == :flood }
|
61
61
|
end
|
62
62
|
|
63
63
|
context 'with :all' do
|
64
64
|
Given(:options) { :all }
|
65
|
-
Then { send_out_port.
|
65
|
+
Then { send_out_port.port == :all }
|
66
66
|
end
|
67
67
|
|
68
68
|
context 'with :controller' do
|
69
69
|
Given(:options) { :controller }
|
70
|
-
Then { send_out_port.
|
70
|
+
Then { send_out_port.port == :controller }
|
71
71
|
end
|
72
72
|
|
73
73
|
context 'with :controller' do
|
74
74
|
Given(:options) { :local }
|
75
|
-
Then { send_out_port.
|
75
|
+
Then { send_out_port.port == :local }
|
76
76
|
end
|
77
77
|
|
78
78
|
context 'with :controller' do
|
79
79
|
Given(:options) { :none }
|
80
|
-
Then { send_out_port.
|
80
|
+
Then { send_out_port.port == :none }
|
81
81
|
end
|
82
82
|
|
83
|
-
context 'with
|
84
|
-
Given(:options) { {
|
85
|
-
Then { send_out_port.
|
83
|
+
context 'with port: NUMBER option' do
|
84
|
+
Given(:options) { { port: 1 } }
|
85
|
+
Then { send_out_port.port == 1 }
|
86
86
|
end
|
87
87
|
|
88
|
-
context 'with
|
89
|
-
Given(:options) { {
|
90
|
-
Then { send_out_port.
|
88
|
+
context 'with port: SYMBOL option' do
|
89
|
+
Given(:options) { { port: :flood } }
|
90
|
+
Then { send_out_port.port == :flood }
|
91
91
|
end
|
92
92
|
|
93
|
-
context 'with
|
94
|
-
Given(:options) { {
|
95
|
-
Then { send_out_port.
|
96
|
-
Then { send_out_port.
|
93
|
+
context 'with port: and max_length: option' do
|
94
|
+
Given(:options) { { port: 1, max_length: 256 } }
|
95
|
+
Then { send_out_port.port == 1 }
|
96
|
+
Then { send_out_port.max_length == 256 }
|
97
97
|
end
|
98
98
|
|
99
|
-
context 'with invalid
|
100
|
-
Given(:options) { {
|
99
|
+
context 'with invalid max_length: (-1) option' do
|
100
|
+
Given(:options) { { port: 1, max_length: -1 } }
|
101
101
|
Then do
|
102
102
|
send_out_port ==
|
103
103
|
Failure(ArgumentError,
|
104
|
-
'The
|
104
|
+
'The max_length should be an unsigned 16bit integer.')
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
-
context 'with invalid
|
109
|
-
Given(:options) { {
|
108
|
+
context 'with invalid max_length: (2**16) option' do
|
109
|
+
Given(:options) { { port: 1, max_length: 2**16 } }
|
110
110
|
Then do
|
111
111
|
send_out_port ==
|
112
112
|
Failure(ArgumentError,
|
113
|
-
'The
|
113
|
+
'The max_length should be an unsigned 16bit integer.')
|
114
114
|
end
|
115
115
|
end
|
116
116
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'pio/open_flow10/set_ether_address'
|
2
2
|
|
3
|
-
describe Pio::
|
3
|
+
describe Pio::SetEtherDestinationAddress do
|
4
4
|
describe '.new' do
|
5
5
|
Given(:set_ether_destination_address) do
|
6
|
-
Pio::
|
6
|
+
Pio::SetEtherDestinationAddress.new(mac_address)
|
7
7
|
end
|
8
8
|
|
9
9
|
context "with '11:22:33:44:55:66'" do
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'pio/open_flow10/set_ether_address'
|
2
2
|
|
3
|
-
describe Pio::
|
3
|
+
describe Pio::SetEtherSourceAddress do
|
4
4
|
describe '.new' do
|
5
5
|
Given(:set_ether_source_address) do
|
6
|
-
Pio::
|
6
|
+
Pio::SetEtherSourceAddress.new(mac_address)
|
7
7
|
end
|
8
8
|
|
9
9
|
context "with '11:22:33:44:55:66'" do
|
@@ -11,12 +11,12 @@ describe Pio::SetIpDestinationAddress do
|
|
11
11
|
Then { set_ip_destination_addr.ip_address == '1.2.3.4' }
|
12
12
|
end
|
13
13
|
|
14
|
-
describe '#
|
15
|
-
Then { set_ip_destination_addr.
|
14
|
+
describe '#action_type' do
|
15
|
+
Then { set_ip_destination_addr.action_type == 7 }
|
16
16
|
end
|
17
17
|
|
18
|
-
describe '#
|
19
|
-
Then { set_ip_destination_addr.
|
18
|
+
describe '#length' do
|
19
|
+
Then { set_ip_destination_addr.length == 8 }
|
20
20
|
end
|
21
21
|
|
22
22
|
describe '#to_binary' do
|
@@ -9,12 +9,12 @@ describe Pio::SetIpSourceAddress do
|
|
9
9
|
Then { set_ip_source_addr.ip_address == '1.2.3.4' }
|
10
10
|
end
|
11
11
|
|
12
|
-
describe '#
|
13
|
-
Then { set_ip_source_addr.
|
12
|
+
describe '#action_type' do
|
13
|
+
Then { set_ip_source_addr.action_type == 6 }
|
14
14
|
end
|
15
15
|
|
16
|
-
describe '#
|
17
|
-
Then { set_ip_source_addr.
|
16
|
+
describe '#length' do
|
17
|
+
Then { set_ip_source_addr.length == 8 }
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '#to_binary' do
|
@@ -9,12 +9,12 @@ describe Pio::SetIpTos do
|
|
9
9
|
Then { set_ip_tos.type_of_service == 32 }
|
10
10
|
end
|
11
11
|
|
12
|
-
describe '#
|
13
|
-
Then { set_ip_tos.
|
12
|
+
describe '#action_type' do
|
13
|
+
Then { set_ip_tos.action_type == 8 }
|
14
14
|
end
|
15
15
|
|
16
|
-
describe '#
|
17
|
-
Then { set_ip_tos.
|
16
|
+
describe '#length' do
|
17
|
+
Then { set_ip_tos.length == 8 }
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '#to_binary' do
|
@@ -3,22 +3,22 @@ require 'pio/open_flow10/set_transport_port'
|
|
3
3
|
describe Pio::SetTransportDestinationPort do
|
4
4
|
describe '.new' do
|
5
5
|
When(:set_transport_destination_port) do
|
6
|
-
Pio::SetTransportDestinationPort.new(
|
6
|
+
Pio::SetTransportDestinationPort.new(port)
|
7
7
|
end
|
8
8
|
|
9
9
|
context 'with 100' do
|
10
|
-
When(:
|
10
|
+
When(:port) { 100 }
|
11
11
|
|
12
|
-
describe '#
|
13
|
-
Then { set_transport_destination_port.
|
12
|
+
describe '#port' do
|
13
|
+
Then { set_transport_destination_port.port == 100 }
|
14
14
|
end
|
15
15
|
|
16
|
-
describe '#
|
17
|
-
Then { set_transport_destination_port.
|
16
|
+
describe '#action_type' do
|
17
|
+
Then { set_transport_destination_port.action_type == 10 }
|
18
18
|
end
|
19
19
|
|
20
|
-
describe '#
|
21
|
-
Then { set_transport_destination_port.
|
20
|
+
describe '#length' do
|
21
|
+
Then { set_transport_destination_port.length == 8 }
|
22
22
|
end
|
23
23
|
|
24
24
|
describe '#to_binary' do
|
@@ -27,17 +27,17 @@ describe Pio::SetTransportDestinationPort do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
context 'with -1' do
|
30
|
-
When(:
|
30
|
+
When(:port) { -1 }
|
31
31
|
Then { set_transport_destination_port == Failure(ArgumentError) }
|
32
32
|
end
|
33
33
|
|
34
34
|
context 'with 2**16' do
|
35
|
-
When(:
|
35
|
+
When(:port) { 2**16 }
|
36
36
|
Then { set_transport_destination_port == Failure(ArgumentError) }
|
37
37
|
end
|
38
38
|
|
39
39
|
context 'with :INVALID_PORT_NUMBER' do
|
40
|
-
When(:
|
40
|
+
When(:port) { :INVALID_PORT_NUMBER }
|
41
41
|
Then { set_transport_destination_port == Failure(TypeError) }
|
42
42
|
end
|
43
43
|
end
|
@@ -3,22 +3,22 @@ require 'pio/open_flow10/set_transport_port'
|
|
3
3
|
describe Pio::SetTransportSourcePort do
|
4
4
|
describe '.new' do
|
5
5
|
When(:set_transport_source_port) do
|
6
|
-
Pio::SetTransportSourcePort.new
|
6
|
+
Pio::SetTransportSourcePort.new port
|
7
7
|
end
|
8
8
|
|
9
9
|
context 'with 100' do
|
10
|
-
When(:
|
10
|
+
When(:port) { 100 }
|
11
11
|
|
12
|
-
describe '#
|
13
|
-
Then { set_transport_source_port.
|
12
|
+
describe '#port' do
|
13
|
+
Then { set_transport_source_port.port == 100 }
|
14
14
|
end
|
15
15
|
|
16
|
-
describe '#
|
17
|
-
Then { set_transport_source_port.
|
16
|
+
describe '#action_type' do
|
17
|
+
Then { set_transport_source_port.action_type == 9 }
|
18
18
|
end
|
19
19
|
|
20
|
-
describe '#
|
21
|
-
Then { set_transport_source_port.
|
20
|
+
describe '#length' do
|
21
|
+
Then { set_transport_source_port.length == 8 }
|
22
22
|
end
|
23
23
|
|
24
24
|
describe '#to_binary' do
|
@@ -27,17 +27,17 @@ describe Pio::SetTransportSourcePort do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
context 'with -1' do
|
30
|
-
When(:
|
30
|
+
When(:port) { -1 }
|
31
31
|
Then { set_transport_source_port == Failure(ArgumentError) }
|
32
32
|
end
|
33
33
|
|
34
34
|
context 'with 2**16' do
|
35
|
-
When(:
|
35
|
+
When(:port) { 2**16 }
|
36
36
|
Then { set_transport_source_port == Failure(ArgumentError) }
|
37
37
|
end
|
38
38
|
|
39
39
|
context 'with :INVALID_PORT_NUMBER' do
|
40
|
-
When(:
|
40
|
+
When(:port) { :INVALID_PORT_NUMBER }
|
41
41
|
Then { set_transport_source_port == Failure(TypeError) }
|
42
42
|
end
|
43
43
|
end
|
@@ -11,12 +11,12 @@ describe Pio::SetVlanPriority do
|
|
11
11
|
Then { set_vlan_priority.vlan_priority == 3 }
|
12
12
|
end
|
13
13
|
|
14
|
-
describe '#
|
15
|
-
Then { set_vlan_priority.
|
14
|
+
describe '#action_type' do
|
15
|
+
Then { set_vlan_priority.action_type == 2 }
|
16
16
|
end
|
17
17
|
|
18
|
-
describe '#
|
19
|
-
Then { set_vlan_priority.
|
18
|
+
describe '#length' do
|
19
|
+
Then { set_vlan_priority.length == 8 }
|
20
20
|
end
|
21
21
|
|
22
22
|
describe '#to_binary' do
|
@@ -11,12 +11,12 @@ describe Pio::SetVlanVid do
|
|
11
11
|
Then { set_vlan_vid.vlan_id == 10 }
|
12
12
|
end
|
13
13
|
|
14
|
-
describe '#
|
15
|
-
Then { set_vlan_vid.
|
14
|
+
describe '#action_type' do
|
15
|
+
Then { set_vlan_vid.action_type == 1 }
|
16
16
|
end
|
17
17
|
|
18
|
-
describe '#
|
19
|
-
Then { set_vlan_vid.
|
18
|
+
describe '#length' do
|
19
|
+
Then { set_vlan_vid.length == 8 }
|
20
20
|
end
|
21
21
|
|
22
22
|
describe '#to_binary' do
|
@@ -3,14 +3,14 @@ require 'pio/open_flow10/strip_vlan_header'
|
|
3
3
|
describe Pio::StripVlanHeader do
|
4
4
|
Given(:strip_vlan_header) { Pio::StripVlanHeader.new }
|
5
5
|
|
6
|
-
describe '#
|
7
|
-
When(:
|
8
|
-
Then {
|
6
|
+
describe '#action_type' do
|
7
|
+
When(:action_type) { strip_vlan_header.action_type }
|
8
|
+
Then { action_type == 3 }
|
9
9
|
end
|
10
10
|
|
11
|
-
describe '#
|
12
|
-
When(:
|
13
|
-
Then {
|
11
|
+
describe '#length' do
|
12
|
+
When(:length) { strip_vlan_header.length }
|
13
|
+
Then { length == 8 }
|
14
14
|
end
|
15
15
|
|
16
16
|
describe '#to_binary' do
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'pio/open_flow13/error/hello_failed'
|
2
|
+
|
3
|
+
describe Pio::OpenFlow13::Error::HelloFailed do
|
4
|
+
it_should_behave_like('an OpenFlow message',
|
5
|
+
Pio::OpenFlow13::Error::HelloFailed)
|
6
|
+
|
7
|
+
describe '.new' do
|
8
|
+
When(:hello_failed) { Pio::OpenFlow13::Error::HelloFailed.new(options) }
|
9
|
+
|
10
|
+
context 'with {}' do
|
11
|
+
Given(:options) { {} }
|
12
|
+
|
13
|
+
Then { hello_failed.length == 12 }
|
14
|
+
Then { hello_failed.error_type == :hello_failed }
|
15
|
+
Then { hello_failed.error_code == :incompatible }
|
16
|
+
Then { hello_failed.description == '' }
|
17
|
+
end
|
18
|
+
|
19
|
+
context "with description: 'error description'" do
|
20
|
+
Given(:options) { { description: 'error description' } }
|
21
|
+
|
22
|
+
Then { hello_failed.length == 29 }
|
23
|
+
Then { hello_failed.description == 'error description' }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -11,7 +11,7 @@ describe Pio::OpenFlow13::Hello do
|
|
11
11
|
Then { result.class == Pio::OpenFlow13::Hello }
|
12
12
|
Then { result.ofp_version == 4 }
|
13
13
|
Then { result.message_type == 0 }
|
14
|
-
Then { result.
|
14
|
+
Then { result.length == 8 }
|
15
15
|
Then { result.transaction_id == 0 }
|
16
16
|
Then { result.xid == 0 }
|
17
17
|
Then { result.supported_versions.empty? }
|
@@ -25,7 +25,7 @@ describe Pio::OpenFlow13::Hello do
|
|
25
25
|
Then { result.class == Pio::OpenFlow13::Hello }
|
26
26
|
Then { result.ofp_version == 4 }
|
27
27
|
Then { result.message_type == 0 }
|
28
|
-
Then { result.
|
28
|
+
Then { result.length == 16 }
|
29
29
|
Then { result.transaction_id == 0 }
|
30
30
|
Then { result.xid == 0 }
|
31
31
|
Then { result.supported_versions == [:open_flow10, :open_flow13] }
|
@@ -48,7 +48,7 @@ describe Pio::OpenFlow13::Hello do
|
|
48
48
|
|
49
49
|
Then { result.ofp_version == 4 }
|
50
50
|
Then { result.message_type == 0 }
|
51
|
-
Then { result.
|
51
|
+
Then { result.length == 16 }
|
52
52
|
Then { result.transaction_id == 0 }
|
53
53
|
Then { result.xid == 0 }
|
54
54
|
Then { result.supported_versions == [:open_flow13] }
|