Re: [OE-core] [PATCH] oeqa/sdkext: wic: add new test cases for eSDK

2018-02-12 Thread Chang, Rebecca Swee Fun
Hi all,

Ed has acked/reviewed on the patchset.
Link to patchset: https://patchwork.openembedded.org/patch/147467/

Regards,
Rebecca

-Original Message-
From: Bartosh, Eduard 
Sent: Monday, February 12, 2018 5:09 PM
To: Chang, Rebecca Swee Fun <rebecca.swee.fun.ch...@intel.com>
Subject: Re: [OE-core] [PATCH] oeqa/sdkext: wic: add new test cases for eSDK

Hi Rebecca,

The patchset looks good to me.

Regards,
Ed

On 08/02/18 10:18, "Chang, Rebecca Swee Fun" <rebecca.swee.fun.ch...@intel.com> 
wrote:

Hi Ed,

Thanks, here is the link: https://patchwork.openembedded.org/patch/147467/

Regards,
Rebecca

> -Original Message-
> From: Bartosh, Eduard
> Sent: Thursday, February 8, 2018 6:05 PM
> To: Chang, Rebecca Swee Fun <rebecca.swee.fun.ch...@intel.com>;
> ed.bart...@linux.intel.com
> Subject: Re: [OE-core] [PATCH] oeqa/sdkext: wic: add new test cases for 
eSDK
> 
> Hi Rebecca,
> 
> Can you point me out on the patchset? It looks like I missed it somehow.
> 
> Sure, please take the maintenance, no concerns here.
> 
> Regards,
> Ed
> 
> On 08/02/18 07:09, "Chang, Rebecca Swee Fun"
> <rebecca.swee.fun.ch...@intel.com> wrote:
> 
> Hi Ed,
> 
> I have pushed some basic test for wic in eSDK. I still have plan to 
extend the
> test coverage.
> Could you help to provide you feedback for the basic tests?
> 
> I also plan to take up the recipe maintenance for wic-tools and 
bmap-tools.
> Do you have any concern?
> 
> Thank you.
> 
> Regards,
> Rebecca

