pio 0.24.2 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/README.md +2 -0
  4. data/bin/byebug +16 -0
  5. data/features/arp.feature +2 -2
  6. data/features/dhcp.feature +4 -4
  7. data/features/icmp.feature +2 -2
  8. data/features/lldp.feature +1 -1
  9. data/features/open_flow10/barrier_reply.feature +4 -4
  10. data/features/open_flow10/barrier_request.feature +4 -4
  11. data/features/open_flow10/echo_reply.feature +6 -6
  12. data/features/open_flow10/echo_request.feature +6 -6
  13. data/features/open_flow10/exact_match.feature +2 -2
  14. data/features/open_flow10/features_reply.feature +2 -2
  15. data/features/open_flow10/features_request.feature +4 -4
  16. data/features/open_flow10/flow_mod.feature +6 -6
  17. data/features/open_flow10/flow_stats_reply.feature +105 -0
  18. data/features/open_flow10/flow_stats_request.feature +90 -0
  19. data/features/open_flow10/hello.feature +4 -4
  20. data/features/open_flow10/packet_in.feature +2 -2
  21. data/features/open_flow10/packet_out.feature +1 -1
  22. data/features/open_flow10/port_status.feature +1 -1
  23. data/features/open_flow13/apply_actions.feature +3 -3
  24. data/features/open_flow13/echo_reply.feature +7 -7
  25. data/features/open_flow13/echo_request.feature +7 -7
  26. data/features/open_flow13/features_reply.feature +2 -2
  27. data/features/open_flow13/features_request.feature +4 -4
  28. data/features/open_flow13/flow_mod.feature +5 -5
  29. data/features/open_flow13/goto_table.feature +2 -2
  30. data/features/open_flow13/hello.feature +5 -5
  31. data/features/open_flow13/match.feature +81 -81
  32. data/features/open_flow13/meter.feature +2 -2
  33. data/features/open_flow13/packet_in.feature +3 -3
  34. data/features/open_flow13/packet_out.feature +3 -3
  35. data/features/open_flow13/send_out_port.feature +2 -2
  36. data/features/open_flow13/write_metadata.feature +2 -2
  37. data/features/open_flow_read.feature +12 -10
  38. data/features/step_definitions/packet_data_steps.rb +3 -3
  39. data/lib/pio/open_flow.rb +4 -1
  40. data/lib/pio/open_flow/message.rb +3 -0
  41. data/lib/pio/open_flow10.rb +2 -0
  42. data/lib/pio/open_flow10/flow_mod.rb +1 -16
  43. data/lib/pio/open_flow10/flow_stats_reply.rb +59 -0
  44. data/lib/pio/open_flow10/flow_stats_request.rb +64 -0
  45. data/lib/pio/open_flow10/match.rb +17 -0
  46. data/lib/pio/open_flow10/stats_type.rb +27 -0
  47. data/lib/pio/version.rb +1 -1
  48. data/pio.gemspec +2 -2
  49. data/spec/pio/open_flow10/flow_stats_reply_spec.rb +39 -0
  50. data/spec/pio/open_flow10/flow_stats_request_spec.rb +38 -0
  51. metadata +185 -173
