{ "info": { "author": "R\u00e9my L\u00e9one", "author_email": "remy.leone@inria.fr", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: CPython" ], "description": "\n# 6TiSCH testing tool\n\n\n## Architecture overview\n\n\n +-----------------------+\n F-interop side | |\n | Users |\n | |\n +--------^-----+--------+\n | |\n | |\n | |\n +--------------------+ +-------------------+ +--------+-----v--------+\n | | | | | |\n | Tests | | Manager | | GUI |\n | (Background tasks) | | | | |\n | | +-----+----+--------+ +-----+---+-------------+\n +-------+---+--------+ | ^ ^ |\n ^ | | | | |\n | | | | | |\n | | +------v----+-------------------+---v-+\n | +------------> |\n | | Message broker |\n +----------------+ (RabbitMQ) |\n +--------------+-----^----------------+\n | |\n | |\n XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|XXXXX|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n | |\n | |\n | |\n +--v-----+--+\n User side | |\n | Agent |\n | Sniffer |\n | |\n +-----------+\n +--------------+ +--------------+ +--------------+\n | | | | | |\n | 6TiSCH node | | 6TiSCH node | | 6TiSCH node |\n +--------------+ +--------------+ +--------------+\n\n\n- Agent sniffer => In charge of sniffing\n- A message broker (RabbitMQ) which is in charge of passing messages between different components.\n- A tshark based dissector (AMQP for communication)\n- A manager which is in charge of driving the whole testing tool by receiving messages and launching the tests.\n- Tests => In charge of asserting whether or not the messages observed from the 6TiSCH nodes are compliant to the standard.\n\n## Installation\n\nYou need to have:\n\n- tshark that correctly support 6TiSCH and IEEE802.15.4e dissection (TODO: Insert git-hash of the correct revision)\n- All python libraries listed on the requirements.txt file\n\n## How to launch?\n\nRun the following command:\n\n supervisord -n --conf supervisord.conf.ini\n\nThis command will launch all the required components and will restart them if they crash.\n\n## In the F-interop context, where does this testing tool run?\n\nAt the moment, the testing is launched from iMinds server (http://orchestrator.f-interop.eu/).\n\n## How does test session isolation happen?\n\nIt is managed by the F-Interop orchestrator.\nWhen a session is provisioned by the orchestrator a virtual host is created on the broker and a virtual instance of the testing tool is spawn.\nTherefore two different sessions launched by the orchestrator don't interact with each others.\n\n## Configuration\n\n- The dissector will consult a routing key and an exchange name given as an environment variable.\n After started, the dissector will send a json containing the dissected packets information.\n\n## Architecture\n\n## Tests\n\nThis tool aims to have code reuse between:\n - **local execution** where the a developer is working locally\n - **remote execution** where the test is run on a remote machine.\n\nTests can be organized arbitrarily but the recommended way of organizing tests is the following\n\n### How does a test work?\n\nThe goal of a test is to expose failure inside an implementation.\nIf your test returns it means that everything went fine.\nIn any other case an exception will be raised (Most likely an AssertionError),\nand you will get all the context to debug it.\n\nYour goal as a test implementer is to put as many relevant assert\nas possible in your tests to test a maximum of assumptions that you\ngot about your network packets.\n\nWhat you want is having a step that is a series of assertion on a context.\n\n### What is the difference between online verdicts and local verdicts?\n\nIn local, you don't get an AMQP message. Basically, if pytest returns no errors were detected.\nIn online, you get at the end of all task a test that basically check that all steps went fine and\nsend an AMQP message.\n\n### Why do you require to have a tshark installed on the client side? Are the dissection happening client side?\n\nWe use tshark on the client side for two main reasons:\n\n- We want to use eBPF filter to be sure to gather only the relevant packet.\n You don't want to send us packets that are not related to the test. That's fine, we don't want them either.\n We provides good default (we sniff only the interface you want us to and only with the filter wpan).\n If you want to provides additional filter, for privacy issues or any other reason feel free to do so.\n\n- We want to have production-ready, cross-platform sniffing.\n Sniffing is a solved problem, the wireshark suite provides it for free.\n We prefer invest our time in developing tests and improving dissectors\n rather than work on a solved problem and reinventing the wheel.\n\nNo dissection is happening on client side. Ever. You want to be sure to have the latest dissector.\nF-Interop provides it for you.\n\n### How can I run all existing tests locally?\n\n python3 -m pytest -s tests\n\n### Which tests are supported?\n\n- We aim to reproduce interoperability results that happened during ETSI 6TiSCH plugfest in Prague between [Contiki](http://contiki-os.org) and [OpenWSN](http://openwsn.atlassian.net).\n\n### I want to test something new. How could I get started?\n\n- First be sure that all the field you are going to use in your test are supported by tshark.\n If they are not, add support in Wireshark to dissect this field.\n You can get started quickly by going through this [tutorial](https://www.wireshark.org/docs/wsdg_html_chunked/ChDissectAdd.html).\n\n- Second, be sure you have easy access to those fields by using well named filter.\n You can easily test that by loading your PCAP files into Wireshark and look for the display filter\n used for the relevant field.\n\n- Third you can get started by looking at the JSON output of tshark and start to assert property\n on the JSON document using your favorite language and tools.\n\n tshark -r my_capture.pcapng -T json\n\n\n### How is the context of a test is saved? How can I alter it?\n\nSimply modify the object.\nAll changes are kept between steps.\nWhen you are working in offline mode, context is an object that all steps refers to.\nIf you are working in online mode, context is saved at the end of each step and restore at the beginning of a new step.\nYou access packets by accessing attributes of the context no matter if it's an online or offline test.\n\n### How can I know in which state my test is?\n\nSimply consult the status property of the context object:\n\n context.status\n\n### How can I make a test block waiting for a given condition to be performed?\n\nYou can put for instance a while loop with a time.sleep() waiting for a condition to be filled.\n\n### What is the format of a report?\n\nIt's a JSON document.\nTODO: put here the report.\n\n### How can I produce a verdict result in online/offline mode?\n\nTODO\n\n### What is the format of an error? How can I tell if an error happen?\n\nTODO\n\n### What should I do if an error happen?\n\nIn case where you are in offline mode, you can simply fix code and try again.\nIn case you are in online mode, the task will finish and a new one matching the step you are at will be started.\n\n### How can I replay a network trace locally?\n\nUse iterator:\n\n\tfor packet in context.dissected_packets:\n if validator.validate(packet):\n normalize_my_packet(packet)\n assert my_property(packet) == my_expected_value\n\nThe context variable is assigned by pytest automatically.\n\n### How can I replay a network trace locally while mimicking arrival time from the PCAP?\n\nTODO\n\n### How does a JSON is modified through the test?\n\nWe suggest that you normalize the results of the dissection.\nThere is several improvements that come out of this:\n - JSON payload are smaller and easier to parse\n - Situation specific encapsulation can be removed at this step\n\n### How can I efficiently filter and extract relevant information from the JSON?\n\n[Cerberus](http://docs.python-cerberus.org/en/stable/) is a validation library that can help you validate whether a JSON is correct or not.\nThis library can also help you to normalize the JSON document you have.\n\nOnce you have a correct JSON document, you can create extractor functions that can fetch any properties inside your document.\n\n## How can I distinguish between a code that failed to pass a test and a code that made the testing tool crash?\n\nTODO\n\n### When should I send debug messages?\n\nWhen you have a failed assertion feel free to use as much debug as possible.\nBy default we send a report once an AssertionError is raised in a step.\nKnowing about the context helps you understand at which step you are in the test case.\nIt also helps you see how many packets are available.\n\n### How can I send a verdict?\n\n import hammerhead\n\n hammerhead.Verdict(context, {\"my_verdict\"})\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "agent_6tisch", "package_url": "https://pypi.org/project/agent_6tisch/", "platform": "", "project_url": "https://pypi.org/project/agent_6tisch/", "project_urls": null, "release_url": "https://pypi.org/project/agent_6tisch/0.0.8/", "requires_dist": null, "requires_python": "", "summary": "6TiSCH agent for F-Interop", "version": "0.0.8" }, "last_serial": 3156152, "releases": { "0.0.8": [ { "comment_text": "", "digests": { "md5": "af224e4ba6b439368bc996ec59683d33", "sha256": "9f3fd37b3c9a02bde94804c8e5ec88dbf38cd809c5fd170988575576e65c577a" }, "downloads": -1, "filename": "agent_6tisch-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "af224e4ba6b439368bc996ec59683d33", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 23244, "upload_time": "2017-09-07T12:04:57", "url": "https://files.pythonhosted.org/packages/35/2f/f7eab7701f1de7ce630266b3255f467614ecd90f463a07b552f193778841/agent_6tisch-0.0.8-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "af224e4ba6b439368bc996ec59683d33", "sha256": "9f3fd37b3c9a02bde94804c8e5ec88dbf38cd809c5fd170988575576e65c577a" }, "downloads": -1, "filename": "agent_6tisch-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "af224e4ba6b439368bc996ec59683d33", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 23244, "upload_time": "2017-09-07T12:04:57", "url": "https://files.pythonhosted.org/packages/35/2f/f7eab7701f1de7ce630266b3255f467614ecd90f463a07b552f193778841/agent_6tisch-0.0.8-py2.py3-none-any.whl" } ] }