pio 0.30.1 → 0.30.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (261) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -4
  3. data/Rakefile +6 -4
  4. data/features/step_definitions/Gemfile +2 -0
  5. data/features/step_definitions/Guardfile +2 -0
  6. data/features/step_definitions/Rakefile +2 -0
  7. data/features/step_definitions/dump_flows_steps.rb +2 -0
  8. data/features/step_definitions/open_flow_steps.rb +2 -0
  9. data/features/step_definitions/packet_data_steps.rb +3 -1
  10. data/features/step_definitions/rest_api_steps.rb +2 -0
  11. data/features/step_definitions/ruby_steps.rb +2 -0
  12. data/features/step_definitions/show_stats_steps.rb +2 -0
  13. data/features/step_definitions/trema_steps.rb +2 -0
  14. data/features/step_definitions/virtual_link_steps.rb +2 -0
  15. data/features/support/env.rb +1 -2
  16. data/features/support/hooks.rb +2 -0
  17. data/lib/pio.rb +2 -0
  18. data/lib/pio/arp.rb +2 -0
  19. data/lib/pio/arp/format.rb +2 -0
  20. data/lib/pio/arp/message.rb +2 -0
  21. data/lib/pio/arp/reply.rb +2 -0
  22. data/lib/pio/arp/request.rb +4 -2
  23. data/lib/pio/class_inspector.rb +2 -0
  24. data/lib/pio/dhcp.rb +2 -0
  25. data/lib/pio/dhcp/ack.rb +2 -0
  26. data/lib/pio/dhcp/boot_reply.rb +2 -0
  27. data/lib/pio/dhcp/boot_reply_options.rb +2 -0
  28. data/lib/pio/dhcp/boot_request.rb +2 -0
  29. data/lib/pio/dhcp/boot_request_options.rb +2 -0
  30. data/lib/pio/dhcp/client_id.rb +2 -0
  31. data/lib/pio/dhcp/common_options.rb +2 -0
  32. data/lib/pio/dhcp/dhcp_field.rb +2 -0
  33. data/lib/pio/dhcp/dhcp_tlv_options.rb +30 -20
  34. data/lib/pio/dhcp/discover.rb +2 -0
  35. data/lib/pio/dhcp/field_util.rb +3 -1
  36. data/lib/pio/dhcp/frame.rb +2 -0
  37. data/lib/pio/dhcp/message.rb +2 -0
  38. data/lib/pio/dhcp/offer.rb +2 -0
  39. data/lib/pio/dhcp/optional_tlv.rb +3 -1
  40. data/lib/pio/dhcp/parameter_list.rb +2 -0
  41. data/lib/pio/dhcp/request.rb +2 -0
  42. data/lib/pio/ethernet_frame.rb +2 -0
  43. data/lib/pio/ethernet_header.rb +2 -0
  44. data/lib/pio/icmp.rb +2 -0
  45. data/lib/pio/icmp/format.rb +2 -0
  46. data/lib/pio/icmp/message.rb +2 -0
  47. data/lib/pio/icmp/reply.rb +2 -0
  48. data/lib/pio/icmp/request.rb +2 -0
  49. data/lib/pio/instance_inspector.rb +2 -0
  50. data/lib/pio/ipv4_address.rb +2 -0
  51. data/lib/pio/ipv4_header.rb +2 -0
  52. data/lib/pio/lldp.rb +2 -0
  53. data/lib/pio/lldp/chassis_id_tlv.rb +2 -0
  54. data/lib/pio/lldp/end_of_lldpdu_value.rb +2 -0
  55. data/lib/pio/lldp/frame.rb +2 -0
  56. data/lib/pio/lldp/management_address_value.rb +2 -0
  57. data/lib/pio/lldp/optional_tlv.rb +2 -0
  58. data/lib/pio/lldp/options.rb +4 -2
  59. data/lib/pio/lldp/organizationally_specific_value.rb +2 -0
  60. data/lib/pio/lldp/port_description_value.rb +2 -0
  61. data/lib/pio/lldp/port_id_tlv.rb +2 -0
  62. data/lib/pio/lldp/system_capabilities_value.rb +2 -0
  63. data/lib/pio/lldp/system_description_value.rb +2 -0
  64. data/lib/pio/lldp/system_name_value.rb +2 -0
  65. data/lib/pio/lldp/ttl_tlv.rb +2 -0
  66. data/lib/pio/mac.rb +2 -0
  67. data/lib/pio/message.rb +2 -0
  68. data/lib/pio/message_type_selector.rb +2 -0
  69. data/lib/pio/monkey_patch/bindata_record.rb +2 -0
  70. data/lib/pio/monkey_patch/bindata_string.rb +2 -0
  71. data/lib/pio/monkey_patch/integer.rb +2 -0
  72. data/lib/pio/monkey_patch/integer/base_conversions.rb +2 -0
  73. data/lib/pio/monkey_patch/integer/ranges.rb +2 -0
  74. data/lib/pio/monkey_patch/uint.rb +2 -0
  75. data/lib/pio/monkey_patch/uint/base_conversions.rb +2 -0
  76. data/lib/pio/open_flow.rb +2 -0
  77. data/lib/pio/open_flow/action.rb +2 -0
  78. data/lib/pio/open_flow/buffer_id.rb +2 -0
  79. data/lib/pio/open_flow/datapath_id.rb +2 -0
  80. data/lib/pio/open_flow/error_message.rb +2 -0
  81. data/lib/pio/open_flow/flags.rb +2 -0
  82. data/lib/pio/open_flow/flow_match.rb +2 -0
  83. data/lib/pio/open_flow/header.rb +2 -0
  84. data/lib/pio/open_flow/hello_failed_code.rb +2 -0
  85. data/lib/pio/open_flow/instruction.rb +2 -0
  86. data/lib/pio/open_flow/message.rb +2 -0
  87. data/lib/pio/open_flow/nicira_action.rb +2 -0
  88. data/lib/pio/open_flow/nicira_resubmit.rb +2 -0
  89. data/lib/pio/open_flow/nicira_resubmit_table.rb +2 -0
  90. data/lib/pio/open_flow/parser.rb +2 -0
  91. data/lib/pio/open_flow/port.rb +2 -0
  92. data/lib/pio/open_flow/transaction_id.rb +2 -0
  93. data/lib/pio/open_flow/version.rb +2 -0
  94. data/lib/pio/open_flow10.rb +2 -0
  95. data/lib/pio/open_flow10/actions.rb +2 -0
  96. data/lib/pio/open_flow10/aggregate_stats/reply.rb +2 -0
  97. data/lib/pio/open_flow10/aggregate_stats/request.rb +2 -0
  98. data/lib/pio/open_flow10/barrier/reply.rb +2 -0
  99. data/lib/pio/open_flow10/barrier/request.rb +2 -0
  100. data/lib/pio/open_flow10/description_stats/reply.rb +2 -0
  101. data/lib/pio/open_flow10/description_stats/request.rb +2 -0
  102. data/lib/pio/open_flow10/echo/reply.rb +2 -0
  103. data/lib/pio/open_flow10/echo/request.rb +2 -0
  104. data/lib/pio/open_flow10/enqueue.rb +2 -0
  105. data/lib/pio/open_flow10/error.rb +2 -0
  106. data/lib/pio/open_flow10/error/bad_request.rb +2 -0
  107. data/lib/pio/open_flow10/error/bad_request/bad_request_code.rb +2 -0
  108. data/lib/pio/open_flow10/error/error_type10.rb +2 -0
  109. data/lib/pio/open_flow10/error/hello_failed.rb +2 -0
  110. data/lib/pio/open_flow10/exact_match.rb +2 -0
  111. data/lib/pio/open_flow10/features.rb +2 -0
  112. data/lib/pio/open_flow10/features/reply.rb +22 -20
  113. data/lib/pio/open_flow10/features/request.rb +2 -0
  114. data/lib/pio/open_flow10/flow_mod.rb +5 -3
  115. data/lib/pio/open_flow10/flow_mod/command.rb +2 -0
  116. data/lib/pio/open_flow10/flow_removed.rb +2 -0
  117. data/lib/pio/open_flow10/flow_removed/reason.rb +2 -0
  118. data/lib/pio/open_flow10/flow_stats/reply.rb +2 -0
  119. data/lib/pio/open_flow10/flow_stats/request.rb +2 -0
  120. data/lib/pio/open_flow10/hello.rb +2 -0
  121. data/lib/pio/open_flow10/match.rb +4 -2
  122. data/lib/pio/open_flow10/match10.rb +2 -0
  123. data/lib/pio/open_flow10/packet_in.rb +2 -0
  124. data/lib/pio/open_flow10/packet_in/reason.rb +2 -0
  125. data/lib/pio/open_flow10/packet_out.rb +2 -0
  126. data/lib/pio/open_flow10/phy_port16.rb +21 -19
  127. data/lib/pio/open_flow10/port16.rb +2 -0
  128. data/lib/pio/open_flow10/port_stats/request.rb +2 -0
  129. data/lib/pio/open_flow10/port_status.rb +2 -0
  130. data/lib/pio/open_flow10/port_status/reason.rb +2 -0
  131. data/lib/pio/open_flow10/queue_stats/request.rb +2 -0
  132. data/lib/pio/open_flow10/send_out_port.rb +2 -0
  133. data/lib/pio/open_flow10/set_destination_ip_address.rb +2 -0
  134. data/lib/pio/open_flow10/set_destination_mac_address.rb +2 -0
  135. data/lib/pio/open_flow10/set_source_ip_address.rb +2 -0
  136. data/lib/pio/open_flow10/set_source_mac_address.rb +2 -0
  137. data/lib/pio/open_flow10/set_tos.rb +2 -0
  138. data/lib/pio/open_flow10/set_transport_port.rb +2 -0
  139. data/lib/pio/open_flow10/set_vlan_priority.rb +2 -0
  140. data/lib/pio/open_flow10/set_vlan_vid.rb +2 -0
  141. data/lib/pio/open_flow10/stats_reply.rb +2 -0
  142. data/lib/pio/open_flow10/stats_request.rb +2 -0
  143. data/lib/pio/open_flow10/stats_type.rb +2 -0
  144. data/lib/pio/open_flow10/strip_vlan_header.rb +2 -0
  145. data/lib/pio/open_flow10/table_stats/request.rb +2 -0
  146. data/lib/pio/open_flow10/vendor_action.rb +2 -0
  147. data/lib/pio/open_flow13.rb +2 -0
  148. data/lib/pio/open_flow13/actions.rb +2 -0
  149. data/lib/pio/open_flow13/apply.rb +2 -0
  150. data/lib/pio/open_flow13/copy_ttl_inwards.rb +2 -0
  151. data/lib/pio/open_flow13/copy_ttl_outwards.rb +2 -0
  152. data/lib/pio/open_flow13/decrement_ip_ttl.rb +2 -0
  153. data/lib/pio/open_flow13/echo/reply.rb +2 -0
  154. data/lib/pio/open_flow13/echo/request.rb +2 -0
  155. data/lib/pio/open_flow13/error.rb +2 -0
  156. data/lib/pio/open_flow13/error/bad_request.rb +2 -0
  157. data/lib/pio/open_flow13/error/error_type13.rb +2 -0
  158. data/lib/pio/open_flow13/error/hello_failed.rb +2 -0
  159. data/lib/pio/open_flow13/features/reply.rb +11 -9
  160. data/lib/pio/open_flow13/features/request.rb +2 -0
  161. data/lib/pio/open_flow13/flow_mod.rb +7 -5
  162. data/lib/pio/open_flow13/goto_table.rb +2 -0
  163. data/lib/pio/open_flow13/hello.rb +2 -0
  164. data/lib/pio/open_flow13/match.rb +17 -15
  165. data/lib/pio/open_flow13/meter.rb +2 -0
  166. data/lib/pio/open_flow13/nicira_conjunction.rb +2 -0
  167. data/lib/pio/open_flow13/nicira_reg_load.rb +2 -0
  168. data/lib/pio/open_flow13/nicira_reg_move.rb +5 -3
  169. data/lib/pio/open_flow13/nicira_send_out_port.rb +2 -0
  170. data/lib/pio/open_flow13/nicira_stack_pop.rb +2 -0
  171. data/lib/pio/open_flow13/nicira_stack_push.rb +2 -0
  172. data/lib/pio/open_flow13/packet_in.rb +2 -0
  173. data/lib/pio/open_flow13/packet_out.rb +2 -0
  174. data/lib/pio/open_flow13/port32.rb +2 -0
  175. data/lib/pio/open_flow13/send_out_port.rb +2 -0
  176. data/lib/pio/open_flow13/set_arp_operation.rb +2 -0
  177. data/lib/pio/open_flow13/set_arp_sender_hardware_address.rb +2 -0
  178. data/lib/pio/open_flow13/set_arp_sender_protocol_address.rb +2 -0
  179. data/lib/pio/open_flow13/set_destination_mac_address.rb +2 -0
  180. data/lib/pio/open_flow13/set_ip_ttl.rb +2 -0
  181. data/lib/pio/open_flow13/set_metadata.rb +2 -0
  182. data/lib/pio/open_flow13/set_source_mac_address.rb +2 -0
  183. data/lib/pio/open_flow13/stats_request.rb +9 -7
  184. data/lib/pio/open_flow13/write_metadata.rb +2 -0
  185. data/lib/pio/options.rb +2 -0
  186. data/lib/pio/parse_error.rb +2 -0
  187. data/lib/pio/parser.rb +2 -0
  188. data/lib/pio/payload.rb +2 -0
  189. data/lib/pio/pcap.rb +2 -0
  190. data/lib/pio/ruby_dumper.rb +2 -0
  191. data/lib/pio/type/ether_type.rb +2 -0
  192. data/lib/pio/type/ip_address.rb +2 -0
  193. data/lib/pio/type/ipv6_address.rb +2 -0
  194. data/lib/pio/type/mac_address.rb +2 -0
  195. data/lib/pio/udp.rb +2 -0
  196. data/lib/pio/udp_header.rb +2 -0
  197. data/lib/pio/version.rb +3 -1
  198. data/pio.gemspec +7 -5
  199. data/spec/pio/arp/reply_spec.rb +2 -0
  200. data/spec/pio/arp/request_spec.rb +2 -0
  201. data/spec/pio/arp_spec.rb +2 -0
  202. data/spec/pio/dhcp/ack_spec.rb +2 -0
  203. data/spec/pio/dhcp/discover_spec.rb +2 -0
  204. data/spec/pio/dhcp/offer_spec.rb +2 -0
  205. data/spec/pio/dhcp/request_spec.rb +2 -0
  206. data/spec/pio/dhcp_spec.rb +2 -0
  207. data/spec/pio/icmp/reply_spec.rb +2 -0
  208. data/spec/pio/icmp/request_spec.rb +2 -0
  209. data/spec/pio/icmp_spec.rb +2 -0
  210. data/spec/pio/ipv4_address_spec.rb +2 -0
  211. data/spec/pio/lldp/options_spec.rb +2 -0
  212. data/spec/pio/mac_spec.rb +2 -0
  213. data/spec/pio/monkey_patch/integer_spec.rb +2 -0
  214. data/spec/pio/open_flow/nicira_resubmit_spec.rb +2 -0
  215. data/spec/pio/open_flow/nicira_resubmit_table_spec.rb +2 -0
  216. data/spec/pio/open_flow10/echo/reply_spec.rb +2 -0
  217. data/spec/pio/open_flow10/echo/request_spec.rb +2 -0
  218. data/spec/pio/open_flow10/enqueue_spec.rb +2 -0
  219. data/spec/pio/open_flow10/error/hello_failed_spec.rb +2 -0
  220. data/spec/pio/open_flow10/features/reply_spec.rb +2 -0
  221. data/spec/pio/open_flow10/features/request_spec.rb +2 -0
  222. data/spec/pio/open_flow10/flow_mod_spec.rb +29 -27
  223. data/spec/pio/open_flow10/flow_stats_reply_spec.rb +2 -0
  224. data/spec/pio/open_flow10/flow_stats_request_spec.rb +7 -5
  225. data/spec/pio/open_flow10/hello_spec.rb +2 -0
  226. data/spec/pio/open_flow10/match_spec.rb +68 -66
  227. data/spec/pio/open_flow10/packet_in_spec.rb +2 -0
  228. data/spec/pio/open_flow10/packet_out_spec.rb +2 -0
  229. data/spec/pio/open_flow10/phy_port16_spec.rb +4 -2
  230. data/spec/pio/open_flow10/send_out_port_spec.rb +2 -0
  231. data/spec/pio/open_flow10/set_destination_ip_address_spec.rb +2 -0
  232. data/spec/pio/open_flow10/set_destination_mac_address_spec.rb +2 -0
  233. data/spec/pio/open_flow10/set_source_ip_address_spec.rb +2 -0
  234. data/spec/pio/open_flow10/set_source_mac_address_spec.rb +2 -0
  235. data/spec/pio/open_flow10/set_tos_spec.rb +2 -0
  236. data/spec/pio/open_flow10/set_transport_destination_port_spec.rb +2 -0
  237. data/spec/pio/open_flow10/set_transport_source_port_spec.rb +2 -0
  238. data/spec/pio/open_flow10/set_vlan_priority_spec.rb +2 -0
  239. data/spec/pio/open_flow10/set_vlan_vid_spec.rb +2 -0
  240. data/spec/pio/open_flow10/strip_vlan_header_spec.rb +2 -0
  241. data/spec/pio/open_flow10/wildcards_spec.rb +2 -0
  242. data/spec/pio/open_flow13/echo_reply_spec.rb +2 -0
  243. data/spec/pio/open_flow13/echo_request_spec.rb +2 -0
  244. data/spec/pio/open_flow13/error/bad_request_spec.rb +2 -0
  245. data/spec/pio/open_flow13/error/hello_failed_spec.rb +2 -0
  246. data/spec/pio/open_flow13/features/reply_spec.rb +2 -0
  247. data/spec/pio/open_flow13/features/request_spec.rb +2 -0
  248. data/spec/pio/open_flow13/goto_table_spec.rb +2 -0
  249. data/spec/pio/open_flow13/hello_spec.rb +3 -1
  250. data/spec/pio/open_flow13/match_spec.rb +2 -0
  251. data/spec/pio/open_flow13/meter_spec.rb +2 -0
  252. data/spec/pio/open_flow13/nicira_reg_load_spec.rb +2 -0
  253. data/spec/pio/open_flow13/nicira_reg_move_spec.rb +2 -0
  254. data/spec/pio/open_flow13/nicira_send_out_port_spec.rb +2 -0
  255. data/spec/pio/open_flow13/packet_in_spec.rb +2 -0
  256. data/spec/pio/open_flow13/packet_out_spec.rb +2 -0
  257. data/spec/pio/open_flow13/write_metadata_spec.rb +2 -0
  258. data/spec/pio/open_flow_spec.rb +2 -0
  259. data/spec/spec_helper.rb +1 -12
  260. data/spec/support/shared_examples_for_openflow_messages.rb +2 -0
  261. metadata +134 -135
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::Arp::Reply, '.new' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::Arp::Request, '.new' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::Arp do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::DHCP::Ack do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::DHCP::Discover do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::DHCP::Offer do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::Dhcp::Request do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::DHCP do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::Icmp::Reply, '.new' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::Icmp do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::Icmp, '.read' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/ipv4_address'
2
4
 