> -Original Message-
> From: openembedded-core-boun...@lists.openembedded.org
> [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of
> Chang Rebecca Swee Fun
> Sent: Monday, January 22, 2018 12:26 PM
> To: OpenEmbedded Core Mailing List  c...@lists.openembedded.org>
> Subject: [OE-core] [PATCH] oeqa/sdkext: wic: add new test cases for eSDK
> 
> wic is now available in the eSDK. Adding test cases to test wic utility 
> within eSDK.
> 
> Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.ch...@intel.com>
> ---
>  meta/lib/oeqa/sdkext/cases/wic.py | 171
> ++
>  1 file changed, 171 insertions(+)
>  create mode 100644 meta/lib/oeqa/sdkext/cases/wic.py
> 
> diff --git a/meta/lib/oeqa/sdkext/cases/wic.py
> b/meta/lib/oeqa/sdkext/cases/wic.py
> new file mode 100644
> index 000..221a290
> --- /dev/null
> +++ b/meta/lib/oeqa/sdkext/cases/wic.py
> @@ -0,0 +1,171 @@
> +import os
> +import sys
> +import shutil
> +import unittest
> +
> +from glob import glob
> +
> +from oeqa.sdkext.case import OESDKExtTestCase from
> +oeqa.core.decorator.depends import OETestDepends from
> +oeqa.core.decorator.oeid import OETestID from oeqa.utils.commands
> +import runCmd
> +
> +
> +class WicTest(OESDKExtTestCase):
> +"""Wic test within eSDK."""
> +
> +testdir = "/var/tmp/wic.test.sdkext/"
> +outfile = "/var/tmp/wic.test.sdkext/output.txt"
> +
> +@OETestID(1963)
> +def test_wic_location(self):
> +"""Check whether wic is run within eSDK sysroot"""
> +output = self._run("which wic")
> +self.assertEqual(output.startswith(self.tc.sdk_dir), True, \
> +msg="Seems that wic isn't the eSDK one : %s" % output)
> +
> +def _exec_wic_cmd(self, cmd):
> +"""Wrapper to execute wic command and check status"""
> +status = runCmd("cd %s; . %s; %s" % (self.tc.sdk_dir, 
> self.tc.sdk_env,
> cmd)).status
> +self.assertEqual(0, status)
> +
> +def _exec_devtool_build(self):
> +"""Wrapper to build image as pre-requisite for wic"""
> +cmd = "devtool build-image"
> +runCmd("cd %s; . %s; %s" % (self.tc.sdk_dir, self.tc.sdk_env,
> + cmd))
> +
> +def _get_img_type(self):
> +"""Wrapper to get SDK target for image creation"""
> +# Get sdk_targets from devtool.conf
> +conf_file = self.tc.sdk_dir + "conf/devtool.conf"
> +with open (conf_file, 'r') as in_file:
> + for line in in_file:
> +if 'sdk_targets' in line:
> +image = line.split()
> +for img_name in image:
> +if img_name.startswith('core-image'):
> +br

Re: [OE-core] [PATCH] oeqa/sdkext: wic: add new test cases for eSDK

2018-02-05 Thread Chang, Rebecca Swee Fun
Ping
Some basic tests for wic to ensure it is supported in eSDK.

> -Original Message-
> From: openembedded-core-boun...@lists.openembedded.org
> [mailto:openembedded-core-boun...@lists.openembedded.org] On Behalf Of
> Chang Rebecca Swee Fun
> Sent: Monday, January 22, 2018 12:26 PM
> To: OpenEmbedded Core Mailing List  c...@lists.openembedded.org>
> Subject: [OE-core] [PATCH] oeqa/sdkext: wic: add new test cases for eSDK
> 
> wic is now available in the eSDK. Adding test cases to test wic utility 
> within eSDK.
> 
> Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.ch...@intel.com>
> ---
>  meta/lib/oeqa/sdkext/cases/wic.py | 171
> ++
>  1 file changed, 171 insertions(+)
>  create mode 100644 meta/lib/oeqa/sdkext/cases/wic.py
> 
> diff --git a/meta/lib/oeqa/sdkext/cases/wic.py
> b/meta/lib/oeqa/sdkext/cases/wic.py
> new file mode 100644
> index 000..221a290
> --- /dev/null
> +++ b/meta/lib/oeqa/sdkext/cases/wic.py
> @@ -0,0 +1,171 @@
> +import os
> +import sys
> +import shutil
> +import unittest
> +
> +from glob import glob
> +
> +from oeqa.sdkext.case import OESDKExtTestCase from
> +oeqa.core.decorator.depends import OETestDepends from
> +oeqa.core.decorator.oeid import OETestID from oeqa.utils.commands
> +import runCmd
> +
> +
> +class WicTest(OESDKExtTestCase):
> +"""Wic test within eSDK."""
> +
> +testdir = "/var/tmp/wic.test.sdkext/"
> +outfile = "/var/tmp/wic.test.sdkext/output.txt"
> +
> +@OETestID(1963)
> +def test_wic_location(self):
> +"""Check whether wic is run within eSDK sysroot"""
> +output = self._run("which wic")
> +self.assertEqual(output.startswith(self.tc.sdk_dir), True, \
> +msg="Seems that wic isn't the eSDK one : %s" % output)
> +
> +def _exec_wic_cmd(self, cmd):
> +"""Wrapper to execute wic command and check status"""
> +status = runCmd("cd %s; . %s; %s" % (self.tc.sdk_dir, 
> self.tc.sdk_env,
> cmd)).status
> +self.assertEqual(0, status)
> +
> +def _exec_devtool_build(self):
> +"""Wrapper to build image as pre-requisite for wic"""
> +cmd = "devtool build-image"
> +runCmd("cd %s; . %s; %s" % (self.tc.sdk_dir, self.tc.sdk_env,
> + cmd))
> +
> +def _get_img_type(self):
> +"""Wrapper to get SDK target for image creation"""
> +# Get sdk_targets from devtool.conf
> +conf_file = self.tc.sdk_dir + "conf/devtool.conf"
> +with open (conf_file, 'r') as in_file:
> + for line in in_file:
> +if 'sdk_targets' in line:
> +image = line.split()
> +for img_name in image:
> +if img_name.startswith('core-image'):
> +break
> +return img_name
> +
> +def _get_line_count(self):
> +count = 0
> +with open (self.outfile, 'r') as output:
> +count = sum(1 for line in output if line.rstrip('\n'))
> +return count
> +
> +@OETestID(1964)
> +@OETestDepends(['test_wic_location'])
> +def test_wic_version(self):
> +cmd = "wic --version"
> +self._exec_wic_cmd(cmd)
> +
> +@OETestID(1965)
> +@OETestDepends(['test_wic_location'])
> +def test_wic_help(self):
> +cmd = "wic --help"
> +self._exec_wic_cmd(cmd)
> +cmd = "wic -h"
> +self._exec_wic_cmd(cmd)
> +
> +@OETestID(1966)
> +@OETestDepends(['test_wic_location'])
> +def test_wic_create_help(self):
> +cmd = "wic create --help"
> +self._exec_wic_cmd(cmd)
> +
> +@OETestID(1967)
> +@OETestDepends(['test_wic_location'])
> +def test_wic_list_help(self):
> +cmd = "wic list --help"
> +self._exec_wic_cmd(cmd)
> +
> +@OETestID(1968)
> +@OETestDepends(['test_wic_location'])
> +def test_wic_help_create(self):
> +cmd = "wic help create"
> +self._exec_wic_cmd(cmd)
> +
> +@OETestID(1969)
> +@OETestDepends(['test_wic_location'])
> +def test_wic_help_list(self):
> +cmd = "wic help list"
> +self._exec_wic_cmd(cmd)
> +
> +@OETestID(1970)
> +@OETestDepends(['test_wic_location'])
> +def test_wic_help_overview(self):
> +cmd = "wic help overview"

[OE-core] [PATCH] oeqa/sdkext: wic: add new test cases for eSDK

2018-01-21 Thread Chang Rebecca Swee Fun
wic is now available in the eSDK. Adding test cases to test
wic utility within eSDK.

Signed-off-by: Chang Rebecca Swee Fun 
---
 meta/lib/oeqa/sdkext/cases/wic.py | 171 ++
 1 file changed, 171 insertions(+)
 create mode 100644 meta/lib/oeqa/sdkext/cases/wic.py

diff --git a/meta/lib/oeqa/sdkext/cases/wic.py 
b/meta/lib/oeqa/sdkext/cases/wic.py
new file mode 100644
index 000..221a290
--- /dev/null
+++ b/meta/lib/oeqa/sdkext/cases/wic.py
@@ -0,0 +1,171 @@
+import os
+import sys
+import shutil
+import unittest
+
+from glob import glob
+
+from oeqa.sdkext.case import OESDKExtTestCase
+from oeqa.core.decorator.depends import OETestDepends
+from oeqa.core.decorator.oeid import OETestID
+from oeqa.utils.commands import runCmd
+
+
+class WicTest(OESDKExtTestCase):
+"""Wic test within eSDK."""
+
+testdir = "/var/tmp/wic.test.sdkext/"
+outfile = "/var/tmp/wic.test.sdkext/output.txt"
+
+@OETestID(1963)
+def test_wic_location(self):
+"""Check whether wic is run within eSDK sysroot"""
+output = self._run("which wic")
+self.assertEqual(output.startswith(self.tc.sdk_dir), True, \
+msg="Seems that wic isn't the eSDK one : %s" % output)
+
+def _exec_wic_cmd(self, cmd):
+"""Wrapper to execute wic command and check status"""
+status = runCmd("cd %s; . %s; %s" % (self.tc.sdk_dir, self.tc.sdk_env, 
cmd)).status
+self.assertEqual(0, status)
+
+def _exec_devtool_build(self):
+"""Wrapper to build image as pre-requisite for wic"""
+cmd = "devtool build-image"
+runCmd("cd %s; . %s; %s" % (self.tc.sdk_dir, self.tc.sdk_env, cmd))
+
+def _get_img_type(self):
+"""Wrapper to get SDK target for image creation"""
+# Get sdk_targets from devtool.conf
+conf_file = self.tc.sdk_dir + "conf/devtool.conf"
+with open (conf_file, 'r') as in_file:
+ for line in in_file:
+if 'sdk_targets' in line:
+image = line.split()
+for img_name in image:
+if img_name.startswith('core-image'):
+break
+return img_name
+
+def _get_line_count(self):
+count = 0
+with open (self.outfile, 'r') as output:
+count = sum(1 for line in output if line.rstrip('\n'))
+return count
+
+@OETestID(1964)
+@OETestDepends(['test_wic_location'])
+def test_wic_version(self):
+cmd = "wic --version"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1965)
+@OETestDepends(['test_wic_location'])
+def test_wic_help(self):
+cmd = "wic --help"
+self._exec_wic_cmd(cmd)
+cmd = "wic -h"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1966)
+@OETestDepends(['test_wic_location'])
+def test_wic_create_help(self):
+cmd = "wic create --help"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1967)
+@OETestDepends(['test_wic_location'])
+def test_wic_list_help(self):
+cmd = "wic list --help"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1968)
+@OETestDepends(['test_wic_location'])
+def test_wic_help_create(self):
+cmd = "wic help create"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1969)
+@OETestDepends(['test_wic_location'])
+def test_wic_help_list(self):
+cmd = "wic help list"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1970)
+@OETestDepends(['test_wic_location'])
+def test_wic_help_overview(self):
+cmd = "wic help overview"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1971)
+@OETestDepends(['test_wic_location'])
+def test_wic_help_plugins(self):
+cmd = "wic help plugins"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1972)
+@OETestDepends(['test_wic_location'])
+def test_wic_help_kickstart(self):
+cmd = "wic help kickstart"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1973)
+@OETestDepends(['test_wic_location'])
+def test_wic_list_images(self):
+cmd = "wic list images"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1974)
+@OETestDepends(['test_wic_location'])
+def test_wic_list_src_plugins(self):
+cmd = "wic list source-plugins"
+self._exec_wic_cmd(cmd)
+
+@OETestID(1976)
+@OETestDepends(['test_wic_location'])
+def test_wic_listed_images_help(self):
+cmd = "wic list images"
+output = runCmd("cd %s; %s" % (self.tc.sdk_dir, cmd)).output
+imagelist = [line.split()[0] for line in output.splitlines()]
+for img in imagelist:
+cmd = "wic list %s help" % img
+self._exec_wic_cmd(cmd)
+
+@OETestID(1977)
+@OETestDepends(['test_wic_location'])
+def test_wic_unsupported_subcommand(self):
+self.assertNotEqual(0, runCmd('wic unsupported', 
ignore_status=True).status)
+
+@OETestID(1978)
+