stbt.Display.__init__: (save-video) Remove unnecessary argv[0] check

The only callers of `stbt.Display.__init__` are:

    stbt.Display.__init__
    ↳ stbt.init_run
      ↳ stbt-run: stbt.init_run(..., args.save_video)
      ↳ stbt-record: stbt.init_run(..., False)

`stbt-record` calls `init_run` with `save_video=False`, so it is
redundant to check that `argv[0] == "stbt-run"`.

Thanks to Bryce Gibson for pointing this out:
https://groups.google.com/d/msg/stb-tester/jEBSeS9-l2c/LXX7J2DAcpgJ
test_runner_sigint_*: Increase timeout for runner to start

On a heavily loaded system this timeout wasn't enough. Only seen on
the travis-ci service that runs our self-tests in the cloud.
runner: add tablequeryjs to reports to allow textual filtering

This commit adds tablequeryjs [1] to stb-tester runner reports. This is
useful because it allows Wireshark-like text-based filtering of the HTML
table, executing queries such as:

- `tag ILIKE slave-1 or tag ILIKE slave-2`
- `"exit status" ILIKE "^(1|2)$"`

Currently tablequeryjs depends on both jQuery and jQuery UI. Removing
the latter as a dependency is tracked in [2] and I hope to get around to
this soon. There are also numerous usability improvements, all tracked
in issues, that I'm hoping to implement soon as well.

[1] https://github.com/asimihsan/tablequeryjs

[2] https://github.com/asimihsan/tablequeryjs/issues/4
extra/runner summary report: Keyboard navigation skips hidden rows

The filter functionality added in 175a9f55 can hide table rows; pressing
the "up" and "down" arrow keys now skips hidden rows.
extra/runner summary report: Filter's placeholder text gives example

To give users an example of the syntax accepted by this filter, and so
that they know there is an "ilike" operator.
Merge branch 'runner-tablequeryjs'

* runner-tablequeryjs:
  extra/runner summary report: Filter's placeholder text gives example
  extra/runner summary report: Keyboard navigation skips hidden rows
  runner: add tablequeryjs to reports to allow textual filtering
Tests for irnetbox.py and `stbt run --control=irnetbox`

These aren't intended to test that the protocol is correct, because I
implemented both ends (`irnetbox.py` and `fake-irnetbox`). I know that
the protocol is correct because I've tested irnetbox.py with a real
irNetBox device. However these tests give us some confidence that the
"glue" code around the sending of signals is correct.

`tests/fake-irnetbox` listens on an available port (and prints
"PORT=xxxx" to standard output), and just acks every message it
receives.

`irnetbox.IRNetBox.__init__` and `stbt run --control=irnetbox:...` now
accept an optional `port` parameter, when using the fake-irnetbox's port
-- a real irNetBox always uses port 10001. Since this is only for use in
the unit tests, it isn't documented in `README.rst`.

Note that `tests/run-tests.sh` now sets `PYTHONUNBUFFERED=x` so that
`fake-irnetbox`'s output goes to `fake-irnetbox.log` immediately;
otherwise the output is fully buffered and the test
`test_irnetbox_commands` fails with "error: fake-irnetbox failed to
start". See
http://docs.python.org/2/using/cmdline.html#envvar-PYTHONUNBUFFERED
tests/run-tests.sh: Set PYTHONPATH for irnetbox tests

Commit 9a4d2086 added a test that does `import irnetbox` but
`irnetbox.py` isn't on the PYTHONPATH. (When `stbt-run` imports
`irnetbox` it always worked because the current file's directory is
searched before PYTHONPATH, and `stbt-run` is in the same directory as
`irnetbox.py`).
runner/templates/testrun.html: Wrap failure reason to multiple lines

`white-space: pre` CSS property prevents the browser from wrapping the
text to multiple lines if it is too long; as a result, in many cases part
of the failure reason gets out of screen, even when the browser is expanded
to full screen.
extra/runner/report.py: Include "report.py" in error messages

There is also a shell script called `report` (which calls `report.py`)
so this change clarifies where the error message is coming from.
extra/runner/report: Don't resolve symlinks when determining results directory

The directory structure of a "test results" directory (where you ran
`extra/runner/run` from) looks like this:

    results/
    results/2013-08-10_09.54.29/
    results/2013-08-10_09.56.06/
    results/index.html

However, a user can manually create such a structure using symlinks
instead, when they want to create a report (using `extra/runner/report`)
that contains results from several different "test results" directories:

    summary/
    summary/2013-08-10_09.54.29-run1 -> ../results1/2013-08-10_09.54.29
    summary/2013-08-10_09.56.06-run1 -> ../results1/2013-08-10_09.56.06
    etc.

