Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: Joshua Lock <joshua.lock@collabora.co.uk>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [[PATCH v2] oeqa/selftest/wic: add test case for sparse images
Date: Wed, 30 Dec 2015 11:53:43 +0200	[thread overview]
Message-ID: <20151230095343.GA7457@linux.intel.com> (raw)
In-Reply-To: <1450381421-25856-1-git-send-email-joshua.lock@collabora.co.uk>

Hi Joshua,

Thank you for the patch!

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>

On Thu, Dec 17, 2015 at 07:43:41PM +0000, Joshua Lock wrote:
> Add a testcase to build a directdisk image and check that the
> used disk size is less than the apparent size, as wic now
> assembles images as sparse files.
> 
> Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
> ---
>  meta/lib/oeqa/selftest/wic.py | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
> index 55f6f82..9050d28 100644
> --- a/meta/lib/oeqa/selftest/wic.py
> +++ b/meta/lib/oeqa/selftest/wic.py
> @@ -264,3 +264,16 @@ class Wic(oeSelfTest):
>          self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
>                                     % image).status)
>          self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
> +
> +    def test_sparseness(self):
> +        """Test that assembled images are sparse; apparent size > disk usage"""
> +        self.assertEqual(0, runCmd("wic create directdisk "
> +                                   "--image-name core-image-minimal").status)
> +        images = glob(self.resultdir + "directdisk-*.direct")
> +        self.assertEqual(1, len(images))
> +
> +        imagestat = os.stat(images.pop())
> +        # st_blocks is the "number of 512-byte blocks allocated for file"
> +        used = imagestat.st_blocks*512
> +        apparent = imagestat.st_size
> +        self.assertLess(used, apparent)

--
Regards,
Ed


      reply	other threads:[~2015-12-30 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 16:33 [PATCH] wic/utils/partitionedfs.py: assemble .wic images as sparse files Joshua Lock
2015-12-17 12:21 ` Ed Bartosh
2015-12-17 13:19   ` Joshua Lock
2015-12-17 13:23     ` Burton, Ross
2015-12-17 13:53     ` Ed Bartosh
2015-12-17 16:09 ` [PATCH] oeqa/selftest/wic: add test case for sparse images Joshua Lock
2015-12-17 16:21   ` Burton, Ross
2015-12-17 16:52     ` Joshua Lock
2015-12-17 19:43   ` [[PATCH v2] " Joshua Lock
2015-12-30  9:53     ` Ed Bartosh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151230095343.GA7457@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=joshua.lock@collabora.co.uk \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox