stbt power: Support ATEN network-controlled PDU's

This commit implements support for ATEN PDU's over SNMP. While these
PDU's also have a web interface, SNMP is a more direct and reliable way
of controlling them. It also updates the regex to recognise the `aten`
as a valid model. To query and control the PDU, it makes use of the
`snmpget` and `snmpset` commands from Net-SNMP [1]. The packaging
scripts were updated to install these tools as dependencies [2].

The relevant SNMP OID's were found using ATEN's MIB file v1.1.109 [3],
which applies to *all* ATEN PDU's:

    outlet1Status  enterprises.21317.1.3.2.2.2.2.2.0
    outlet2Status  enterprises.21317.1.3.2.2.2.2.3.0
    outlet3Status  enterprises.21317.1.3.2.2.2.2.4.0
    ...            ...
    outlet42Status enterprises.21317.1.3.2.2.2.2.44.0

Each outlet status is an integer in the range 1-8. From the MIB file:

    Display and control outlet status. Can't set pending status.

    Enumerations:
    1 - off
    2 - on
    3 - pending
    4 - reboot
    5 - fault
    6 - noauth
    7 - not-support
    8 - pop

When querying the outlet status through `stbt power status`, this
implementation maps values 1->OFF and 2->ON.

Even though sending an ON or OFF command through SNMP returns
immediately, the outlet can take some time to complete the transition.
However, this implementation will poll until the outlet actually
achieves the desired state and will exit with an error if it fails to do
so within the timeout interval (12 seconds) [4]. Note that during the
transition period the outlet will return its status as 3 (pending) but
this state should never be visible to end users of `stbt power`.

The Net-SNMP commands use SNMPv2c because it is faster than SNMPv1 and
unlike SNMPv3 it doesn't require authentication (which would also be
slower).

When `snmpget` or `snmpset` operate on an OID that is not known to the
device, they do not fail with non-zero status but instead print: "No
Such Object available on this agent at this OID". In stbt-power this
should only happen if (1) the device is not an ATEN PDU or (2) the
outlet was specified incorrectly (non-integer, less than 1, or greater
than the device's number of actual outlets).

Note that the SNMPv2 read & write community is hard-coded to
"administrator", which is the default on ATEN PDU's.

This was tested on an ATEN PE6108G 8-outlet PDU and Net-SNMP v5.7.2.

[1] http://net-snmp.sourceforge.net/docs/man/
[2] Debian package `snmp` and Fedora package `net-snmp-utils`
[3] http://www.aten.com/export.php?mid=20130906165112002&type=driver
[4] The timeout interval was guided by tests on an ATEN PE6108G where
    OFF->ON takes between 4-8 secs and ON->OFF less than 1 sec.
Merge pull request #165 from abaharna/aten-pdu

stbt power: Support ATEN network-controlled PDU's
stbt power: Document that we want to port to python
Revert "Display teardown: Fix race condition in flushing logic"

This reverts commit e051ba8919b4d75ca3bacf58087d525e84354e08.

fadfe6e added a flush during pipeline teardown, to avoid what we call
"long teardown" with non-live sources like filesrc -- the pipeline
doesn't actually get the EOS within 10 seconds so stbt times out and
exits forcefully.

Unfortunately this caused a live v4l source (real video-capture
hardware) to always suffer from long teardown.

e051ba8 changed the order of sending eos vs. flush_stop, for an
unrelated reason (to fix an intermittent long teardown found with a
non-live source in our self-tests). e051ba8 also improved the long
teardown with our live source, from 100% of test runs to ~2% of test
runs.

I am reverting both fadfe6e and e051ba8 -- better teardown with non-live
sources isn't worth it if it causes worse teardown with live sources.
Non-live sources are only useful for our self-tests.
Revert "Display: Fix ungraceful teardowns (with delays) with non-live sources"

This reverts commit fadfe6e39c40bd8d70845c218341957526917a4c.

fadfe6e added a flush during pipeline teardown, to avoid what we call
"long teardown" with non-live sources like filesrc -- the pipeline
doesn't actually get the EOS within 10 seconds so stbt times out and
exits forcefully.

Unfortunately this caused a live v4l source (real video-capture
hardware) to always suffer from long teardown.

e051ba8 changed the order of sending eos vs. flush_stop, for an
unrelated reason (to fix an intermittent long teardown found with a
non-live source in our self-tests). e051ba8 also improved the long
teardown with our live source, from 100% of test runs to ~2% of test
runs.

I am reverting both fadfe6e and e051ba8 -- better teardown with non-live
sources isn't worth it if it causes worse teardown with live sources.
Non-live sources are only useful for our self-tests.
Merge pull request #177 from drothlis/fix-intermittent-long-teardown

Fix intermittent long teardown
docs/release-notes.md: Copied from stb-tester.com website

From https://github.com/drothlis/stb-tester.com/blob/af1ec155/release-notes.md
0.20 release notes
0.20 release notes: Add `stbt power` ATEN support; acknowledgements
make publish-copr: New target to publish Fedora RPMs

COPR is a Fedora packaging service, similar to Ubuntu's PPAs.
See http://copr.fedoraproject.org/coprs/stbt/stb-tester/ for details.

COPR is simpler and easier to use than OBS (OpenSUSE Build Service)
which we used previously. All you have to do is upload a Source RPM
somewhere and submit the URL to COPR. COPR is officially supported by
Fedora so it seems a better choice -- if it becomes as widespread as
PPAs for Ubuntu, future stb-tester users will already be familiar with
COPR.

The Dockerfile added in this commit is to help me build the Source RPM
without a host Fedora system. The Vagrantfile is to help me run Docker
without a host Linux system.
Move extra/stb-tester.spec.in => extra/fedora/
Merge branch 'fedora-copr'

* fedora-copr:
  Move extra/stb-tester.spec.in => extra/fedora/
  make publish-copr: New target to publish Fedora RPMs
is_screen_black: Save debugging images on failure

This is useful when debugging issues when the screen seems black but
`is_screen_black` reports otherwise.
is_screen_black: Save debug images regardless of outcome

This debugging was added to debug issues when the screen seems black but
`is_screen_black` reports non-black; it seems possible that you might
want to debug an issue where the screen *doesn't* look black but
`is_screen_black` falsely reports it as black.

This is consistent with the debug logging of `detect_match` and
`detect_motion`, which dump debug images regardless of outcome.
Merge branch 'is-screen-black-dbg'

* is-screen-black-dbg:
  is_screen_black: Save debug images regardless of outcome
  is_screen_black: Save debugging images on failure

Closes #120.
Fedora packaging: Add dependency on libvpx

libvpx is needed by the GStreamer element "vp8enc" which is installed by
gstreamer1-plugins-good, which in turn doesn't install the libvpx
dependency, according to
https://groups.google.com/d/msg/stb-tester/ulbGv_4gHdk/x93iqOdQMdYJ
Refactor: Make uri_to_remote_recorder more declarative

The function was getting rather long so I decided to refactor it mistaking
it for `uri_to_remote` which I'd planned to modify.  Arguably this is
still an improvement reducing the number of lines by 14.
Refactor: Make `uri_to_remote` more declarative

The function was getting rather long so I decided to refactor it before
adding the new remote type `X11Remote`.  This is more declarative.
Remotes: Add support for sending keys to X11

Can be used with GStreamer's ximagesrc for desktop automation, testing
applications, websites and set-top-box UIs written in HTML5.
test_x11_remote: Tear down Xorg & xterm in event of test failure

Otherwise the next time you run the tests it says "Skipped: There is
already a display server running on :99".