Re: [PATCH] KVM Test: Make login timeout configurable.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2010-05-28 at 13:36 +0800, Feng Yang wrote:
> Add login_timeout parameter to make login timeout configurable.
> Currently default timeout value is 240s. It is always not enough,
> many case fail foer could not boot up in 240s in our testing.

I like the idea of unifying all login timeouts. I remember to have
implemented this partially for some tests, all with different parameter,
which ended up being a mess. Let me search for all the occurrences, fix
them and merge with your patch. I'll return with an updated patch.

> Have update following script:
> client/tests/kvm/tests/autoit.py
> client/tests/kvm/tests/autotest.py
> client/tests/kvm/tests/balloon_check.py
> client/tests/kvm/tests/guest_s4.py
> client/tests/kvm/tests/iozone_windows.py
> client/tests/kvm/tests/linux_s3.py
> client/tests/kvm/tests/migration.py
> client/tests/kvm/tests/pci_hotplug.py
> client/tests/kvm/tests/physical_resources_check.py
> client/tests/kvm/tests/shutdown.py
> client/tests/kvm/tests/timedrift.py
> client/tests/kvm/tests/timedrift_with_migration.py
> client/tests/kvm/tests/timedrift_with_reboot.py
> client/tests/kvm/tests/vlan_tag.py
> client/tests/kvm/tests/yum_update.py
> 
> Signed-off-by: Feng Yang <fyang@xxxxxxxxxx>
> ---
>  client/tests/kvm/tests/autoit.py                   |    3 ++-
>  client/tests/kvm/tests/autotest.py                 |    3 ++-
>  client/tests/kvm/tests/balloon_check.py            |    3 ++-
>  client/tests/kvm/tests/guest_s4.py                 |    5 +++--
>  client/tests/kvm/tests/iozone_windows.py           |    3 ++-
>  client/tests/kvm/tests/linux_s3.py                 |    3 ++-
>  client/tests/kvm/tests/migration.py                |    5 +++--
>  client/tests/kvm/tests/pci_hotplug.py              |    3 ++-
>  client/tests/kvm/tests/physical_resources_check.py |    3 ++-
>  client/tests/kvm/tests/shutdown.py                 |    3 ++-
>  client/tests/kvm/tests/timedrift.py                |    3 ++-
>  client/tests/kvm/tests/timedrift_with_migration.py |    3 ++-
>  client/tests/kvm/tests/timedrift_with_reboot.py    |    3 ++-
>  client/tests/kvm/tests/vlan_tag.py                 |    5 +++--
>  client/tests/kvm/tests/yum_update.py               |    3 ++-
>  client/tests/kvm/tests_base.cfg.sample             |    2 +-
>  16 files changed, 34 insertions(+), 19 deletions(-)
> 
> diff --git a/client/tests/kvm/tests/autoit.py b/client/tests/kvm/tests/autoit.py
> index ed1d491..ba3cdf3 100644
> --- a/client/tests/kvm/tests/autoit.py
> +++ b/client/tests/kvm/tests/autoit.py
> @@ -17,7 +17,8 @@ def run_autoit(test, params, env):
>      @param env: Dictionary with the test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      try:
>          logging.info("Starting script...")
> diff --git a/client/tests/kvm/tests/autotest.py b/client/tests/kvm/tests/autotest.py
> index 31e36cf..2916ebd 100644
> --- a/client/tests/kvm/tests/autotest.py
> +++ b/client/tests/kvm/tests/autotest.py
> @@ -13,7 +13,8 @@ def run_autotest(test, params, env):
>      @param env: Dictionary with the test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      # Collect test parameters
>      timeout = int(params.get("test_timeout", 300))
> diff --git a/client/tests/kvm/tests/balloon_check.py b/client/tests/kvm/tests/balloon_check.py
> index 2d483c6..f33bda8 100644
> --- a/client/tests/kvm/tests/balloon_check.py
> +++ b/client/tests/kvm/tests/balloon_check.py
> @@ -64,7 +64,8 @@ def run_balloon_check(test, params, env):
>  
>      fail = 0
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      # Upper limit that we can raise the memory
>      vm_assigned_mem = int(params.get("mem"))
> diff --git a/client/tests/kvm/tests/guest_s4.py b/client/tests/kvm/tests/guest_s4.py
> index 88b2b7c..608d542 100644
> --- a/client/tests/kvm/tests/guest_s4.py
> +++ b/client/tests/kvm/tests/guest_s4.py
> @@ -12,7 +12,8 @@ def run_guest_s4(test, params, env):
>      @param env: Dictionary with the test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      logging.info("Checking whether guest OS supports suspend to disk (S4)...")
>      s, o = session.get_command_status_output(params.get("check_s4_support_cmd"))
> @@ -31,7 +32,7 @@ def run_guest_s4(test, params, env):
>      time.sleep(5)
>  
>      # Get the second session to start S4
> -    session2 = kvm_test_utils.wait_for_login(vm)
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      # Make sure the background program is running as expected
>      check_s4_cmd = params.get("check_s4_cmd")
> diff --git a/client/tests/kvm/tests/iozone_windows.py b/client/tests/kvm/tests/iozone_windows.py
> index 94444a8..a96fdfc 100644
> --- a/client/tests/kvm/tests/iozone_windows.py
> +++ b/client/tests/kvm/tests/iozone_windows.py
> @@ -18,7 +18,8 @@ def run_iozone_windows(test, params, env):
>      @param env: Dictionary with test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>      results_path = os.path.join(test.resultsdir,
>                                  'raw_output_%s' % test.iteration)
>      analysisdir = os.path.join(test.resultsdir, 'analysis_%s' % test.iteration)
> diff --git a/client/tests/kvm/tests/linux_s3.py b/client/tests/kvm/tests/linux_s3.py
> index 39f09e4..4a782b8 100644
> --- a/client/tests/kvm/tests/linux_s3.py
> +++ b/client/tests/kvm/tests/linux_s3.py
> @@ -12,7 +12,8 @@ def run_linux_s3(test, params, env):
>      @param env: Dictionary with the test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      logging.info("Checking that VM supports S3")
>      status = session.get_command_status("grep -q mem /sys/power/state")
> diff --git a/client/tests/kvm/tests/migration.py b/client/tests/kvm/tests/migration.py
> index b8f171c..33a072e 100644
> --- a/client/tests/kvm/tests/migration.py
> +++ b/client/tests/kvm/tests/migration.py
> @@ -20,7 +20,8 @@ def run_migration(test, params, env):
>      @param env: Dictionary with the test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      # Get the output of migration_test_command
>      test_command = params.get("migration_test_command")
> @@ -33,7 +34,7 @@ def run_migration(test, params, env):
>  
>      # Start another session with the guest and make sure the background
>      # process is running
> -    session2 = kvm_test_utils.wait_for_login(vm)
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      try:
>          check_command = params.get("migration_bg_check_command", "")
> diff --git a/client/tests/kvm/tests/pci_hotplug.py b/client/tests/kvm/tests/pci_hotplug.py
> index d8f34f8..3063359 100644
> --- a/client/tests/kvm/tests/pci_hotplug.py
> +++ b/client/tests/kvm/tests/pci_hotplug.py
> @@ -18,7 +18,8 @@ def run_pci_hotplug(test, params, env):
>      @param env:    Dictionary with test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      # Modprobe the module if specified in config file
>      module = params.get("modprobe_module")
> diff --git a/client/tests/kvm/tests/physical_resources_check.py b/client/tests/kvm/tests/physical_resources_check.py
> index af9613e..258713c 100644
> --- a/client/tests/kvm/tests/physical_resources_check.py
> +++ b/client/tests/kvm/tests/physical_resources_check.py
> @@ -18,7 +18,8 @@ def run_physical_resources_check(test, params, env):
>      @param env: Dictionary with test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      logging.info("Starting physical resources check test")
>      logging.info("Values assigned to VM are the values we expect "
> diff --git a/client/tests/kvm/tests/shutdown.py b/client/tests/kvm/tests/shutdown.py
> index 8a252d9..795d9cf 100644
> --- a/client/tests/kvm/tests/shutdown.py
> +++ b/client/tests/kvm/tests/shutdown.py
> @@ -16,7 +16,8 @@ def run_shutdown(test, params, env):
>      @param env: Dictionary with test environment
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      try:
>          if params.get("shutdown_method") == "shell":
> diff --git a/client/tests/kvm/tests/timedrift.py b/client/tests/kvm/tests/timedrift.py
> index 9cb7489..a1b214c 100644
> --- a/client/tests/kvm/tests/timedrift.py
> +++ b/client/tests/kvm/tests/timedrift.py
> @@ -53,7 +53,8 @@ def run_timedrift(test, params, env):
>              commands.getoutput("taskset -p %s %s" % (mask, tid))
>  
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      # Collect test parameters:
>      # Command to run to get the current time
> diff --git a/client/tests/kvm/tests/timedrift_with_migration.py b/client/tests/kvm/tests/timedrift_with_migration.py
> index 057df5d..e953ed3 100644
> --- a/client/tests/kvm/tests/timedrift_with_migration.py
> +++ b/client/tests/kvm/tests/timedrift_with_migration.py
> @@ -18,7 +18,8 @@ def run_timedrift_with_migration(test, params, env):
>      @param env: Dictionary with the test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      # Collect test parameters:
>      # Command to run to get the current time
> diff --git a/client/tests/kvm/tests/timedrift_with_reboot.py b/client/tests/kvm/tests/timedrift_with_reboot.py
> index d3441e6..22dfd45 100644
> --- a/client/tests/kvm/tests/timedrift_with_reboot.py
> +++ b/client/tests/kvm/tests/timedrift_with_reboot.py
> @@ -18,7 +18,8 @@ def run_timedrift_with_reboot(test, params, env):
>      @param env: Dictionary with the test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      # Collect test parameters:
>      # Command to run to get the current time
> diff --git a/client/tests/kvm/tests/vlan_tag.py b/client/tests/kvm/tests/vlan_tag.py
> index 88baf23..32de6a9 100644
> --- a/client/tests/kvm/tests/vlan_tag.py
> +++ b/client/tests/kvm/tests/vlan_tag.py
> @@ -23,8 +23,9 @@ def run_vlan_tag(test, params, env):
>      vm1 = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
>      vm2 = kvm_test_utils.get_living_vm(env, "vm2")
>  
> -    session1 = kvm_test_utils.wait_for_login(vm1)
> -    session2 = kvm_test_utils.wait_for_login(vm2)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm1, timeout=timeout)
> +    session2 = kvm_test_utils.wait_for_login(vm2, timeout=timeout)
>  
>      try:
>          ip_cfg_base = "vconfig add eth0 %s && ifconfig eth0.%s %s.%s"
> diff --git a/client/tests/kvm/tests/yum_update.py b/client/tests/kvm/tests/yum_update.py
> index 68ef638..1a2bfae 100644
> --- a/client/tests/kvm/tests/yum_update.py
> +++ b/client/tests/kvm/tests/yum_update.py
> @@ -39,7 +39,8 @@ def run_yum_update(test, params, env):
>      @param env: Dictionary with the test environment.
>      """
>      vm = kvm_test_utils.get_living_vm(env, params.get("main_vm"))
> -    session = kvm_test_utils.wait_for_login(vm)
> +    timeout = int(params.get("login_timeout", 360))
> +    session = kvm_test_utils.wait_for_login(vm, timeout=timeout)
>  
>      internal_yum_update(session, "yum update", params.get("shell_prompt"), 600)
>      internal_yum_update(session, "yum update kernel",
> diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample
> index 5349034..aee96c3 100644
> --- a/client/tests/kvm/tests_base.cfg.sample
> +++ b/client/tests/kvm/tests_base.cfg.sample
> @@ -4,7 +4,7 @@
>  vms = vm1
>  images = image1
>  nics = nic1
> -
> +login_timeout = 360
>  # Choose the main VM
>  main_vm = vm1
>  


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux