The patch teaches packet library to truncate padding octets.
Change packet_base.parser() to return (header, next_type, rest_of_packet)
The protocol class that knows its payload length should rest_of_packet
where padding octets at the last of packet is truncated.
As bonus,
- fix ipv6 parser as ipv6 header doesn't have options.
It seems copy-and-paste from ipv4
- improve ipv4, tcp a bit
Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Cc: Shaun Crampton <Shaun.Crampton@metaswitch.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Since it is debugging tool for developer, don't install it.
and move it under ryu/rests directory.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tuples are json-unfriendly.
(of1.3 version was completely broken until very recently
and the way i fixed it is consistent with this change.)
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
instead of explicit listing of of-wire attributes, use a heuristics
to exclude internal attributes. (eg. buf, datapath, etc)
this commit changes __str__ outputs. update a test case accordingly.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
this provides gevent-like api using eventlet.
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
icmpv6_csum() uses wrong format. It happened to produce correct value
for csum.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- add test code of max and min to OFPErrorExperimenterMsg
Signed-off-by: KONDOH Tasuku <kondoh.tasuku@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tuning grace sec of tests for OFPT_FLOW_REMOVED.
Sometimes, we will received the OFPT_FLOW_REMOVED message before
rewirte the duration time of the ofp_flow_removed by the switch.
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
rpmlint requires it as follows.
> ryu.noarch: E: non-executable-script /usr/lib/python2.7/site-packages/ryu/tests/run_tests.py 0644L /usr/bin/env
> ryu.noarch: E: non-executable-script /usr/lib/python2.7/site-packages/ryu/tests/test_lib.py 0644L /usr/bin/env
> This text file contains a shebang or is located in a path dedicated for
> executables, but lacks the executable bits and cannot thus be executed. If
> the file is meant to be an executable script, add the executable bits,
> otherwise remove the shebang or move the file elsewhere.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- remove get_supported() at test_request_reply_v12.py.
use 'is_supported()' if any test wants to skip.
- print results summary.
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
See "ryu/tests/unit/packet/test_lldp.py" to use this library.
This patch is based on Yamahata's topology discovery patch series.
http://thread.gmane.org/gmane.network.ryu.devel/467
Signed-off-by: YAMADA Hideki <yamada.hideki@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This patch adds a test framework using mininet. The following tests
can be performed.
- Set the flow for the OVS-switch from Ryu-app, we test the actual
packet is to be handled properly in accordance with the flow; The
packet that generated by "mz" or replayed by "tcpreplay" is routed
through the ovs-switch, are processed according to the flow, then
compare test conditions and the results captured by "tshark".
- Create a packet with ryu using the packet-lib, we test the packet
and response are correct; to compare test conditions and the results
captured by "tshark".
$ ./run_mnet-test.sh [OPTION] [TEST DIR or FILE]...
$ ./run_mnet-test.sh l2 l3/icmp packet_lib/arp/ARP_gratuitous.mn
$ ./run_mnet-test.sh --help
Requirements package:
- mininet: git://github.com/mininet/mininet.git
- openvswitch: git://openvswitch.org/openvswitch
- Mausezahn 0.40: http://www.perihel.at/sec/mz/
- TShark 1.6.2: http://www.wireshark.org/
- tcpreplay 3.4: http://tcpreplay.synfin.net/
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Change the branch of openvswitch used by integration tests to 'of12'
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- The OFPVID_PRESENT bit indicate the presence of a valid VLAN_ID.
- Reflect to unittests.
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- use bytearray(n) instead of str().zfill(n)
- test data are more strictly.
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- zfill() is a func of the string to be putting in a '0'.
bytearray().zfill(n) -> bytearray(n)
- unify notation of zero with other code.
'\0' -> '\x00'
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
- some tests need attached port to switch.
Signed-off-by: HIYAMA Manabu <hiyama.manabu@po.ntts.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Run this in the following way:
$ ryu-manager ryu/ryu/tests/integrated/test_request_reply_v12.py
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>