KVM test: corrections to guest_s4

- Log into the guest again after it resumes from S4 ('session2' doesn't survive
  S4 in user networking mode).
- Use != 0 when checking the status returned by get_command_status(), because
  when things go wrong, it can also return None.
- Use time.sleep(float(params.get(...))) instead of time.sleep(params.get(...))
  (time.sleep() doesn't accept strings).
- Do not check that the VM is alive after vm.create() because vm.create()
  already does that.
- Use get_command_output(kill_test_s4_cmd) instead of sendline(kill_test_s4_cmd),
  because get_command_output() waits for the prompt to return, and allows us to
  be sure that the command got delivered to the guest.  This is especially
  important if the session is closed immediately after sending the command.
  In the case of the command that performs suspend to disk (set_s4_cmd), and the
  test_s4_cmd for Linux (nohup ...), it is OK to use sendline() because the
  prompt may never return.  In the latter case, sleep(5) after the sendline()
  call should ensure that the command got delivered before the test proceeds.
- Change the timeouts in the wait_for(vm.is_dead, ...) call.
- For Windows guests modify test_s4_cmd to 'start ping -t localhost'.
  Using start /B isn't safe because then ping's output is redirected to a dead
  shell session.
- For Windows guests mdify check_s4_cmd to 'tasklist | find /I "ping.exe"'.
  (It's a little more specific than just "ping".)
- Run guest_s4 after autoit tests because it can leave Windows guests with an
  annoying welcome screen.
- Make the logging messages more consistent with the style of other tests.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3861 592f7852-d20e-0410-864c-8624ca9c26a4
2 files changed