Skip to contentSkip to conversation

KVM Test: Fix bug that check_image.py will check removed image.

PATCH In review Feng Yang 2 participants 3 messages Apr 12, 2010 – Apr 15, 2010 KVM

lore
Share & tools
lore

Feng Yang

author
#0 lore raw

PATCH 1/1 KVM Test: Fix bug that check_image.py will check removed image.

If set remove_image to yes, the image will be removed before check_image.py is executed as post command. But check_img.py still try to check the removed image When it is running. This patch update check_image.py and let it do not check non-exist image.

BTW, could we first run post command then remove the image?

---
 client/tests/kvm/scripts/check_image.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
client/tests/kvm/scripts/check_image.py +3 -0
index 4056fb8..de163e7 100755
@@ -77,6 +77,9 @@ class ImageCheck(object):
         # Check all the image in list.
         errmsg = []
         for image_path in self.image_path_list:
+            if not os.path.exists(image_path):
+                print "Image %s does not exist!" % image_path
+                continue
             s, o = self.exec_img_cmd('info', image_path)
             if not s:
                 errmsg.append(o)
Signature · 1 line
1.5.5.6
#1 lore raw
Quoted 5 lines · Feng Yang

If set remove_image to yes, the image will be removed before check_image.py is executed as post command.  But check_img.py still try to check the removed image When it is running. This patch update check_image.py and let it do not check non-exist image.

Thanks Feng, applied!

Quoted 1 line

BTW, could we first run post command then remove the image?

I don't see any problem with that. Could you please prepare a patch to do it?

Thank you

Quoted 27 lines

---
 client/tests/kvm/scripts/check_image.py |    3 +++

 1 files changed, 3 insertions(+), 0 deletions(-)
client/tests/kvm/scripts/check_image.py +0 -0
index 4056fb8..de163e7 100755
@@ -77,6 +77,9 @@ class ImageCheck(object):
         # Check all the image in list.

        errmsg = []
        for image_path in self.image_path_list:
+            if not os.path.exists(image_path):
+                print "Image %s does not exist!" % image_path
+                continue
            s, o = self.exec_img_cmd('info', image_path) if not s:
                errmsg.append(o)
--
1.5.5.6

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Signature · 1 line
Lucas
author
#2 lore raw
Quoted 13 lines · ----- "Lucas Meneghel Rodrigues

From: "Lucas Meneghel Rodrigues" <[email protected]>
To: "Feng Yang" <[email protected]>
Cc: [email protected], [email protected]
Sent: Thursday, April 15, 2010 8:05:41 AM GMT +08:00 Beijing / Chongqing / Hong Kong / Urumqi
Subject: Re: [Autotest] [PATCH] KVM Test: Fix bug that check_image.py will check removed image.

Quoted 5 lines · Feng Yang

If set remove_image to yes, the image will be removed before check_image.py is executed as post command.  But check_img.py still try to check the removed image When it is running. This patch update check_image.py and let it do not check non-exist image.

Quoted 6 lines

Thanks Feng, applied!

Quoted 1 line

BTW, could we first run post command then remove the image?

I don't see any problem with that. Could you please prepare a patch to do it?

Ok, will work on it. Thanks

Quoted 36 lines

Thank you

Review

Quoted 6 lines

---
 client/tests/kvm/scripts/check_image.py |    3 +++

 1 files changed, 3 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/client/tests/kvm/scripts/check_image.py

Quoted 21 lines

index 4056fb8..de163e7 100755

client/tests/kvm/scripts/check_image.py +0 -0
@@ -77,6 +77,9 @@ class ImageCheck(object):
         # Check all the image in list.

        errmsg = []
        for image_path in self.image_path_list:
+            if not os.path.exists(image_path):
+                print "Image %s does not exist!" % image_path
+                continue
            s, o = self.exec_img_cmd('info', image_path) if not s:
                errmsg.append(o)
--
1.5.5.6

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Signature · 1 line
Lucas