In that case, running `report summary/2013*` would create the summary
report in `results1/index.html` instead of `summary/index.html`. This
commit fixes that; there is no need to resolve symlinks when determining
the "test results" directory.

This uses python's `abspath` (which doesn't resolve symlinks) instead of
python's `realpath`. Since we *do* need to resolve symlinks elsewhere in
the `report` script†, we need both functions. The `run` script only uses
python's `realpath`, but I've renamed `run`'s shell function to
`realpath` for consistency with the python function name and for
consistency with `report`.

† To find the directory containing the `report.py` script (which is the
same directory that contains this `report` shell script). Some people
symlink `report` into a directory on their PATH (such as `~/bin`)
instead of adding the directory containing `report` to their PATH.
extra/runner/run: Don't run more tests if v4l2 capture device not found

This happens, for example, when the cleaners bump the power button on my
Hauppauge HDPVR that's running tests overnight.

Checking for "/dev/v" will match "/dev/video0" as well as
"/dev/v4l/by-id/..." (I use the latter in my source pipeline if the PC
has multiple devices connected, because the "by-id" path doesn't change
across PC reboots).
stbt.Display.teardown: Avoid additional exception after NoVideo timeout

If the NoVideo timeout happens after `restart_source` stopped the source
pipeline but before `start_source` started it again (there's a 5 second
gap), then the "NoVideo" exception would be followed by a second
exception message:

      File "/usr/libexec/stbt/stbt.py", line 920, in teardown
        self.source_pipeline.set_state(gst.STATE_NULL)
    AttributeError: 'NoneType' object has no attribute 'set_state'
Add a standalone irnetproxy.py script for the RedRat irNetBox III

The irNetBox only allows one network connection at a time.  This means
the 16 ir ports it has cannot be easily controlled by multiple clients
simultaneously.

This script allows many clients to connect to the device, and use
the ports concurrently.  **Note**, this only makes sense for the
Asynchronous IO Output Commands, other commands will be run
synchronously as before.

http://www.redrat.co.uk/products/IRNetBox_Comms-V3.X.pdf

Usage
-----

```
$ irnetproxy -r <irNetBox address>
```

OR

```
$ irnetproxy --irnetbox-addresss <irNetBox address> \
             --irnetbox-port 10001\
             --listen-port 10001\
             --listen-address 127.0.0.1\
             -vv

> Listening for connections on 127.0.0.1:10001
```

Existing irNetBox network clients should then connect to the proxy
server, rather than the irNetBox.  Everything else should behave the
same.

Features
--------

 - Session multiplexing: irnetproxy dynamically maps Asyncronous
   Sequence IDs on the fly, meaning that multiple clients can use the
   same Sequence ID concurrently, and the irnet box will continue to
   work.  Both the command acknowledgement, and the subsequent Async
   complete message are always routed to the correct client.

 - On/Off management: irnetproxy will silently accept the on and off
   messages (5 and 6).  A standard ACK response is returned to the
   client, but the command is never sent to the device. This allows
   multiple scripts to try to turn off the device while other devices
   use it.  irnetproxy issues the ON command when it connects, and
   issues an OFF command when it is stopped.
Add irnetproxy tests into the existing test runners

 * make check-pylint now runs on irnetproxy and irnetproxy_test
 * make check-nosetests includes the irnetproxy_test module
 * New python dependency 'mock' added to the .tests.yml file

Note, mock is pip installed because the version in the ubuntu
deb repositories is too old (doesn't support return_value= argument)
tests/fake-irnetbox: Log OUTPUT_IR_ASYNC sequence number

This helped me debug an endianness issue fixed in the next commit.
test_irnetbox_proxy: Isolated component test for irnetproxy.py

Using irnetproxy.py in between 2 `stbt run` clients and a fake irnetbox,
the test checks that each client gets the right responses.

Note that tests/fake-irnetbox now returns the sequence number in the
OUTPUT_IR_ASYNC ACK message in little-endian format. This is the
opposite of what the spec† says. This matches the implementation in
irnetproxy.py, which has been tested against 2 separate irNetBox-III
devices.

† http://www.redrat.co.uk/products/IRNetBox_Comms-V3.X.pdf
irnetproxy_test.py: Remove tests that require `mock` library

Because the library has to be pip-installed (see 10909cc9) which is yet
another dependency for people to install, and all our other dependencies
can be installed with the system package manager (yum, apt-get, etc).

Instead, I added some component tests in the previous commit.
Makefile: Cleanup: Rearrange order of files in `check-pylint` recipe

This keeps the `irnet*` files together, and the `stbt-*` files together,
and the `extra/` files together.
irnetbox.py: Cleanup documentation formatting

I'm going to add another paragraph to the `IRNetBox` class's
documentation in a future commit, so this will make it clearer
where one class's documentation ends and the next begins.

The indentation is reStructuredText's format for definition lists.