@@ -0,0 +1,90 @@
1
+ @open_flow10
2
+ Feature: Pio::FlowStats::Request
3
+ Scenario: new
4
+ When I try to create an OpenFlow message with:
5
+ """
6
+ Pio::FlowStats::Request.new
7
+ """
8
+ Then it should finish successfully
9
+ And the message has the following fields and values:
10
+ | field | value |
11
+ | ofp_version | 1 |
12
+ | message_type | 16 |
13
+ | message_length | 56 |
14
+ | transaction_id | 0 |
15
+ | xid | 0 |
16
+ | stats_type | :flow |
17
+ | match.wildcards.keys.size | 12 |
18
+ | match.wildcards.fetch(:ether_destination_address) | true |
19
+ | match.wildcards.fetch(:ether_source_address) | true |
20
+ | match.wildcards.fetch(:ether_type) | true |
21
+ | match.wildcards.fetch(:in_port) | true |
22
+ | match.wildcards.fetch(:ip_destination_address_all) | true |
23
+ | match.wildcards.fetch(:ip_protocol) | true |
24
+ | match.wildcards.fetch(:ip_source_address_all) | true |
25
+ | match.wildcards.fetch(:ip_tos) | true |
26
+ | match.wildcards.fetch(:transport_destination_port) | true |
27
+ | match.wildcards.fetch(:transport_source_port) | true |
28
+ | match.wildcards.fetch(:vlan_priority) | true |
29
+ | match.wildcards.fetch(:vlan_vid) | true |
30
+ | table_id.to_hex | 0xff |
31
+ | out_port | :none |
32
+
33
+ Scenario: new
34
+ When I try to create an OpenFlow message with:
35
+ """
36
+ Pio::FlowStats::Request.new(match: Match.new(in_port: 1))
37
+ """
38
+ Then it should finish successfully
39
+ And the message has the following fields and values:
40
+ | field | value |
41
+ | ofp_version | 1 |
42
+ | message_type | 16 |
43
+ | message_length | 56 |
44
+ | transaction_id | 0 |
45
+ | xid | 0 |
46
+ | stats_type | :flow |
47
+ | match.in_port | 1 |
48
+ | match.wildcards.keys.size | 11 |
49
+ | match.wildcards.fetch(:ether_destination_address) | true |
50
+ | match.wildcards.fetch(:ether_source_address) | true |
51
+ | match.wildcards.fetch(:ether_type) | true |
52
+ | match.wildcards.fetch(:ip_destination_address_all) | true |
53
+ | match.wildcards.fetch(:ip_protocol) | true |
54
+ | match.wildcards.fetch(:ip_source_address_all) | true |
55
+ | match.wildcards.fetch(:ip_tos) | true |
56
+ | match.wildcards.fetch(:transport_destination_port) | true |
57
+ | match.wildcards.fetch(:transport_source_port) | true |
58
+ | match.wildcards.fetch(:vlan_priority) | true |
59
+ | match.wildcards.fetch(:vlan_vid) | true |
60
+ | table_id.to_hex | 0xff |
61
+ | out_port | :none |
62
+
63
+
64
+ Scenario: read
65
+ When I try to parse a file named "open_flow10/flow_stats_request.raw" with "FlowStats::Request" class
66
+ Then it should finish successfully
67
+ And the message has the following fields and values:
68
+ | field | value |
69
+ | ofp_version | 1 |
70
+ | message_type | 16 |
71
+ | message_length | 56 |
72
+ | transaction_id | 13 |
73
+ | xid | 13 |
74
+ | stats_type | :flow |
75
+ | match.wildcards.keys.size | 12 |
76
+ | match.wildcards.fetch(:ether_destination_address) | true |
77
+ | match.wildcards.fetch(:ether_source_address) | true |
78
+ | match.wildcards.fetch(:ether_type) | true |
79
+ | match.wildcards.fetch(:in_port) | true |
80
+ | match.wildcards.fetch(:ip_destination_address_all) | true |
81
+ | match.wildcards.fetch(:ip_protocol) | true |
82
+ | match.wildcards.fetch(:ip_source_address_all) | true |
83
+ | match.wildcards.fetch(:ip_tos) | true |
84
+ | match.wildcards.fetch(:transport_destination_port) | true |
85
+ | match.wildcards.fetch(:transport_source_port) | true |
86
+ | match.wildcards.fetch(:vlan_priority) | true |
87
+ | match.wildcards.fetch(:vlan_vid) | true |
88
+ | table_id.to_hex | 0xff |
89
+ | out_port | :none |
90
+
@@ -6,7 +6,7 @@ Feature: Pio::Hello
6
6
  Pio::Hello.new
7
7
  """
8
8
  Then it should finish successfully
9
- And the message have the following fields and values:
9
+ And the message has the following fields and values:
10
10
  | field | value |
11
11
  | ofp_version | 1 |
12
12
  | message_type | 0 |
@@ -22,7 +22,7 @@ Feature: Pio::Hello
22
22
  Pio::Hello.new(transaction_id: 123)
23
23
  """
24
24
  Then it should finish successfully
25
- And the message have the following fields and values:
25
+ And the message has the following fields and values:
26
26
  | field | value |
