tests: extract testing framework

This refactoring will allow to create more complex tests which are not
limited to running only one command inside the guest, but can also
perform actions and validations which are external to the guest. Such
test cases are managed by the common test runner (scripts/test.py) and
use the same guest-management infrastructure, error detection,
etc. The common code is extracted to testing.py module. This was in
done with intent to write tests which involve external TCP
communication.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: use singular form of a noun when count is one

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: introduce --test option

This option allows to run a single test using the test runner.

Example:

 scripts/test.py --test tst-async.so

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: add test for closing TCP connection with pending packets

The test is supposed to trigger the problem from issue #259. I was not
able to trigger the problem using guest-local communication, hence the
client is external to the guest.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>