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::GotoTable
|
2
|
-
Background:
|
3
|
-
Given I use OpenFlow 1.3
|
4
|
-
|
5
3
|
Scenario: new(1)
|
6
4
|
When I try to create an OpenFlow instruction with:
|
7
5
|
"""
|
@@ -13,6 +11,7 @@ Feature: Pio::GotoTable
|
|
13
11
|
| class | Pio::GotoTable |
|
14
12
|
| instruction_type | 1 |
|
15
13
|
| instruction_length | 8 |
|
14
|
+
| to_binary_s.length | 8 |
|
16
15
|
| table_id | 1 |
|
17
16
|
|
18
17
|
Scenario: read
|
@@ -22,5 +21,6 @@ Feature: Pio::GotoTable
|
|
22
21
|
| field | value |
|
23
22
|
| class | Pio::GotoTable |
|
24
23
|
| instruction_type | 1 |
|
25
|
-
| instruction_length | 8 |
|
24
|
+
| instruction_length | 8 |
|
25
|
+
| to_binary_s.length | 8 |
|
26
26
|
| table_id | 1 |
|
@@ -1,7 +1,5 @@
|
|
1
|
+
@open_flow13
|
1
2
|
Feature: Pio::Hello
|
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::Hello
|
|
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::Hello |
|
14
11
|
| ofp_version | 4 |
|
15
12
|
| message_type | 0 |
|
16
13
|
| message_length | 16 |
|
@@ -26,7 +23,6 @@ Feature: Pio::Hello
|
|
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::Hello |
|
30
26
|
| ofp_version | 4 |
|
31
27
|
| message_type | 0 |
|
32
28
|
| message_length | 16 |
|
@@ -42,7 +38,6 @@ Feature: Pio::Hello
|
|
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::Hello |
|
46
41
|
| ofp_version | 4 |
|
47
42
|
| message_type | 0 |
|
48
43
|
| message_length | 16 |
|
@@ -54,21 +49,19 @@ Feature: Pio::Hello
|
|
54
49
|
When I try to parse a file named "open_flow13/hello_no_version_bitmap.raw" with "Pio::Hello" class
|
55
50
|
Then it should finish successfully
|
56
51
|
And the message have the following fields and values:
|
57
|
-
| field |
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
| supported_versions | [] |
|
52
|
+
| field | value |
|
53
|
+
| ofp_version | 4 |
|
54
|
+
| message_type | 0 |
|
55
|
+
| message_length | 8 |
|
56
|
+
| transaction_id | 0 |
|
57
|
+
| xid | 0 |
|
58
|
+
| supported_versions | [] |
|
65
59
|
|
66
60
|
Scenario: read
|
67
61
|
When I try to parse a file named "open_flow13/hello_version_bitmap.raw" with "Pio::Hello" class
|
68
62
|
Then it should finish successfully
|
69
63
|
And the message have the following fields and values:
|
70
64
|
| field | value |
|
71
|
-
| class | Pio::Hello |
|
72
65
|
| ofp_version | 4 |
|
73
66
|
| message_type | 0 |
|
74
67
|
| message_length | 16 |
|
@@ -1,7 +1,5 @@
|
|
1
|
+
@open_flow13
|
1
2
|
Feature: Pio::Match
|
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
|
"""
|
@@ -777,3 +775,16 @@ Feature: Pio::Match
|
|
777
775
|
| field | value |
|
778
776
|
| tunnel_id | 1 |
|
779
777
|
| tunnel_id_mask | 9223372036854775808 |
|
778
|
+
|
779
|
+
Scenario: read (file: open_flow13/oxm_invalid_field.raw)
|
780
|
+
When I try to parse a file named "open_flow13/oxm_invalid_field.raw" with "Pio::Match" class
|
781
|
+
Then it should fail with "RuntimeError", "Unknown OXM field value: 40"
|
782
|
+
|
783
|
+
Scenario: read (file: open_flow13/oxm_experimenter_stratos_basic_dot11.raw)
|
784
|
+
When I try to parse a file named "open_flow13/oxm_experimenter_stratos_basic_dot11.raw" with "Pio::Match" class
|
785
|
+
Then it should finish successfully
|
786
|
+
And the message have the following fields and values:
|
787
|
+
| field | value |
|
788
|
+
| match_fields.at(0).oxm_field | 0 |
|
789
|
+
| match_fields.at(0).experimenter | 4278247501 |
|
790
|
+
| match_fields.at(0).data.inspect | "\x00\x01\x01" |
|
@@ -1,7 +1,5 @@
|
|
1
|
+
@open_flow13
|
1
2
|
Feature: Pio::Meter
|
2
|
-
Background:
|
3
|
-
Given I use OpenFlow 1.3
|
4
|
-
|
5
3
|
Scenario: new(1)
|
6
4
|
When I try to create an OpenFlow instruction with:
|
7
5
|
"""
|
@@ -13,6 +11,7 @@ Feature: Pio::Meter
|
|
13
11
|
| class | Pio::Meter |
|
14
12
|
| instruction_type | 6 |
|
15
13
|
| instruction_length | 8 |
|
14
|
+
| to_binary_s.length | 8 |
|
16
15
|
| meter_id | 1 |
|
17
16
|
|
18
17
|
Scenario: read
|
@@ -23,4 +22,5 @@ Feature: Pio::Meter
|
|
23
22
|
| class | Pio::Meter |
|
24
23
|
| instruction_type | 6 |
|
25
24
|
| instruction_length | 8 |
|
25
|
+
| to_binary_s.length | 8 |
|
26
26
|
| meter_id | 1 |
|
Binary file
|
Binary file
|
@@ -1,7 +1,5 @@
|
|
1
|
+
@open_flow13
|
1
2
|
Feature: Pio::PacketIn
|
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,20 +7,19 @@ Feature: Pio::PacketIn
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
| raw_data.length | 0 |
|
10
|
+
| field | value |
|
11
|
+
| ofp_version | 4 |
|
12
|
+
| message_type | 10 |
|
13
|
+
| message_length | 34 |
|
14
|
+
| transaction_id | 0 |
|
15
|
+
| xid | 0 |
|
16
|
+
| buffer_id | 0 |
|
17
|
+
| total_len | 0 |
|
18
|
+
| reason | :no_match |
|
19
|
+
| table_id | 0 |
|
20
|
+
| cookie | 0 |
|
21
|
+
| match.match_fields.size | 0 |
|
22
|
+
| raw_data.length | 0 |
|
26
23
|
|
27
24
|
Scenario: new (raw_data = ARP request)
|
28
25
|
When I try to create an OpenFlow message with:
|
@@ -41,9 +38,7 @@ Feature: Pio::PacketIn
|
|
41
38
|
Then it should finish successfully
|
42
39
|
And the message have the following fields and values:
|
43
40
|
| field | value |
|
44
|
-
| class | Pio::PacketIn |
|
45
41
|
| ofp_version | 4 |
|
46
|
-
| message_type | 10 |
|
47
42
|
| message_length | 94 |
|
48
43
|
| transaction_id | 0 |
|
49
44
|
| xid | 0 |
|
@@ -62,7 +57,6 @@ Feature: Pio::PacketIn
|
|
62
57
|
Then it should finish successfully
|
63
58
|
And the message have the following fields and values:
|
64
59
|
| field | value |
|
65
|
-
| class | Pio::PacketIn |
|
66
60
|
| ofp_version | 4 |
|
67
61
|
| message_type | 10 |
|
68
62
|
| message_length | 102 |
|
@@ -70,6 +64,7 @@ Feature: Pio::PacketIn
|
|
70
64
|
| xid | 123 |
|
71
65
|
| buffer_id.to_hex | 0xcafebabe |
|
72
66
|
| total_len | 60 |
|
67
|
+
| in_port | 1 |
|
73
68
|
| reason | :no_match |
|
74
69
|
| table_id | 0 |
|
75
70
|
| cookie | 0 |
|
@@ -1,7 +1,5 @@
|
|
1
|
+
@open_flow13
|
1
2
|
Feature: Pio::PacketOut
|
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,17 +7,17 @@ Feature: Pio::PacketOut
|
|
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
|
-
| transaction_id
|
18
|
-
| xid
|
19
|
-
| buffer_id
|
20
|
-
| in_port
|
21
|
-
| actions_length
|
22
|
-
| raw_data.length
|
10
|
+
| field | value |
|
11
|
+
| ofp_version | 4 |
|
12
|
+
| message_type | 13 |
|
13
|
+
| message_length | 24 |
|
14
|
+
| to_binary.length | 24 |
|
15
|
+
| transaction_id | 0 |
|
16
|
+
| xid | 0 |
|
17
|
+
| buffer_id | :no_buffer |
|
18
|
+
| in_port | 0 |
|
19
|
+
| actions_length | 0 |
|
20
|
+
| raw_data.length | 0 |
|
23
21
|
|
24
22
|
Scenario: new (actions = SendOutPort(1), raw_data = ARP Request)
|
25
23
|
When I try to create an OpenFlow message with:
|
@@ -38,10 +36,10 @@ Feature: Pio::PacketOut
|
|
38
36
|
Then it should finish successfully
|
39
37
|
And the message have the following fields and values:
|
40
38
|
| field | value |
|
41
|
-
| class | Pio::PacketOut |
|
42
39
|
| ofp_version | 4 |
|
43
40
|
| message_type | 13 |
|
44
41
|
| message_length | 100 |
|
42
|
+
| to_binary.length | 100 |
|
45
43
|
| transaction_id | 0 |
|
46
44
|
| xid | 0 |
|
47
45
|
| buffer_id | :no_buffer |
|
@@ -66,31 +64,30 @@ Feature: Pio::PacketOut
|
|
66
64
|
When I try to parse a file named "open_flow13/packet_out.raw" with "PacketOut" class
|
67
65
|
Then it should finish successfully
|
68
66
|
And the message have the following fields and values:
|
69
|
-
| field |
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
| actions.first.
|
80
|
-
| actions.first.
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
| target_protocol_address | 192.168.2.5 |
|
67
|
+
| field | value |
|
68
|
+
| ofp_version | 4 |
|
69
|
+
| message_type | 13 |
|
70
|
+
| message_length | 100 |
|
71
|
+
| transaction_id | 123 |
|
72
|
+
| xid | 123 |
|
73
|
+
| buffer_id | :no_buffer |
|
74
|
+
| in_port | :controller |
|
75
|
+
| actions_length | 16 |
|
76
|
+
| actions.first.class | Pio::OpenFlow13::SendOutPort |
|
77
|
+
| actions.first.port | 1 |
|
78
|
+
| actions.first.max_length | :no_buffer |
|
79
|
+
| raw_data.length | 60 |
|
80
|
+
| data.class | Pio::Arp::Request |
|
81
|
+
| destination_mac | ff:ff:ff:ff:ff:ff |
|
82
|
+
| source_mac | ac:5d:10:31:37:79 |
|
83
|
+
| ether_type | 2054 |
|
84
|
+
| hardware_type | 1 |
|
85
|
+
| protocol_type | 2048 |
|
86
|
+
| hardware_length | 6 |
|
87
|
+
| protocol_length | 4 |
|
88
|
+
| operation | 1 |
|
89
|
+
| sender_hardware_address | ac:5d:10:31:37:79 |
|
90
|
+
| sender_protocol_address | 192.168.2.254 |
|
91
|
+
| target_hardware_address | ff:ff:ff:ff:ff:ff |
|
92
|
+
| target_protocol_address | 192.168.2.5 |
|
96
93
|
|
@@ -1,7 +1,5 @@
|
|
1
|
+
@open_flow13
|
1
2
|
Feature: Pio::SendOutPort
|
2
|
-
Background:
|
3
|
-
Given I use OpenFlow 1.3
|
4
|
-
|
5
3
|
Scenario: new(1)
|
6
4
|
When I try to create an OpenFlow action with:
|
7
5
|
"""
|
@@ -10,7 +8,6 @@ Feature: Pio::SendOutPort
|
|
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::SendOutPort |
|
14
11
|
| action_type | 0 |
|
15
12
|
| action_length | 16 |
|
16
13
|
| port | 1 |
|
@@ -21,7 +18,6 @@ Feature: Pio::SendOutPort
|
|
21
18
|
Then it should finish successfully
|
22
19
|
And the message have the following fields and values:
|
23
20
|
| field | value |
|
24
|
-
| class | Pio::SendOutPort |
|
25
21
|
| action_type | 0 |
|
26
22
|
| action_length | 16 |
|
27
23
|
| port | 1 |
|
@@ -1,7 +1,5 @@
|
|
1
|
+
@open_flow13
|
1
2
|
Feature: Pio::WriteMetadata
|
2
|
-
Background:
|
3
|
-
Given I use OpenFlow 1.3
|
4
|
-
|
5
3
|
Scenario: new(metadata: 1)
|
6
4
|
When I try to create an OpenFlow instruction with:
|
7
5
|
"""
|
@@ -13,6 +11,7 @@ Feature: Pio::WriteMetadata
|
|
13
11
|
| class | Pio::WriteMetadata |
|
14
12
|
| instruction_type | 2 |
|
15
13
|
| instruction_length | 24 |
|
14
|
+
| to_binary_s.length | 24 |
|
16
15
|
| metadata | 1 |
|
17
16
|
| metadata_mask | 0 |
|
18
17
|
|
@@ -24,5 +23,6 @@ Feature: Pio::WriteMetadata
|
|
24
23
|
| class | Pio::WriteMetadata |
|
25
24
|
| instruction_type | 2 |
|
26
25
|
| instruction_length | 24 |
|
26
|
+
| to_binary_s.length | 24 |
|
27
27
|
| metadata | 1 |
|
28
28
|
| metadata_mask | 1 |
|
@@ -0,0 +1,43 @@
|
|
1
|
+
Feature: Pio::OpenFlow.read
|
2
|
+
Scenario: Hello
|
3
|
+
Given I switch the Pio::OpenFlow version to "OpenFlow10"
|
4
|
+
When I try to parse a file named "open_flow10/hello.raw" with "OpenFlow" class
|
5
|
+
Then it should finish successfully
|
6
|
+
And the message should be a "Pio::OpenFlow10::Hello"
|
7
|
+
|
8
|
+
Scenario: Echo::Request
|
9
|
+
Given I switch the Pio::OpenFlow version to "OpenFlow10"
|
10
|
+
When I try to parse a file named "open_flow10/echo_request.raw" with "OpenFlow" class
|
11
|
+
Then it should finish successfully
|
12
|
+
And the message should be a "Pio::OpenFlow10::Echo::Request"
|
13
|
+
|
14
|
+
Scenario: Echo::Reply
|
15
|
+
Given I switch the Pio::OpenFlow version to "OpenFlow10"
|
16
|
+
When I try to parse a file named "open_flow10/echo_reply.raw" with "OpenFlow" class
|
17
|
+
Then it should finish successfully
|
18
|
+
And the message should be a "Pio::OpenFlow10::Echo::Reply"
|
19
|
+
|
20
|
+
Scenario: Features::Request
|
21
|
+
Given I switch the Pio::OpenFlow version to "OpenFlow10"
|
22
|
+
When I try to parse a file named "open_flow10/features_request.raw" with "OpenFlow" class
|
23
|
+
Then it should finish successfully
|
24
|
+
And the message should be a "Pio::OpenFlow10::Features::Request"
|
25
|
+
|
26
|
+
Scenario: Features::Reply
|
27
|
+
Given I switch the Pio::OpenFlow version to "OpenFlow10"
|
28
|
+
When I try to parse a file named "open_flow10/features_reply.raw" with "OpenFlow" class
|
29
|
+
Then it should finish successfully
|
30
|
+
And the message should be a "Pio::OpenFlow10::Features::Reply"
|
31
|
+
|
32
|
+
Scenario: PacketIn
|
33
|
+
Given I switch the Pio::OpenFlow version to "OpenFlow10"
|
34
|
+
When I try to parse a file named "open_flow10/packet_in.raw" with "OpenFlow" class
|
35
|
+
Then it should finish successfully
|
36
|
+
And the message should be a "Pio::OpenFlow10::PacketIn"
|
37
|
+
|
38
|
+
Scenario: PortStatus
|
39
|
+
Given I switch the Pio::OpenFlow version to "OpenFlow10"
|
40
|
+
When I try to parse a file named "open_flow10/port_status.raw" with "OpenFlow" class
|
41
|
+
Then it should finish successfully
|
42
|
+
And the message should be a "Pio::OpenFlow10::PortStatus"
|
43
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
Feature: Pio::OpenFlow.version
|
2
|
+
Scenario: OpenFlow 1.0
|
3
|
+
Given I switch the Pio::OpenFlow version to "OpenFlow10"
|
4
|
+
When I get the OpenFlow version string
|
5
|
+
Then the version string should be "OpenFlow10"
|
6
|
+
|
7
|
+
Scenario: OpenFlow 1.3
|
8
|
+
Given I switch the Pio::OpenFlow version to "OpenFlow13"
|
9
|
+
When I get the OpenFlow version string
|
10
|
+
Then the version string should be "OpenFlow13"
|
@@ -1,5 +1,13 @@
|
|
1
|
-
Given(/^I
|
2
|
-
|
1
|
+
Given(/^I switch the Pio::OpenFlow version to "([^"]*)"$/) do |version|
|
2
|
+
Pio::OpenFlow.switch_version version.to_sym
|
3
|
+
end
|
4
|
+
|
5
|
+
When(/^I get the OpenFlow version string$/) do
|
6
|
+
@version = Pio::OpenFlow.version
|
7
|
+
end
|
8
|
+
|
9
|
+
Then(/^the version string should be "([^"]*)"$/) do |expected_version_string|
|
10
|
+
expect(@version).to eq(expected_version_string)
|
3
11
|
end
|
4
12
|
|
5
13
|
When(/^I try to create a packet with:$/) do |ruby_code|
|
@@ -40,6 +40,10 @@ When(/^I create an exact match from "(.*?)"$/) do |path|
|
|
40
40
|
@result = Pio::ExactMatch.new(Pio::PacketIn.read(IO.read(full_path)))
|
41
41
|
end
|
42
42
|
|
43
|
+
Then(/^the message should be a "([^"]*)"$/) do |expected_klass|
|
44
|
+
expect(@result.class.to_s).to eq(expected_klass)
|
45
|
+
end
|
46
|
+
|
43
47
|
Then(/^the packet have the following fields and values:$/) do |table|
|
44
48
|
table.hashes.each do |each|
|
45
49
|
output = @result.instance_eval("self.#{each['field']}")
|