27
27
  | ofp_version | 1 |
28
28
  | message_type | 0 |
@@ -38,7 +38,7 @@ Feature: Pio::Hello
38
38
  Pio::Hello.new(xid: 123)
39
39
  """
40
40
  Then it should finish successfully
41
- And the message have the following fields and values:
41
+ And the message has the following fields and values:
42
42
  | field | value |
43
43
  | ofp_version | 1 |
44
44
  | message_type | 0 |
@@ -58,7 +58,7 @@ Feature: Pio::Hello
58
58
  Scenario: read
59
59
  When I try to parse a file named "open_flow10/hello.raw" with "Hello" class
60
60
  Then it should finish successfully
61
- And the message have the following fields and values:
61
+ And the message has the following fields and values:
62
62
  | field | value |
63
63
  | ofp_version | 1 |
64
64
  | message_type | 0 |
@@ -19,7 +19,7 @@ Feature: Pio::PacketIn
19
19
  raw_data: data_dump)
20
20
  """
21
21
  Then it should finish successfully
22
- And the message have the following fields and values:
22
+ And the message has the following fields and values:
23
23
  | field | value |
24
24
  | ofp_version | 1 |
25
25
  | message_type | 10 |
@@ -39,7 +39,7 @@ Feature: Pio::PacketIn
39
39
  Scenario: read
40
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
- And the message have the following fields and values:
42
+ And the message has the following fields and values:
43
43
  | field | value |
44
44
  | ofp_version | 1 |
45
45
  | message_type | 10 |
@@ -3,7 +3,7 @@ Feature: Pio::PacketOut
3
3
  Scenario: read
4
4
  When I try to parse a file named "open_flow10/packet_out.raw" with "PacketOut" class
5
5
  Then it should finish successfully
6
- And the message have the following fields and values:
6
+ And the message has the following fields and values:
7
7
  | field | value |
8
8
  | ofp_version | 1 |
9
9
  | message_type | 13 |
@@ -2,7 +2,7 @@ Feature: Pio::PortStatus
2
2
  Scenario: read
3
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
- And the message have the following fields and values:
5
+ And the message has the following fields and values:
6
6
  | field | value |
7
7
  | class | Pio::OpenFlow10::PortStatus |
8
8
  | ofp_version | 1 |
@@ -6,7 +6,7 @@ Feature: Apply-Actions instruction.
6
6
  Pio::Apply.new
7
7
  """
8
8
  Then it should finish successfully
9
- And the message have the following fields and values:
9
+ And the message has the following fields and values:
10
10
  | field | value |
11
11
  | class | Pio::Apply |
12
12
  | instruction_type | 4 |
@@ -19,7 +19,7 @@ Feature: Apply-Actions instruction.
19
19
  Pio::Apply.new(SendOutPort.new(1))
20
20
  """
21
21
  Then it should finish successfully
22
- And the message have the following fields and values:
22
+ And the message has the following fields and values:
23
23
  | field | value |
24
24
  | class | Pio::Apply |
25
25
  | instruction_type | 4 |
@@ -31,7 +31,7 @@ Feature: Apply-Actions instruction.
31
31
  Scenario: read
32
32
  When I try to parse a file named "open_flow13/apply_actions.raw" with "Pio::Apply" class
33
33
  Then it should finish successfully
34
- And the message have the following fields and values:
34
+ And the message has the following fields and values:
35
35
  | field | value |
36
36
  | class | Pio::Apply |
37
37
  | instruction_type | 4 |
@@ -6,7 +6,7 @@ Feature: Pio::Echo::Reply
6
6
  Pio::Echo::Reply.new
7
7
  """
8
8
  Then it should finish successfully
9
- And the message have the following fields and values:
9
+ And the message has the following fields and values:
10
10
  | field | value |
11
11
  | ofp_version | 4 |
12
12
  | message_type | 3 |
@@ -22,7 +22,7 @@ Feature: Pio::Echo::Reply
22
22
  Pio::Echo::Reply.new(transaction_id: 123)
23
23
  """
24
24
  Then it should finish successfully
25
- And the message have the following fields and values:
25
+ And the message has the following fields and values:
26
26
  | field | value |
27
27
  | ofp_version | 4 |
28
28
  | message_type | 3 |
@@ -38,7 +38,7 @@ Feature: Pio::Echo::Reply
38
38
  Pio::Echo::Reply.new(xid: 123)
39
39
  """
40
40
  Then it should finish successfully
41
- And the message have the following fields and values:
41
+ And the message has the following fields and values:
42
42
  | field | value |
43
43
  | ofp_version | 4 |
44
44
  | message_type | 3 |
@@ -54,7 +54,7 @@ Feature: Pio::Echo::Reply
54
54
  Pio::Echo::Reply.new(body: 'echo reply body')
55
55
  """
56
56
  Then it should finish successfully
57
- And the message have the following fields and values:
57
+ And the message has the following fields and values:
58
58
  | field | value |
59
59
  | ofp_version | 4 |
60
60
  | message_type | 3 |
@@ -70,7 +70,7 @@ Feature: Pio::Echo::Reply
70
70
  Pio::Echo::Reply.new(user_data: 'echo reply body')
71
71
  """
72
72
  Then it should finish successfully
73
- And the message have the following fields and values:
73
+ And the message has the following fields and values:
74
74
  | field | value |
75
75
  | ofp_version | 4 |
76
76
  | message_type | 3 |
@@ -90,7 +90,7 @@ Feature: Pio::Echo::Reply
90
90
  Scenario: read (no message body)
91
91
  When I try to parse a file named "open_flow13/echo_reply_no_body.raw" with "Pio::Echo::Reply" class
92
92
  Then it should finish successfully
93
- And the message have the following fields and values:
93
+ And the message has the following fields and values:
94
94
  | field | value |
95
95
  | ofp_version | 4 |
96
96
  | message_type | 3 |
@@ -103,7 +103,7 @@ Feature: Pio::Echo::Reply
103
103
  Scenario: read
104
104
  When I try to parse a file named "open_flow13/echo_reply_body.raw" with "Pio::Echo::Reply" class
105
105
  Then it should finish successfully
106
- And the message have the following fields and values:
106
+ And the message has the following fields and values:
107
107
  | field | value |
108
108
  | ofp_version | 4 |
109
109
  | message_type | 3 |
@@ -6,7 +6,7 @@ Feature: Pio::Echo::Request
6
6
  Pio::Echo::Request.new
7
7
  """
8
8
  Then it should finish successfully
9
- And the message have the following fields and values:
9
+ And the message has the following fields and values:
10
10
  | field | value |
11
11
  | ofp_version | 4 |
12
12
  | message_type | 2 |
@@ -22,7 +22,7 @@ Feature: Pio::Echo::Request
22
22
  Pio::Echo::Request.new(transaction_id: 123)
23
23
  """
24
24
  Then it should finish successfully
25
- And the message have the following fields and values:
25
+ And the message has the following fields and values:
26
26
  | field | value |
27
27
  | ofp_version | 4 |
28
28
  | message_type | 2 |
@@ -38,7 +38,7 @@ Feature: Pio::Echo::Request
38
38
  Pio::Echo::Request.new(xid: 123)
39
39
  """
40
40
  Then it should finish successfully
41
- And the message have the following fields and values:
41
+ And the message has the following fields and values:
42
42
  | field | value |
43
43
  | ofp_version | 4 |
44
44
  | message_type | 2 |
@@ -54,7 +54,7 @@ Feature: Pio::Echo::Request
54
54
  Pio::Echo::Request.new(body: 'echo request body')
55
55
  """
56
56
  Then it should finish successfully
57
- And the message have the following fields and values:
57
+ And the message has the following fields and values:
58
58
  | field | value |
59
59
  | ofp_version | 4 |
60
60
  | message_type | 2 |
@@ -70,7 +70,7 @@ Feature: Pio::Echo::Request
70
70
  Pio::Echo::Request.new(user_data: 'echo request body')
71
71
  """
72
72
  Then it should finish successfully
73
- And the message have the following fields and values:
73
+ And the message has the following fields and values:
74
74
  | field | value |
75
75
  | ofp_version | 4 |
76
76
  | message_type | 2 |
@@ -90,7 +90,7 @@ Feature: Pio::Echo::Request
90
90
  Scenario: read (no message body)
91
91
  When I try to parse a file named "open_flow13/echo_request_no_body.raw" with "Pio::Echo::Request" class
92
92
  Then it should finish successfully
93
- And the message have the following fields and values:
93
+ And the message has the following fields and values:
94
94
  | field | value |
95
95
  | ofp_version | 4 |
96
96
  | message_type | 2 |
@@ -103,7 +103,7 @@ Feature: Pio::Echo::Request
103
103
  Scenario: read
104
104
  When I try to parse a file named "open_flow13/echo_request_body.raw" with "Pio::Echo::Request" class
105
105
  Then it should finish successfully
106
- And the message have the following fields and values:
106
+ And the message has the following fields and values:
107
107
  | field | value |
108
108
  | ofp_version | 4 |
109
109
  | message_type | 2 |
@@ -11,7 +11,7 @@ Feature: Pio::Features::Reply
11
11
  )
12
12
  """
13
13
  Then it should finish successfully
14
- And the message have the following fields and values:
14
+ And the message has the following fields and values:
15
15
  | field | value |
16
16
  | ofp_version | 4 |
17
17
  | message_type | 6 |
@@ -29,7 +29,7 @@ Feature: Pio::Features::Reply
29
29
  Scenario: read
30
30
  When I try to parse a file named "open_flow13/features_reply.raw" with "Pio::Features::Reply" class
31
31
  Then it should finish successfully
32
- And the message have the following fields and values:
32
+ And the message has the following fields and values:
33
33
  | field | value |
34
34
  | ofp_version | 4 |
35
35
  | message_type | 6 |
@@ -6,7 +6,7 @@ Feature: Pio::Features::Request
6
6
  Pio::Features::Request.new
7
7
  """
8
8
  Then it should finish successfully
9
- And the message have the following fields and values:
9
+ And the message has the following fields and values:
10
10
  | field | value |
11
11
  | ofp_version | 4 |
12
12
  | message_type | 5 |
@@ -21,7 +21,7 @@ Feature: Pio::Features::Request
21
21
  Pio::Features::Request.new(transaction_id: 123)
22
22
  """
23
23
  Then it should finish successfully
24
- And the message have the following fields and values:
24
+ And the message has the following fields and values:
25
25
  | field | value |
26
26
  | ofp_version | 4 |
27
27
  | message_type | 5 |
@@ -36,7 +36,7 @@ Feature: Pio::Features::Request
36
36
  Pio::Features::Request.new(xid: 123)
37
37
  """
38
38
  Then it should finish successfully
39
- And the message have the following fields and values:
39
+ And the message has the following fields and values:
40
40
  | field | value |
41
41
  | ofp_version | 4 |
42
42
  | message_type | 5 |
@@ -55,7 +55,7 @@ Feature: Pio::Features::Request
55
55
  Scenario: read
56
56
  When I try to parse a file named "open_flow13/features_request.raw" with "Pio::Features::Request" class
57
57
  Then it should finish successfully
58
- And the message have the following fields and values:
58
+ And the message has the following fields and values:
59
59
  | field | value |
60
60
  | ofp_version | 4 |
61
61
  | message_type | 5 |
@@ -6,7 +6,7 @@ Feature: Pio::FlowMod
6
6
  Pio::FlowMod.new
7
7
  """
8
8
  Then it should finish successfully
9
- And the message have the following fields and values:
9
+ And the message has the following fields and values:
10
10
  | field | value |
11
11
  | ofp_version | 4 |
12
12
  | message_type | 14 |
@@ -34,7 +34,7 @@ Feature: Pio::FlowMod
34
34
  Pio::FlowMod.new(instructions: Pio::Apply.new(SendOutPort.new(1)))
35
35
  """
36
36
  Then it should finish successfully
37
- And the message have the following fields and values:
37
+ And the message has the following fields and values:
38
38
  | field | value |
39
39
  | ofp_version | 4 |
40
40
  | message_type | 14 |
@@ -64,7 +64,7 @@ Feature: Pio::FlowMod
64
64
  Pio::FlowMod.new(match: Pio::Match.new(in_port: 1), instructions: Pio::Apply.new(SendOutPort.new(1)))
