History log of /external/autotest/client/deps/lansim/src/py/simulator.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e066db9345331ec3cd44ccec5f2c7ffb857cde3b 07-Nov-2013 Alex Deymo <deymo@chromium.org> Add new p2p_ServeFiles test.

This test checks that files announced from the p2p-server are served
from the p2p-http-server daemon. Note that localhost requests are
blocked.

In order to test this, a new method to wait for conditions on the
SimulatorThread is added to the lansim framework with its respective
unit test.

BUG=chromium:311657
TEST=lansim unittests and test_that p2p_ServeFiles
CQ-DEPEND=CL:176161

Change-Id: I7ff53d494240500a0a5c1ea4bbbfd73a2cc7193e
Reviewed-on: https://chromium-review.googlesource.com/176147
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
/external/autotest/client/deps/lansim/src/py/simulator.py
2c5c348c740930e6effa3e25441e6ba0080b3221 31-Oct-2013 Alex Deymo <deymo@chromium.org> p2p_ConsumeFiles: Raise error excetions and fix test.

The test p2p_ConsumeFiles checks, among other things, that the
p2p-client client hangs when there are too many connections on the
network. This check was wrong and wasn't making the test fail because
the error.TestFail exception was being created but not raised.

This patch solves that problem and also fixes the test in a more
robust way. The fake p2p server running on the simulator can now
optionally update the network with the new shared file or number of
connections, as the real p2p-server does. This notifies p2p-clients
with a cached value of num_connections that a new value of
num_connections is available.

To achieve this, some locking between the test thread and the
simulator thread is added to allow the test thread call functions
that send packets but from the simulator thread.

BUG=None
TEST=lansim unittests, test_that p2p_ConsumeFiles and p2p_ShareFiles pass.

Change-Id: I89ebf5a33d55cb3ab0f06283f79c6c335d162368
Reviewed-on: https://chromium-review.googlesource.com/175169
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/external/autotest/client/deps/lansim/src/py/simulator.py
21ec28fa3bdf79bd4bfe48868a535d8184fd0c80 28-Oct-2013 Alex Deymo <deymo@chromium.org> p2p_ShareFiles: Reduce flakiness waiting for events instead of timeouts.

This patch adds a new "until" argument to the lansim Simulator class in
order to run the simulator *until* a condition is met. This allows the
p2p_ShareFiles to wait *until* the required condition is met, and set
a higher timeout for failure. This should reduce the flakiness of the
test and improve the running time.

BUG=None
TEST=New unittest passes. test_that p2p_ShareFiles still passes.

Change-Id: I086546bcada018c24f10bcffd51127260dbc4c30
Reviewed-on: https://chromium-review.googlesource.com/174906
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
/external/autotest/client/deps/lansim/src/py/simulator.py
81b39b7acfd5ff7dfc19c275abf724fc705696f6 04-Oct-2013 Alex Deymo <deymo@chromium.org> lansim: Add TCP streams forwarding.

This patch includes support to forward incoming TCP connections on
any simulated SimpleHost back to a real host IP address on the same
network. This lets the code under test make a connection to a fake
TCP server running on a virtual host be redirected to a real host
and use the kernel's network stack to handle it.

BUG=chromium:241519
TEST=Added new unittests to lansim.

Change-Id: Id0700ef4a9c78ac17e183c20e33f5dfe8550c4f9
Reviewed-on: https://chromium-review.googlesource.com/171817
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/external/autotest/client/deps/lansim/src/py/simulator.py
a421cf28e09aae7df5abb893629d46c1fee11f99 16-Oct-2013 Alex Deymo <deymo@chromium.org> p2p: Log SimulatorThread exceptions.

The p2p_ConsumeFiles test is failing on every board on every build on
the lab, but passes when ran with test_that on a DUT and on the lab.
This patch enables more debug on the test so it can log exceptions
generated on the SimulatorThread when run on the lab as part of the
BVT.

BUG=chromium:271847
TEST=test_that still works on my DUT.

Change-Id: Ib11c3a35d0ea4a4bc0db0fdff3729b1a3e366578
Reviewed-on: https://chromium-review.googlesource.com/173165
Tested-by: Alex Deymo <deymo@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
/external/autotest/client/deps/lansim/src/py/simulator.py
95fc719cd07fa8de9f9bcf8ccda7bd47bfe70e50 08-Oct-2013 Alex Deymo <deymo@chromium.org> lansim: Report SimulatorThread exceptions on the main thread.

This patch tracks the exceptions raised on the SimulatorThread and
makes them available on the main thread after join() via the error
method. This allows a test case to report errors raised during the
simulation.

BUG=chromium:271847
TEST=Unit test added.

Change-Id: I7a154205b738af24608fceb80c8ea2e29f2c8a0f
Reviewed-on: https://chromium-review.googlesource.com/172181
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/external/autotest/client/deps/lansim/src/py/simulator.py
af88241d227f977178b0c42a473bbfc3d863e735 11-Sep-2013 Alex Deymo <deymo@chromium.org> lansim: Add a LAN simulator in python to use in tests.

lansim is a LAN simulator that runs over a TAP network interface and
allows to simulate network traffic on that interface from Python code.

A TAP interface is a virtual network kernel device that acts as any
other network interface, except that instead of sending and receiving
the traffic through a hardware interface it allows a given program to
handle that traffic through a socket. It is essentially a
bi-directional pipe where one side is a network interface and the
other side is a socket on a program.

This simulator is useful on situations where you can't fake a network
service using the normal kernel network stack. For example, if you
need to fake a network of several hosts publishing services via mDNS
with multicast you can write those services using this simulator but
it's more complicated to do the same using the system's network stack
since an outbound multicast packet will be sent out on the real
interface.

The simulator consists on various Python modules with the logic
and a small C module that exposes many system dependent constants
to Python. The C module is required to expose the architecture
dependent constants.

BUG=chromium:288385
TEST=Ran "make install test" on lansim/src/ (runs unittests).

Change-Id: I5475e445046ce505503627f48ed4ab220a6cfef2
Reviewed-on: https://chromium-review.googlesource.com/168882
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/external/autotest/client/deps/lansim/src/py/simulator.py