All of lore.kernel.org
 help / color / mirror / Atom feed
* [KVM-AUTOTEST PATCH] KVM test: kvm_vm.py: do not check nic_mode when adding -tftp option
@ 2010-07-07 10:32 Michael Goldish
  2010-07-07 10:32 ` [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files Michael Goldish
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Goldish @ 2010-07-07 10:32 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_vm.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 603576f..e631a3a 100755
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -432,7 +432,7 @@ class VM:
             qemu_cmd += add_floppy(help, floppy)
 
         tftp = params.get("tftp")
-        if tftp and nic_params.get("nic_mode") == "user":
+        if tftp:
             tftp = kvm_utils.get_path(root_dir, tftp)
             qemu_cmd += add_tftp(help, tftp)
 
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files
  2010-07-07 10:32 [KVM-AUTOTEST PATCH] KVM test: kvm_vm.py: do not check nic_mode when adding -tftp option Michael Goldish
@ 2010-07-07 10:32 ` Michael Goldish
  2010-07-07 10:32   ` [KVM-AUTOTEST PATCH] KVM test: deal with incompatible env files gracefully (using version numbers) Michael Goldish
  2010-07-08  1:43   ` [Autotest] [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files Chen Cao
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Goldish @ 2010-07-07 10:32 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/deps/rss.cpp |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/client/tests/kvm/deps/rss.cpp b/client/tests/kvm/deps/rss.cpp
index 26c5ed6..8df70e4 100644
--- a/client/tests/kvm/deps/rss.cpp
+++ b/client/tests/kvm/deps/rss.cpp
@@ -976,8 +976,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
     if (!hMainWindow)
         ExitOnError("Could not create window");
 
-    //ShowWindow(hMainWindow, SW_SHOWMINNOACTIVE);
-    ShowWindow(hMainWindow, SW_SHOW);
+    ShowWindow(hMainWindow, SW_SHOWMINNOACTIVE);
     UpdateWindow(hMainWindow);
 
     // Main message loop
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [KVM-AUTOTEST PATCH] KVM test: deal with incompatible env files gracefully (using version numbers)
  2010-07-07 10:32 ` [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files Michael Goldish
@ 2010-07-07 10:32   ` Michael Goldish
  2010-07-08  1:43   ` [Autotest] [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files Chen Cao
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Goldish @ 2010-07-07 10:32 UTC (permalink / raw)
  To: autotest, kvm; +Cc: Michael Goldish

Keep a version number in kvm.py (env_version) and record it in new env objects.
When loading an env file, compare its version against env_version.  If it's too
old, don't use it.
When changes are made to the KVM test that break compatibility with existing
env files, env_version should be increased.

This will prevent exceptions being raised due to newly added VM attributes that
are missing from old env files.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm.py       |    3 ++-
 client/tests/kvm/kvm_utils.py |   16 +++++++++++-----
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/client/tests/kvm/kvm.py b/client/tests/kvm/kvm.py
index 9da4c33..f656238 100644
--- a/client/tests/kvm/kvm.py
+++ b/client/tests/kvm/kvm.py
@@ -21,6 +21,7 @@ class kvm(test.test):
             (Online doc - Getting started with KVM testing)
     """
     version = 1
+    env_version = 0
 
     def run_once(self, params):
         # Report the parameters we've received and write them as keyvals
@@ -39,7 +40,7 @@ class kvm(test.test):
         logging.info("Unpickling env. You may see some harmless error "
                      "messages.")
         env_filename = os.path.join(self.bindir, params.get("env", "env"))
-        env = kvm_utils.load_env(env_filename, {})
+        env = kvm_utils.load_env(env_filename, self.env_version)
         logging.debug("Contents of environment: %s", env)
 
         test_passed = False
diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index 4183f1c..fb2d1c2 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -21,17 +21,23 @@ def dump_env(obj, filename):
     file.close()
 
 
-def load_env(filename, default={}):
+def load_env(filename, version):
     """
-    Load KVM test environment from an environment file.
+    Load KVM test environment from an env file.
+    If the version recorded in the file is lower than version, return an empty
+    env.  If some other error occurs during unpickling, return an empty env.
 
-    @param filename: Path to a file where the environment was dumped to.
+    @param filename: Path to an env file.
     """
+    default = {"version": version}
     try:
         file = open(filename, "r")
-        obj = cPickle.load(file)
+        env = cPickle.load(file)
         file.close()
-        return obj
+        if env.get("version", 0) < version:
+            logging.warn("Incompatible env file found. Not using it.")
+            return default
+        return env
     # Almost any exception can be raised during unpickling, so let's catch
     # them all
     except Exception, e:
-- 
1.5.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files
  2010-07-07 10:32 ` [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files Michael Goldish
  2010-07-07 10:32   ` [KVM-AUTOTEST PATCH] KVM test: deal with incompatible env files gracefully (using version numbers) Michael Goldish
@ 2010-07-08  1:43   ` Chen Cao
  2010-07-08 10:23     ` Michael Goldish
  1 sibling, 1 reply; 5+ messages in thread
From: Chen Cao @ 2010-07-08  1:43 UTC (permalink / raw)
  To: Michael Goldish; +Cc: autotest, kvm

Michael,

Can rss provide some log (files)?

Cao, Chen

On Wed, Jul 07, 2010 at 01:32:17PM +0300, Michael Goldish wrote:
> Signed-off-by: Michael Goldish <mgoldish@redhat.com>
> ---
>  client/tests/kvm/deps/rss.cpp |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/client/tests/kvm/deps/rss.cpp b/client/tests/kvm/deps/rss.cpp
> index 26c5ed6..8df70e4 100644
> --- a/client/tests/kvm/deps/rss.cpp
> +++ b/client/tests/kvm/deps/rss.cpp
> @@ -976,8 +976,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
>      if (!hMainWindow)
>          ExitOnError("Could not create window");
>  
> -    //ShowWindow(hMainWindow, SW_SHOWMINNOACTIVE);
> -    ShowWindow(hMainWindow, SW_SHOW);
> +    ShowWindow(hMainWindow, SW_SHOWMINNOACTIVE);
>      UpdateWindow(hMainWindow);
>  
>      // Main message loop
> -- 
> 1.5.4.1
> 
> _______________________________________________
> Autotest mailing list
> Autotest@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

-- 
Regards,

Cao, Chen

GnuPG Key-ID:AC54E05E
keyserver hkp://keys.gnupg.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Autotest] [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files
  2010-07-08  1:43   ` [Autotest] [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files Chen Cao
@ 2010-07-08 10:23     ` Michael Goldish
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Goldish @ 2010-07-08 10:23 UTC (permalink / raw)
  To: Chen Cao; +Cc: autotest, kvm

On 07/08/2010 04:43 AM, Chen Cao wrote:
> Michael,
> 
> Can rss provide some log (files)?
> 
> Cao, Chen

Not right now, but I'll post a patch that will enable logging.

> On Wed, Jul 07, 2010 at 01:32:17PM +0300, Michael Goldish wrote:
>> Signed-off-by: Michael Goldish <mgoldish@redhat.com>
>> ---
>>  client/tests/kvm/deps/rss.cpp |    3 +--
>>  1 files changed, 1 insertions(+), 2 deletions(-)
>>
>> diff --git a/client/tests/kvm/deps/rss.cpp b/client/tests/kvm/deps/rss.cpp
>> index 26c5ed6..8df70e4 100644
>> --- a/client/tests/kvm/deps/rss.cpp
>> +++ b/client/tests/kvm/deps/rss.cpp
>> @@ -976,8 +976,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
>>      if (!hMainWindow)
>>          ExitOnError("Could not create window");
>>  
>> -    //ShowWindow(hMainWindow, SW_SHOWMINNOACTIVE);
>> -    ShowWindow(hMainWindow, SW_SHOW);
>> +    ShowWindow(hMainWindow, SW_SHOWMINNOACTIVE);
>>      UpdateWindow(hMainWindow);
>>  
>>      // Main message loop
>> -- 
>> 1.5.4.1
>>
>> _______________________________________________
>> Autotest mailing list
>> Autotest@test.kernel.org
>> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-07-08 10:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-07 10:32 [KVM-AUTOTEST PATCH] KVM test: kvm_vm.py: do not check nic_mode when adding -tftp option Michael Goldish
2010-07-07 10:32 ` [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files Michael Goldish
2010-07-07 10:32   ` [KVM-AUTOTEST PATCH] KVM test: deal with incompatible env files gracefully (using version numbers) Michael Goldish
2010-07-08  1:43   ` [Autotest] [KVM-AUTOTEST PATCH] KVM test: rss.cpp: minimize window by default so it doesn't bother step files Chen Cao
2010-07-08 10:23     ` Michael Goldish

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.