3
5
  describe Pio::IPv4Address do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio'
2
4
 
3
5
  describe Pio::Lldp::Options, '.new' do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/mac'
2
4
 
3
5
  describe Pio::Mac do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/monkey_patch/integer'
2
4
 
3
5
  describe MonkeyPatch::Integer::BaseConversions do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow/nicira_resubmit'
2
4
 
3
5
  describe Pio::OpenFlow::NiciraResubmit do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow/nicira_resubmit_table'
2
4
 
3
5
  describe Pio::OpenFlow::NiciraResubmitTable do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/echo/reply'
2
4
 
3
5
  describe Pio::OpenFlow10::Echo::Reply do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/echo/request'
2
4
 
3
5
  describe Pio::OpenFlow10::Echo::Request do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/enqueue'
2
4
 
3
5
  describe Pio::OpenFlow10::Enqueue do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/error/hello_failed'
2
4
 
3
5
  describe Pio::OpenFlow10::Error::HelloFailed do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/features/reply'
2
4
 
3
5
  describe Pio::OpenFlow10::Features::Reply do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/features/request.rb'
2
4
 
3
5
  describe Pio::OpenFlow10::Features::Request do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/flow_mod'
2
4
 
3
5
  describe Pio::OpenFlow10::FlowMod do
