dockertest.output: Log stdout/stderr when __nonzero__()

As the checker is whastly based on stdout/stderr it's essential to have
the output in case of failure.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests.docker_cli.kill: Support for custom skipped_signals

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests.docker_cli.kill: Change the stress_cmd

Decrease the sleep timeout of the stress cmd (speedup the testing)

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests.docker_cli.kill: Add support for "os.kill" and attached process

This pull request adds the possibility to use os.kill instead of
"docker kill" as a test command.

Additionally it adds the possibility to run the main docker command as
docker attach process.

Booth features are utilized in 4 new tests, which test the sig-proxy
feature of the main process (run or attach).

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests.docker_cli.kill: Improve skip_signals configuration

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests.docker_cli.run_sigproxy: Add new test run_sigproxy

this test checks `docker run`/`docker attach` --sig-proxy feature.
It spawns container process (run/attach) and using subprocess.send_signal
kills it with desired signals. Than it verifies they were (not)forwarded
based on the expected values.

There is outstanding bug where sig-proxy can't handle multiple signals
without delay. This test uses workaround with time.sleep(0.1).

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests.docker_cli.kill: Split test into separate files

Split test into separate files, improve the log output and code
cleanups.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests.docker_cli.kill: Pylint/style cleanups

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests.docker_cli: Simplification of kill/run_sigproxy configs

This patch simplifies the config by removing unnecessarry options
into test-specific variables.

Additionally it adjusts some logging to the recent framework changes.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests.docker_cli.kill: Update the test to work with latest docker

Latest docker doesn't return the exit code, but follows this schema:
* with tty=on `docker kill` => 0
* with tty=off `docker kill` => 255
* bash `kill -9 $cont_pid` => 137

Skip the exit code check for now and wait until the behavior stabilizes.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests.docker_cli: kill and run_sigproxy style cleanups

This patch doesn't change any logic, it only refactors the code
to avoid all pylint/pep style errors.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
subtests...kill: Message grooming

*  DockerCmd subclasses can now accept any SubBase
   derrived class.  They make use of this in logging
   messages with a more precise sub/sub-subtest name.
   Changed all calls to pass in the sub-subtest instead
   of always the parent subtest.

*  There's no need to print out all details for every single
   docker command when hundreds are run.  Defined local
   quiet/non-verbose versions of DockerCmd classes.  Enough details
   are still recorded into debug log to aid in finding any problems.

*  There were multiple nearly-identical messages printed
   by several sub-subtests.  The differences were non-
   substantial, and full details are always printed
   to the console.  Consolidated the "Missing signal" message
   and exception raising into a single method.  Removed
   details from exception and added to debug log.

*  Updated kill/stress to use Output class.

Signed-off-by: Chris Evich <cevich@redhat.com>