AConnection.can_login(): Only Check Login Prompt

Until now the can_login Method checked for both password and login prompt. This
seems unreasonable. Either the content or the method's name had to be changed.
For now a change of content was assumed the better solution, because the method
was used in several places already.

Also for usability the method was transformed into a property.

See GitHub Issue #104.

Signed-off-by: Erik Bernoth <erik.bernoth@gmail.com>
AConnection._prompt(): Exception depends on prompt

At first _prompt() raised an EmptyResponseException always when an empty string
was the result of its _cmd() call. But that is actually bad in the most common
scenario in which _prompt() basically asks for a current prompt string.
Updating the last_prompt string does not result in any output. Therefore
_prompt() raised an exception in the case where everything worked as expected.

The problem was resolved by also checking the last_prompt attribute. It gets
deleted before the _cmd() call and checked for existance after the call.
Therefore it must have been set in the middle. Only if that didn't happen and
no output was generated then an exception is raised.

FYI: The EmptyResponseException is important for the Disconnected state to
verify if a switch to the Connected state is possible. If you ask for a new
prompt and recieve absolutely nothing back than it is likely that the device is
not running or not connected to the test host properly. Therefore catching an
EmptyResponseException results in not switching to the Connected state.

See GitHub Issue #104.

Signed-off-by: Erik Bernoth <erik.bernoth@gmail.com>
EchoConn: set last_prompt in _cmd()

In the previous commit to the same GitHub Issue #104 a check for last_prompt
was added to AConnection's _prompt() method. Therefore the test connections
also need to provide one if one is requested.

See GitHub Issue #104.

Signed-off-by: Erik Bernoth <erik.bernoth@gmail.com>
SerialConnection._cmd(): debug-log formatted msg

The message that is actually sent to the device might be transformed in many
ways from what is actually entered into the public cmd() method by the user. To
better see what actually gets transmitted between test host and target device a
logging message was added.

See GitHub Issue #104.

Signed-off-by: Erik Bernoth <erik.bernoth@gmail.com>
SerialConn: be more verbose about auth. process

Authenticating a user requires actually two steps, sending the username and
then sending the password. While debugging it was not clear whether one of
these steps or something in the middle might result in a buggy behaviour. It
was not the case, but to clear up the code helped evaluating the situation
better.

See GitHub Issue #104.

Signed-off-by: Erik Bernoth <erik.bernoth@gmail.com>