65
65
  """
66
66
  Then it should finish successfully
67
- And the message have the following fields and values:
67
+ And the message has the following fields and values:
68
68
  | field | value |
69
69
  | ofp_version | 4 |
70
70
  | message_type | 14 |
@@ -91,7 +91,7 @@ Feature: Pio::FlowMod
91
91
  Scenario: read (no match or instructions)
92
92
  When I try to parse a file named "open_flow13/flow_mod_no_match_or_instructions.raw" with "Pio::FlowMod" class
93
93
  Then it should finish successfully
94
- And the message have the following fields and values:
94
+ And the message has the following fields and values:
95
95
  | field | value |
96
96
  | ofp_version | 4 |
97
97
  | message_type | 14 |
@@ -115,7 +115,7 @@ Feature: Pio::FlowMod
115
115
  Scenario: read (instruction = apply, action = SendOutPort(port: 1))
116
116
  When I try to parse a file named "open_flow13/flow_mod_add_apply_no_match.raw" with "Pio::FlowMod" class
117
117
  Then it should finish successfully
118
- And the message have the following fields and values:
118
+ And the message has the following fields and values:
119
119
  | field | value |
120
120
  | ofp_version | 4 |
121
121
  | message_type | 14 |
@@ -6,7 +6,7 @@ Feature: Pio::GotoTable
6
6
  Pio::GotoTable.new(1)
7
7
  """
8
8
  Then it should finish successfully
9
- And the message have the following fields and values:
9
+ And the message has the following fields and values:
10
10
  | field | value |
11
11
  | class | Pio::GotoTable |
12
12
  | instruction_type | 1 |
@@ -17,7 +17,7 @@ Feature: Pio::GotoTable
17
17
  Scenario: read
18
18
  When I try to parse a file named "open_flow13/instruction_goto_table.raw" with "Pio::GotoTable" class
19
19
  Then it should finish successfully
20
- And the message have the following fields and values:
20
+ And the message has the following fields and values:
21
21
  | field | value |
22
22
  | class | Pio::GotoTable |
23
23
  | instruction_type | 1 |
@@ -6,7 +6,7 @@ Feature: Pio::Hello
6
6
  Pio::Hello.new
7
7
  """
8
8
  Then it should finish successfully
9
- And the message have the following fields and values:
9
+ And the message has the following fields and values:
10
10
  | field | value |
11
11
  | ofp_version | 4 |
12
12
  | message_type | 0 |
@@ -21,7 +21,7 @@ Feature: Pio::Hello
21
21
  Pio::Hello.new(transaction_id: 123)
22
22
  """
23
23
  Then it should finish successfully
24
- And the message have the following fields and values:
24
+ And the message has the following fields and values:
25
25
  | field | value |
26
26
  | ofp_version | 4 |
27
27
  | message_type | 0 |
@@ -36,7 +36,7 @@ Feature: Pio::Hello
36
36
  Pio::Hello.new(xid: 123)
37
37
  """
38
38
  Then it should finish successfully
39
- And the message have the following fields and values:
39
+ And the message has the following fields and values:
40
40
  | field | value |
41
41
  | ofp_version | 4 |
42
42
  | message_type | 0 |
@@ -48,7 +48,7 @@ Feature: Pio::Hello
48
48
  Scenario: read (no version bitmap)
49
49
  When I try to parse a file named "open_flow13/hello_no_version_bitmap.raw" with "Pio::Hello" class
50
50
  Then it should finish successfully
51
- And the message have the following fields and values:
51
+ And the message has the following fields and values:
52
52
  | field | value |
53
53
  | ofp_version | 4 |
54
54
  | message_type | 0 |
@@ -60,7 +60,7 @@ Feature: Pio::Hello
60
60
  Scenario: read
61
61
  When I try to parse a file named "open_flow13/hello_version_bitmap.raw" with "Pio::Hello" class
62
62
  Then it should finish successfully
63
- And the message have the following fields and values:
63
+ And the message has the following fields and values:
64
64
  | field | value |
65
65
  | ofp_version | 4 |
66
66
  | message_type | 0 |