@@ -37,18 +39,18 @@ describe Pio::OpenFlow10::FlowMod do
37
39
  Then { flow_mod.xid == 0x15 }
38
40
 
39
41
  Then do
40
- flow_mod.match.wildcards.keys == [
41
- :vlan_vid,
42
- :source_mac_address,
43
- :destination_mac_address,
44
- :ether_type,
45
- :ip_protocol,
46
- :transport_source_port,
47
- :transport_destination_port,
48
- :source_ip_address_all,
49
- :destination_ip_address_all,
50
- :vlan_priority,
51
- :tos
42
+ flow_mod.match.wildcards.keys == %i[
43
+ vlan_vid
44
+ source_mac_address
45
+ destination_mac_address
46
+ ether_type
47
+ ip_protocol
48
+ transport_source_port
49
+ transport_destination_port
50
+ source_ip_address_all
51
+ destination_ip_address_all
52
+ vlan_priority
53
+ tos
52
54
  ]
53
55
  end
54
56
  Then { flow_mod.match.in_port == 1 }
@@ -70,7 +72,7 @@ describe Pio::OpenFlow10::FlowMod do
70
72
  Then { flow_mod.priority == 0xffff }
71
73
  Then { flow_mod.buffer_id == 0xffffffff }
72
74
  Then { flow_mod.out_port == 2 }
73
- Then { flow_mod.flags == [:send_flow_rem, :check_overwrap] }
75
+ Then { flow_mod.flags == %i[send_flow_rem check_overwrap] }
74
76
  Then { flow_mod.actions.length == 1 }
75
77
  Then { flow_mod.actions[0].is_a? Pio::OpenFlow10::SendOutPort }
76
78
  Then { flow_mod.actions[0].port == 2 }
@@ -89,7 +91,7 @@ describe Pio::OpenFlow10::FlowMod do
89
91
  command: :add,
90
92
  priority: 0xffff,
91
93
  out_port: 2,
92
- flags: [:send_flow_rem, :check_overwrap],
94
+ flags: %i[send_flow_rem check_overwrap],
93
95
  actions: Pio::OpenFlow10::SendOutPort.new(2)
94
96
  )
95
97
  end
@@ -102,18 +104,18 @@ describe Pio::OpenFlow10::FlowMod do
102
104
  Then { flow_mod.xid == 0x15 }
103
105
 
104
106
  Then do
105
- flow_mod.match.wildcards.keys == [
106
- :vlan_vid,
107
- :source_mac_address,
108
- :destination_mac_address,
109
- :ether_type,
110
- :ip_protocol,
111
- :transport_source_port,
112
- :transport_destination_port,
113
- :source_ip_address_all,
114
- :destination_ip_address_all,
115
- :vlan_priority,
116
- :tos
107
+ flow_mod.match.wildcards.keys == %i[
108
+ vlan_vid
109
+ source_mac_address
110
+ destination_mac_address
111
+ ether_type
112
+ ip_protocol
113
+ transport_source_port
114
+ transport_destination_port
115
+ source_ip_address_all
116
+ destination_ip_address_all
117
+ vlan_priority
118
+ tos
117
119
  ]
118
120
  end
119
121
  Then { flow_mod.match.in_port == 1 }
@@ -135,7 +137,7 @@ describe Pio::OpenFlow10::FlowMod do
135
137
  Then { flow_mod.priority == 0xffff }
136
138
  Then { flow_mod.buffer_id == 0xffffffff }
137
139
  Then { flow_mod.out_port == 2 }
138
- Then { flow_mod.flags == [:send_flow_rem, :check_overwrap] }
140
+ Then { flow_mod.flags == %i[send_flow_rem check_overwrap] }
139
141
  Then { flow_mod.actions.length == 1 }
140
142
  Then { flow_mod.actions[0].is_a? Pio::OpenFlow10::SendOutPort }
141
143
  Then { flow_mod.actions[0].port == 2 }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/flow_stats/reply'
2
4
 
3
5
  describe Pio::OpenFlow10::FlowStats::Reply do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/flow_stats/request'
2
4
 
3
5
  describe Pio::OpenFlow10::FlowStats::Request do
@@ -25,11 +27,11 @@ describe Pio::OpenFlow10::FlowStats::Request do
25
27
  Then { flow_stats_request.stats_type == :flow }
26
28
  Then do
27
29
  flow_stats_request.match.wildcards.keys.sort ==
28
- [:destination_mac_address, :source_mac_address,
29
- :ether_type, :in_port, :destination_ip_address_all,
30
- :ip_protocol, :source_ip_address_all, :tos,
31
- :transport_destination_port, :transport_source_port,
32
- :vlan_priority, :vlan_vid].sort
30
+ %i[destination_mac_address source_mac_address
31
+ ether_type in_port destination_ip_address_all
32
+ ip_protocol source_ip_address_all tos
33
+ transport_destination_port transport_source_port
34
+ vlan_priority vlan_vid].sort
33
35
  end
34
36
  Then { flow_stats_request.table_id == 0xff }
35
37
  Then { flow_stats_request.out_port == :none }
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/hello'
2
4
 
3
5
  describe Pio::OpenFlow10::Hello do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'pio/open_flow10/match'
2
4
 
3
5
  describe Pio::OpenFlow10::Match do
@@ -26,18 +28,18 @@ describe Pio::OpenFlow10::Match do
26
28
  end
27
29
 
28
30
  Then do
29
- match.wildcards.keys == [
30
- :vlan_vid,
31
- :source_mac_address,
32
- :destination_mac_address,
33
- :ether_type,
34
- :ip_protocol,
35
- :transport_source_port,
36
- :transport_destination_port,
37
- :source_ip_address_all,
38
- :destination_ip_address_all,
39
- :vlan_priority,
40
- :tos
31
+ match.wildcards.keys == %i[
32
+ vlan_vid
33
+ source_mac_address
34
+ destination_mac_address
35
+ ether_type
36
+ ip_protocol
37
+ transport_source_port
38
+ transport_destination_port
39
+ source_ip_address_all
40
+ destination_ip_address_all
41
+ vlan_priority
42
+ tos
41
43
  ]
42
44
  end
43
45
  Then { match.in_port == 1 }
@@ -56,25 +58,25 @@ describe Pio::OpenFlow10::Match do
56
58
 
57
59
  context 'with a Match binary generated with Pio::OpenFlow10::Match.new' do
58
60
  Given(:binary) do
59
- Pio::OpenFlow10::Match
60
- .new(source_ip_address: '192.168.1.0/24')
61
- .to_binary_s
61
+ Pio::OpenFlow10::Match.
62
+ new(source_ip_address: '192.168.1.0/24').
63
+ to_binary_s
62
64
  end
63
65
 
64
66
  Then do
65
- match.wildcards.keys == [
66
- :in_port,
67
- :vlan_vid,
68
- :source_mac_address,
69
- :destination_mac_address,
70
- :ether_type,
71
- :ip_protocol,
72
- :transport_source_port,
73
- :transport_destination_port,
74
- :source_ip_address,
75
- :destination_ip_address_all,
76
- :vlan_priority,
77
- :tos
67
+ match.wildcards.keys == %i[
68
+ in_port
69
+ vlan_vid
70
+ source_mac_address
71
+ destination_mac_address
72
+ ether_type
73
+ ip_protocol
74
+ transport_source_port
75
+ transport_destination_port
76
+ source_ip_address
77
+ destination_ip_address_all
78
+ vlan_priority
79
+ tos
78
80
  ]
79
81
  end
80
82
  And { match.wildcards[:source_ip_address] = 12 }
@@ -100,18 +102,18 @@ describe Pio::OpenFlow10::Match do
100
102
  context 'with in_port: 1' do
101
103
  Given(:options) { { in_port: 1 } }
102
104
  Then do
103
- match.wildcards.keys == [
104
- :vlan_vid,
105
- :source_mac_address,
106
- :destination_mac_address,
107
- :ether_type,
108
- :ip_protocol,
109
- :transport_source_port,
110
- :transport_destination_port,
111
- :source_ip_address_all,
112
- :destination_ip_address_all,
113
- :vlan_priority,
114
- :tos
105
+ match.wildcards.keys == %i[
106
+ vlan_vid
107
+ source_mac_address
108
+ destination_mac_address
109
+ ether_type
110
+ ip_protocol
111
+ transport_source_port
112
+ transport_destination_port
113
+ source_ip_address_all
114
+ destination_ip_address_all
115
+ vlan_priority
116
+ tos
115
117
  ]
116
118
  end
117
119
  Then { match.in_port == 1 }
@@ -140,19 +142,19 @@ describe Pio::OpenFlow10::Match do
140
142
  context "with source_ip_address: '192.168.1.0/24'" do
141
143
  Given(:options) { { source_ip_address: '192.168.1.0/24' } }
142
144
  Then do
143
- match.wildcards.keys == [
144
- :in_port,
145
- :vlan_vid,
146
- :source_mac_address,
147
- :destination_mac_address,
148
- :ether_type,
149
- :ip_protocol,
150
- :transport_source_port,
151
- :transport_destination_port,
152
- :source_ip_address,
153
- :destination_ip_address_all,
154
- :vlan_priority,
155
- :tos
145
+ match.wildcards.keys == %i[
146
+ in_port
147
+ vlan_vid
148
+ source_mac_address
149
+ destination_mac_address
150
+ ether_type
151
+ ip_protocol
152
+ transport_source_port
153
+ transport_destination_port
154
+ source_ip_address
155
+ destination_ip_address_all
156
+ vlan_priority
157
+ tos
156
158
  ]
157
159
  end
158
160
  Then { match.wildcards.fetch(:source_ip_address) == 8 }
@@ -173,19 +175,19 @@ describe Pio::OpenFlow10::Match do
173
175
  context "with destination_ip_address: '192.168.1.0/24'" do
174
176
  Given(:options) { { destination_ip_address: '192.168.1.0/24' } }
175
177
  Then do
176
- match.wildcards.keys == [
177
- :in_port,
178
- :vlan_vid,
179
- :source_mac_address,
180
- :destination_mac_address,
181
- :ether_type,
182
- :ip_protocol,
183
- :transport_source_port,
184
- :transport_destination_port,
185
- :source_ip_address_all,
186
- :destination_ip_address,
187
- :vlan_priority,
188
- :tos
178
+ match.wildcards.keys == %i[
179
+ in_port
180
+ vlan_vid
181
+ source_mac_address
182
+ destination_mac_address
183
+ ether_type
184
+ ip_protocol
185
+ transport_source_port
186
+ transport_destination_port
187
+ source_ip_address_all
188
+ destination_ip_address
189
+ vlan_priority
190
+ tos
189
191
  ]
190
192
  end
191
193
  Then { match.wildcards.fetch(:destination_ip_address) == 8 }