Patchwork oe-selftest: Fixed "test_rm_old_image" that was outdated

login
register
mail settings
Submitter Corneliu Stoicescu
Date Feb. 17, 2014, 4:09 p.m.
Message ID <1392653353-3395-1-git-send-email-corneliux.stoicescu@intel.com>
Download mbox | patch
Permalink /patch/66851/
State New
Headers show

Comments

Corneliu Stoicescu - Feb. 17, 2014, 3:04 p.m.
After a second look, this test case will always pass because the DATETIME variable will not give the correct date+time for the core-image-minimal that was already built, so it will never find the image that it's looking for. Please ignore this patch, I will send an update as soon as I can.

Regards,
Corneliu

> -----Original Message-----
> From: Stoicescu, CorneliuX
> Sent: Monday, February 17, 2014 6:09 PM
> To: openembedded-core@lists.openembedded.org
> Cc: Stoicescu, CorneliuX
> Subject: [PATCH] oe-selftest: Fixed "test_rm_old_image" that was outdated
> 
> This test used the old format of IMAGE_LINK_NAME that used to contain
> DATETIME information.
> Now it uses IMAGE_LINK_NAME and DATETIME variables to determine the
> path to the image.
> 
> Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
> ---
>  meta/lib/oeqa/selftest/buildoptions.py |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/lib/oeqa/selftest/buildoptions.py
> b/meta/lib/oeqa/selftest/buildoptions.py
> index ef6579b..9a22c06 100644
> --- a/meta/lib/oeqa/selftest/buildoptions.py
> +++ b/meta/lib/oeqa/selftest/buildoptions.py
> @@ -26,7 +26,8 @@ class ImageOptionsTests(oeSelfTest):
>          bitbake("core-image-minimal")
>          deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-
> minimal")
>          imagename = get_bb_var("IMAGE_LINK_NAME", target="core-image-
> minimal")
> -        oldimgpath = os.path.realpath(os.path.join(deploydir, imagename +
> ".ext3"))
> +        datetime = get_bb_var("DATETIME", target="core-image-minimal")
> +        oldimgpath = os.path.realpath(os.path.join(deploydir, imagename + '-'
> + datetime + ".rootfs.ext3"))
>          self.append_config("RM_OLD_IMAGE = \"1\"")
>          bitbake("core-image-minimal")
>          self.assertFalse(os.path.exists(oldimgpath), msg="Old image path still
> exists: %s" % oldimgpath)
> --
> 1.7.9.5
Corneliu Stoicescu - Feb. 17, 2014, 4:09 p.m.
This test used the old format of IMAGE_LINK_NAME that used to contain DATETIME information.
Now it uses IMAGE_LINK_NAME and DATETIME variables to determine the path to the image.

Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com>
---
 meta/lib/oeqa/selftest/buildoptions.py |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
index ef6579b..9a22c06 100644
--- a/meta/lib/oeqa/selftest/buildoptions.py
+++ b/meta/lib/oeqa/selftest/buildoptions.py
@@ -26,7 +26,8 @@  class ImageOptionsTests(oeSelfTest):
         bitbake("core-image-minimal")
         deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-minimal")
         imagename = get_bb_var("IMAGE_LINK_NAME", target="core-image-minimal")
-        oldimgpath = os.path.realpath(os.path.join(deploydir, imagename + ".ext3"))
+        datetime = get_bb_var("DATETIME", target="core-image-minimal")
+        oldimgpath = os.path.realpath(os.path.join(deploydir, imagename + '-' + datetime + ".rootfs.ext3"))
         self.append_config("RM_OLD_IMAGE = \"1\"")
         bitbake("core-image-minimal")
         self.assertFalse(os.path.exists(oldimgpath), msg="Old image path still exists: %s" % oldimgpath)