fix failure of instantiating app

For example, app-A has app-X in CONTEXTS, and app-B depends on app-X as
SERVICE.  When app-B is specified in the app-lists before app-A, the
instantiating app-X fails by an assertion.

$ PYTHONPATH=. bin/ryu-manager ryu.app.quantum_adapter ryu.app.gre_tunnel
loading app ryu.app.quantum_adapter
loading app ryu.app.gre_tunnel
loading app ryu.controller.dpset
loading app ryu.controller.ofp_handler
loading app ryu.controller.ofp_handler
loading app ryu.controller.ofp_handler
instantiating app None of QuantumIfaces
creating context quantum_ifaces
instantiating app None of ConfSwitchSet
creating context conf_switch
instantiating app None of Network
creating context network
instantiating app None of Tunnels
creating context tunnels
instantiating app None of DPSet
creating context dpset
instantiating app ryu.app.gre_tunnel of GRETunnel
instantiating app ryu.controller.dpset of DPSet
Traceback (most recent call last):
  File "/opt/stack/ryu/bin/ryu-manager", line 19, in <module>
    main()
  File "/opt/stack/ryu/ryu/cmd/manager.py", line 77, in main
    services.extend(app_mgr.instantiate_apps(**contexts))
  File "/opt/stack/ryu/ryu/base/app_manager.py", line 434, in instantiate_apps
    self._instantiate(app_name, cls, *args, **kwargs)
  File "/opt/stack/ryu/ryu/base/app_manager.py", line 421, in _instantiate
    register_app(app)
  File "/opt/stack/ryu/ryu/base/app_manager.py", line 50, in register_app
    assert app.name not in SERVICE_BRICKS
AssertionError

This patch avoid the double loading of app in context and service.

Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
sw test tool: Add support for OpenFlow 1.4

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Enable using connected switches to parse

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Enable getting switches from outside of OfTester

This patch is for using connected switches to parse.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Enable waiting for switches to connect before parsing

This patch is for using connected switches to parse.
The switch test tool starts to parse test files after switches connected.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Enable using connected switches to compare

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Modify conditions of ofp_packet_in_reason

The switch test tool reports reasons except user-expected reasons, i.e. OFPR_NO_MATCH and OFPR_INVALID_TTL.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Add mask length of ipv6_flabel

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Modify OFPMatch to normalize

This patch is for avoiding the following issues when using ofproto_v1_4_parser:

  - OFPMatch that is created from JSON keeps unicode strings, instead of usual strings.
  - In OFPMatch that is created from JSON, IPv6 formats like 'ff::0' or '00ff:0000:0000:0000:0000:0000:0000:0000' are not normalized to 'ff::'.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
sw test tool: Modify OFPActionSetField to normalize

This patch is for avoiding the following issues when using ofproto_v1_4_parser:

  - OFPActionSetField that is created from JSON keeps unicode strings, instead of usual strings.
  - In OFPActionSetField that is created from JSON, IPv6 formats like 'ff::0' or '00ff:0000:0000:0000:0000:0000:0000:0000' are not normalized to 'ff::'.

Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>