[OE-core] [PATCH v5] runtime/dnf: Add new dnf test cases

2017-11-30 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/classes/testimage.bbclass | 11 ---
 meta/lib/oeqa/runtime/cases/dnf.py | 36 
 2 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 45bb2bda3b8..c1588da0fd8 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
 return None
 
 def create_rpm_index(d):
+import glob
 # Index RPMs
 rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
 index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
 lf = bb.utils.lockfile(lockfilename, False)
 oe.path.copyhardlinktree(rpm_dir, idx_path)
 # Full indexes overload a 256MB image so reduce the number of rpms
-# in the feed. Filter to r* since we use the run-postinst packages and
-# this leaves some allarch and machine arch packages too.
-bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+# in the feed by filtering to specific packages needed by the tests.
+package_list = glob.glob(idx_path + "*/*.rpm")
+
+for pkg in package_list:
+if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", 
"busybox", "bash", "update-alternatives", "libc6", "curl")):
+bb.utils.remove(pkg)
+
 bb.utils.unlockfile(lf)
 cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py 
b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e0..020e025de4e 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -120,4 +120,40 @@ class DnfRepoTest(DnfTest):
 def test_dnf_reinstall(self):
 self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
+@OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+@OETestID(1771)
+def test_dnf_installroot(self):
+rootpath = '/home/root/chroot/test'
+#Copy necessary files to avoid errors with not yet installed tools on
+#installroot directory.
+self.target.run('mkdir -p %s/etc' % rootpath, 1500)
+self.target.run('mkdir -p %s/bin' % rootpath, 1500)
+#Handle different architectures lib dirs
+self.target.run('mkdir -p %s/lib' % rootpath, 1500)
+self.target.run('mkdir -p %s/libx32' % rootpath, 1500)
+self.target.run('cp /lib/libtinfo.so.5 %s/lib' % rootpath, 1500)
+self.target.run('cp /libx32/libtinfo.so.5 %s/libx32' % rootpath, 1500)
+self.target.run('cp -r /etc/rpm %s/etc' % rootpath, 1500)
+self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500)
+self.target.run('cp /bin/sh %s/bin' % rootpath, 1500)
+self.dnf_with_repo('install --installroot=%s -v -y 
--rpmverbosity=debug busybox run-postinsts' % rootpath)
+status, output = self.target.run('test -e %s/var/cache/dnf' % 
rootpath, 1500)
+self.assertEqual(0, status, output)
+status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 
1500)
+self.assertEqual(0, status, output)
 
+@OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+@OETestID(1772)
+def test_dnf_exclude(self):
+excludepkg = 'curl-dev'
+self.dnf_with_repo('install -y curl*')
+self.dnf('list %s' % excludepkg, 0)
+#Avoid remove dependencies to skip some errors on different archs and 
images
+self.dnf_with_repo('remove --setopt=clean_requirements_on_remove=0 -y 
curl*')
+#check curl-dev is not installed adter removing all curl occurrences
+status, output = self.target.run('dnf list --installed | grep %s'% 
excludepkg, 1500)
+self.assertEqual(1, status, "%s was not removed,  is listed as 
installed"%excludepkg)
+self.dnf_with_repo('install -y --exclude=%s curl*' % excludepkg)
+#check curl-dev is not installed after being excluded
+status, output = self.target.run('dnf list --installed | grep %s'% 
excludepkg , 1500)
+self.assertEqual(1, status, "%s was not excluded, is listed as 
installed"%excludepkg)
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] lsb/lsbtests: Update package lists to use latest version of binary

2017-10-18 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Currently  package list is pointing to  "lsb-setup-4.1.0-1.noarch.rpm"
which is not available anymore on
http://ftp.linuxfoundation.org/pub/lsb/base/released-all/binary/ hence
BASE_PACKAGES_LIST is updated to point to the latest available version.

[YOCTO #12240]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/recipes-extended/lsb/lsbtest/packages_list | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-extended/lsb/lsbtest/packages_list 
b/meta/recipes-extended/lsb/lsbtest/packages_list
index 959f931504..1a6c11699a 100644
--- a/meta/recipes-extended/lsb/lsbtest/packages_list
+++ b/meta/recipes-extended/lsb/lsbtest/packages_list
@@ -1,7 +1,7 @@
 LSB_RELEASE="released-5.0"
 LSB_ARCH="lsbarch"
 
-BASE_PACKAGES_LIST="lsb-setup-4.1.0-1.noarch.rpm"
+BASE_PACKAGES_LIST="lsb-setup-5.0.0-2.noarch.rpm"
 
 RUNTIME_BASE_PACKAGES_LIST="lsb-dist-checker-5.0.0.1-1.targetarch.rpm \
lsb-tet3-lite-3.7-27.lsb5.targetarch.rpm \
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] selftest/devtool: Avoid writing on TOPDIR on kernel test case

2017-09-08 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Use a tempdir to copy the .config file from the kernel instead of being
copied to build directory.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/selftest/cases/devtool.py | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/meta/lib/oeqa/selftest/cases/devtool.py 
b/meta/lib/oeqa/selftest/cases/devtool.py
index c17131a56d..d5d09186f7 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -1654,7 +1654,9 @@ class DevtoolTests(DevtoolBase):
 # Clean up the enviroment
 bitbake('%s -c clean' % kernel_provider)
 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+tempdir_cfg = tempfile.mkdtemp(prefix='config_qa')
 self.track_for_cleanup(tempdir)
+self.track_for_cleanup(tempdir_cfg)
 self.track_for_cleanup(self.workspacedir)
 self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
 self.add_command_to_tearDown('bitbake -c clean %s' % kernel_provider)
@@ -1663,12 +1665,11 @@ class DevtoolTests(DevtoolBase):
 #time of executing this test case.
 bitbake('%s -c configure' % kernel_provider)
 bbconfig = os.path.join(get_bb_var('B', kernel_provider),'.config')
-buildir= get_bb_var('TOPDIR')
 #Step 2
-runCmd('cp %s %s' % (bbconfig, buildir))
-self.assertExists(os.path.join(buildir, '.config'), 'Could not copy 
.config file from kernel')
+runCmd('cp %s %s' % (bbconfig, tempdir_cfg))
+self.assertExists(os.path.join(tempdir_cfg, '.config'), 'Could not 
copy .config file from kernel')
 
-tmpconfig = os.path.join(buildir, '.config')
+tmpconfig = os.path.join(tempdir_cfg, '.config')
 #Step 3
 bitbake('%s -c clean' % kernel_provider)
 #Step 4.1
-- 
2.12.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] test_sdkext: Add support to execute suite with pre-built artifacts from Auto Builder

2017-09-04 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

testsdkest' suite is not working properly when using pre-built artifacts 
downloaded
from AutoBuilder, some updates are applied as follows:

- testsdk.bbclass: add functionally to override the .data.json file 
with
the paths of the host were the test are being executed instead of the the paths 
of
the Auto Builder.

- devtool.py: add support to install libxml2 from the source as AutoBuilder
artifacts have a minimal SDK tools and libraries.

[YOCTO #11963]

(From OE-Core rev: 7f10c5118793da6ded59ae6e60e796152dbd7ca3)

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/classes/testsdk.bbclass  | 25 +
 meta/lib/oeqa/sdkext/cases/devtool.py |  2 +-
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/meta/classes/testsdk.bbclass b/meta/classes/testsdk.bbclass
index 6b51a33db2..2d803e5202 100644
--- a/meta/classes/testsdk.bbclass
+++ b/meta/classes/testsdk.bbclass
@@ -14,6 +14,9 @@
 #
 # where "" is an image like core-image-sato.
 
+
+TESTSDK_UPDATE_VARS ?= "DL_DIR WORKDIR DEPLOY_DIR SDK_DEPLOY COMPONENTS_DIR 
TOOLCHAINEXT_OUTPUTNAME PKGDATA_DIR"
+
 def testsdk_main(d):
 import os
 import subprocess
@@ -92,6 +95,7 @@ do_testsdk[nostamp] = "1"
 def testsdkext_main(d):
 import os
 import json
+from oeqa.core.utils.misc import updateTestData
 import subprocess
 import logging
 
@@ -99,6 +103,21 @@ def testsdkext_main(d):
 from oeqa.utils import avoid_paths_in_environ, 
make_logger_bitbake_compatible, subprocesstweak
 from oeqa.sdkext.context import OESDKExtTestContext, 
OESDKExtTestContextExecutor
 
+toolchain_name = ("%s/%s" % (d.getVar('SDK_DEPLOY'),
+ d.getVar('TOOLCHAINEXT_OUTPUTNAME')))
+
+tdname = "%s.testdata.json" % toolchain_name
+
+try:
+test_data = json.load(open(tdname, "r"))
+except (FileNotFoundError) as err:
+bb.fatal('File %s Not Found. Have you built the image with 
INHERIT+="testsdkext" ' \
+ 'in the conf/local.conf or downlaoded the pre-built from the 
AB?' % tdname)
+
+# Some variables need to be updated (mostly paths) with the
+# ones of the current environment because some tests use them.
+updateTestData(d, test_data, d.getVar('TESTSDK_UPDATE_VARS').split())
+
 bb.event.enable_threadlock()
 
 pn = d.getVar("PN")
@@ -118,10 +137,8 @@ def testsdkext_main(d):
 tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.sh")
 if not os.path.exists(tcname):
 bb.fatal("The toolchain ext %s is not built. Build it before running 
the" \
- " tests: 'bitbake  -c populate_sdk_ext' ." % tcname)
-
-tdname = d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.testdata.json")
-test_data = json.load(open(tdname, "r"))
+ " tests: 'bitbake  -c populate_sdk_ext' . or donwload 
the" \
+ " pre-built form the AB" % tcname)
 
 target_pkg_manifest = OESDKExtTestContextExecutor._load_manifest(
 d.expand("${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest"))
diff --git a/meta/lib/oeqa/sdkext/cases/devtool.py 
b/meta/lib/oeqa/sdkext/cases/devtool.py
index ea9051710a..857628cef8 100644
--- a/meta/lib/oeqa/sdkext/cases/devtool.py
+++ b/meta/lib/oeqa/sdkext/cases/devtool.py
@@ -70,7 +70,7 @@ class DevtoolTest(OESDKExtTestCase):
 def test_extend_autotools_recipe_creation(self):
 req = 'https://github.com/rdfa/librdfa'
 recipe = "librdfa"
-self._run('devtool sdk-install libxml2')
+self._run('devtool sdk-install -s libxml2')
 self._run('devtool add %s %s' % (recipe, req) )
 try:
 self._run('devtool build %s' % recipe)
-- 
2.12.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] oeqa/selftest: Add missing IDs to various test cases

2017-09-01 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add decorator @OETestID() with Tesopia TC-ID to the test cases
that did not have it properly set.

[YOCTO #11873]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/selftest/cases/archiver.py  |  3 ++-
 meta/lib/oeqa/selftest/cases/distrodata.py|  2 ++
 meta/lib/oeqa/selftest/cases/imagefeatures.py |  3 +++
 meta/lib/oeqa/selftest/cases/runcmd.py| 17 +
 meta/lib/oeqa/selftest/cases/wic.py   |  1 +
 5 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/cases/archiver.py 
b/meta/lib/oeqa/selftest/cases/archiver.py
index 72026d573c..f61a522017 100644
--- a/meta/lib/oeqa/selftest/cases/archiver.py
+++ b/meta/lib/oeqa/selftest/cases/archiver.py
@@ -40,7 +40,7 @@ class Archiver(OESelftestTestCase):
 excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe))
 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % 
exclude_recipe)
 
-
+@OETestID(1900)
 def test_archiver_filters_by_type(self):
 """
 Summary: The archiver is documented to filter on the recipe type.
@@ -73,6 +73,7 @@ class Archiver(OESelftestTestCase):
 excluded_present = len(glob.glob(src_path_native + '/%s-*' % 
native_recipe))
 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % 
native_recipe)
 
+@OETestID(1901)
 def test_archiver_filters_by_type_and_name(self):
 """
 Summary: Test that the archiver archives by recipe type, taking the
diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py 
b/meta/lib/oeqa/selftest/cases/distrodata.py
index ecb15d9aea..12540adc7d 100644
--- a/meta/lib/oeqa/selftest/cases/distrodata.py
+++ b/meta/lib/oeqa/selftest/cases/distrodata.py
@@ -2,6 +2,7 @@ from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
 from oeqa.utils.decorators import testcase
 from oeqa.utils.ftools import write_file
+from oeqa.core.decorator.oeid import OETestID
 
 class Distrodata(OESelftestTestCase):
 
@@ -9,6 +10,7 @@ class Distrodata(OESelftestTestCase):
 def setUpClass(cls):
 super(Distrodata, cls).setUpClass()
 
+@OETestID(1902)
 def test_checkpkg(self):
 """
 Summary: Test that upstream version checks do not regress
diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py 
b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index bb2e0dba4c..1a850008ef 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -131,6 +131,7 @@ class ImageFeatures(OESelftestTestCase):
 # check if the resulting gzip is valid
 self.assertTrue(runCmd('gzip -t %s' % gzip_path))
 
+@OETestID(1903)
 def test_hypervisor_fmts(self):
 """
 Summary: Check various hypervisor formats
@@ -165,6 +166,7 @@ class ImageFeatures(OESelftestTestCase):
 native_sysroot=sysroot)
 self.assertTrue(json.loads(result.output).get('format') == itype)
 
+@OETestID(1905)
 def test_long_chain_conversion(self):
 """
 Summary: Check for chaining many CONVERSION_CMDs together
@@ -196,6 +198,7 @@ class ImageFeatures(OESelftestTestCase):
 self.assertTrue(runCmd('cd %s;sha256sum -c %s.%s.sha256sum' %
(deploy_dir_image, link_name, conv)))
 
+@OETestID(1904)
 def test_image_fstypes(self):
 """
 Summary: Check if image of supported image fstypes can be built
diff --git a/meta/lib/oeqa/selftest/cases/runcmd.py 
b/meta/lib/oeqa/selftest/cases/runcmd.py
index 6c785caadc..d76d7063c6 100644
--- a/meta/lib/oeqa/selftest/cases/runcmd.py
+++ b/meta/lib/oeqa/selftest/cases/runcmd.py
@@ -1,6 +1,7 @@
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import runCmd
 from oeqa.utils import CommandError
+from oeqa.core.decorator.oeid import OETestID
 
 import subprocess
 import threading
@@ -26,49 +27,60 @@ class RunCmdTests(OESelftestTestCase):
 TIMEOUT = 2
 DELTA = 1
 
+@OETestID(1916)
 def test_result_okay(self):
 result = runCmd("true")
 self.assertEqual(result.status, 0)
 
+@OETestID(1915)
 def test_result_false(self):
 result = runCmd("false", ignore_status=True)
 self.assertEqual(result.status, 1)
 
+@OETestID(1917)
 def test_shell(self):
 # A shell is used for all string commands.
 result = runCmd("false; true", ignore_status=True)
 self.assertEqual(result.status, 0)
 
+@OETestID(1910)
 def test_no_shell(self):
 self.assertRaises(FileNotFoundError,
   runCmd,

[OE-core] [PATCH] oeqa/selftest: Add missing IDs to various test cases

2017-09-01 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add decorator @OETestID() with Tesopia TC-ID to the test cases
that did not have it properly set.

[YOCTO #11873]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/selftest/cases/archiver.py  |  3 ++-
 meta/lib/oeqa/selftest/cases/distrodata.py|  2 ++
 meta/lib/oeqa/selftest/cases/imagefeatures.py |  3 +++
 meta/lib/oeqa/selftest/cases/runcmd.py| 17 +
 meta/lib/oeqa/selftest/cases/wic.py   |  1 +
 5 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/cases/archiver.py 
b/meta/lib/oeqa/selftest/cases/archiver.py
index 72026d573c..f61a522017 100644
--- a/meta/lib/oeqa/selftest/cases/archiver.py
+++ b/meta/lib/oeqa/selftest/cases/archiver.py
@@ -40,7 +40,7 @@ class Archiver(OESelftestTestCase):
 excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe))
 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % 
exclude_recipe)
 
-
+@OETestID(1900)
 def test_archiver_filters_by_type(self):
 """
 Summary: The archiver is documented to filter on the recipe type.
@@ -73,6 +73,7 @@ class Archiver(OESelftestTestCase):
 excluded_present = len(glob.glob(src_path_native + '/%s-*' % 
native_recipe))
 self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % 
native_recipe)
 
+@OETestID(1901)
 def test_archiver_filters_by_type_and_name(self):
 """
 Summary: Test that the archiver archives by recipe type, taking the
diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py 
b/meta/lib/oeqa/selftest/cases/distrodata.py
index d5d286d5cc..bcbcfb4f63 100644
--- a/meta/lib/oeqa/selftest/cases/distrodata.py
+++ b/meta/lib/oeqa/selftest/cases/distrodata.py
@@ -2,6 +2,7 @@ from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
 from oeqa.utils.decorators import testcase
 from oeqa.utils.ftools import write_file
+from oeqa.core.decorator.oeid import OETestID
 
 class Distrodata(OESelftestTestCase):
 
@@ -10,6 +11,7 @@ class Distrodata(OESelftestTestCase):
 super(Distrodata, cls).setUpClass()
 cls.exceptions_path = os.path.join(cls.testlayer_path, 'files', 
'distrodata', "checkpkg_exceptions")
 
+@OETestID(1902)
 def test_checkpkg(self):
 """
 Summary: Test that upstream version checks do not regress
diff --git a/meta/lib/oeqa/selftest/cases/imagefeatures.py 
b/meta/lib/oeqa/selftest/cases/imagefeatures.py
index bb2e0dba4c..1a850008ef 100644
--- a/meta/lib/oeqa/selftest/cases/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/cases/imagefeatures.py
@@ -131,6 +131,7 @@ class ImageFeatures(OESelftestTestCase):
 # check if the resulting gzip is valid
 self.assertTrue(runCmd('gzip -t %s' % gzip_path))
 
+@OETestID(1903)
 def test_hypervisor_fmts(self):
 """
 Summary: Check various hypervisor formats
@@ -165,6 +166,7 @@ class ImageFeatures(OESelftestTestCase):
 native_sysroot=sysroot)
 self.assertTrue(json.loads(result.output).get('format') == itype)
 
+@OETestID(1905)
 def test_long_chain_conversion(self):
 """
 Summary: Check for chaining many CONVERSION_CMDs together
@@ -196,6 +198,7 @@ class ImageFeatures(OESelftestTestCase):
 self.assertTrue(runCmd('cd %s;sha256sum -c %s.%s.sha256sum' %
(deploy_dir_image, link_name, conv)))
 
+@OETestID(1904)
 def test_image_fstypes(self):
 """
 Summary: Check if image of supported image fstypes can be built
diff --git a/meta/lib/oeqa/selftest/cases/runcmd.py 
b/meta/lib/oeqa/selftest/cases/runcmd.py
index 6c785caadc..d76d7063c6 100644
--- a/meta/lib/oeqa/selftest/cases/runcmd.py
+++ b/meta/lib/oeqa/selftest/cases/runcmd.py
@@ -1,6 +1,7 @@
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import runCmd
 from oeqa.utils import CommandError
+from oeqa.core.decorator.oeid import OETestID
 
 import subprocess
 import threading
@@ -26,49 +27,60 @@ class RunCmdTests(OESelftestTestCase):
 TIMEOUT = 2
 DELTA = 1
 
+@OETestID(1916)
 def test_result_okay(self):
 result = runCmd("true")
 self.assertEqual(result.status, 0)
 
+@OETestID(1915)
 def test_result_false(self):
 result = runCmd("false", ignore_status=True)
 self.assertEqual(result.status, 1)
 
+@OETestID(1917)
 def test_shell(self):
 # A shell is used for all string commands.
 result = runCmd("false; true", ignore_status=True)
 self.assertEqual(result.status, 0)
 
+@OETestID(1910)
 def test_no_shell(self)

[OE-core] [PATCH v2] oeqa/buildperf: Add 'bitbake -m' on sync function to ensure bitbake is unloaded

2017-07-25 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add 'bitbake -m' to the sync method and ensure all process related to
bitbake are correctly unloaded before doing the different measurements.
Also add a call to sync funtion on Test4 before final measurment of
eSDK deploy dir disk usage.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/buildperf/base.py   | 1 +
 meta/lib/oeqa/buildperf/test_basic.py | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index 6e62b279c1..7b2b4aa2a4 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -485,6 +485,7 @@ class BuildPerfTestCase(unittest.TestCase):
 @staticmethod
 def sync():
 """Sync and drop kernel caches"""
+runCmd2('bitbake -m', ignore_status=True)
 log.debug("Syncing and dropping kernel caches""")
 KernelDropCaches.drop()
 os.sync()
diff --git a/meta/lib/oeqa/buildperf/test_basic.py 
b/meta/lib/oeqa/buildperf/test_basic.py
index a9e4a5b731..a19089a6ed 100644
--- a/meta/lib/oeqa/buildperf/test_basic.py
+++ b/meta/lib/oeqa/buildperf/test_basic.py
@@ -121,5 +121,7 @@ class Test4(BuildPerfTestCase):
 self.sync()
 self.measure_cmd_resources([installer, '-y', '-d', deploy_dir],
'deploy', 'eSDK deploy')
+#make sure bitbake is unloaded
+self.sync()
 self.measure_disk_usage(deploy_dir, 'deploy_dir', 'deploy dir',
 apparent_size=True)
-- 
2.12.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] oeqa/buildperf: Add 'bitbake -m' on sync function to ensure bitbake is unloaded

2017-07-25 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add 'bitbake -m' to the sync method and ensure all process related to
bitbake are correctly unloaded before doing the different measurements.
Also add a call to sync funtion on Test4 before final measurment of
eSDK deploy dir disk usage.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/buildperf/base.py   | 1 +
 meta/lib/oeqa/buildperf/test_basic.py | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index 6e62b279c1..7b2b4aa2a4 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -485,6 +485,7 @@ class BuildPerfTestCase(unittest.TestCase):
 @staticmethod
 def sync():
 """Sync and drop kernel caches"""
+runCmd2('bitbake -m', ignore_status=True)
 log.debug("Syncing and dropping kernel caches""")
 KernelDropCaches.drop()
 os.sync()
diff --git a/meta/lib/oeqa/buildperf/test_basic.py 
b/meta/lib/oeqa/buildperf/test_basic.py
index a9e4a5b731..0033ee4815 100644
--- a/meta/lib/oeqa/buildperf/test_basic.py
+++ b/meta/lib/oeqa/buildperf/test_basic.py
@@ -121,5 +121,7 @@ class Test4(BuildPerfTestCase):
 self.sync()
 self.measure_cmd_resources([installer, '-y', '-d', deploy_dir],
'deploy', 'eSDK deploy')
+#make sure bitbake is unloaded
+#self.sync()
 self.measure_disk_usage(deploy_dir, 'deploy_dir', 'deploy dir',
 apparent_size=True)
-- 
2.12.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] buildperf/tests_basics: sync the system to have clean esdk deploy dir

2017-07-25 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

In some cases and depending on the resources measurement of disk usage
for eSDK deploy dir is failing due “measure_disk_usage” was locking for
tmp files (bitbake.lock and bitbake.sock) that were not deleted on time,
this can be avoided by a sync on the system to allow all process to be
finished on time and ensuring esdk deploy dir is clean.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/buildperf/test_basic.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/lib/oeqa/buildperf/test_basic.py 
b/meta/lib/oeqa/buildperf/test_basic.py
index a9e4a5b731..92197878af 100644
--- a/meta/lib/oeqa/buildperf/test_basic.py
+++ b/meta/lib/oeqa/buildperf/test_basic.py
@@ -121,5 +121,7 @@ class Test4(BuildPerfTestCase):
 self.sync()
 self.measure_cmd_resources([installer, '-y', '-d', deploy_dir],
'deploy', 'eSDK deploy')
+#sync before the final disk usage measurement
+self.sync()
 self.measure_disk_usage(deploy_dir, 'deploy_dir', 'deploy dir',
 apparent_size=True)
-- 
2.12.3

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 22/22] testimage: Use the renamed buildlzip

2017-07-06 Thread Jose Perez Carranza



On 07/06/2017 09:33 AM, Khem Raj wrote:

buildiptables has been replaced with buildlzip

Signed-off-by: Khem Raj 
---
  meta/classes/testimage.bbclass | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 6fa2d6fd9f..0c4a84e111 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -49,10 +49,10 @@ DEFAULT_TEST_SUITES_pn-core-image-x11 = "${MINTESTSUITE}"
  DEFAULT_TEST_SUITES_pn-core-image-lsb = "${NETTESTSUITE} pam parselogs 
${RPMTESTSUITE}"
  DEFAULT_TEST_SUITES_pn-core-image-sato = "${NETTESTSUITE} connman xorg 
parselogs ${RPMTESTSUITE} \
  ${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python', '', d)}"
-DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} buildcpio 
buildiptables buildgalculator \
+DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} buildcpio 
buildlzip buildgalculator \
  connman ${DEVTESTSUITE} logrotate perl parselogs python ${RPMTESTSUITE} 
xorg"
  DEFAULT_TEST_SUITES_pn-core-image-lsb-dev = "${NETTESTSUITE} pam perl python 
parselogs ${RPMTESTSUITE}"
-DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcpio 
buildiptables buildgalculator \
+DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcpio 
buildlzip buildgalculator \
  connman ${DEVTESTSUITE} logrotate pam parselogs perl python 
${RPMTESTSUITE}"
  DEFAULT_TEST_SUITES_pn-meta-toolchain = "auto"
  
@@ -61,7 +61,7 @@ DEFAULT_TEST_SUITES_remove_aarch64 = "xorg"
  
  # qemumips is quite slow and has reached the timeout limit several times on the YP build cluster,

  # mitigate this by removing build tests for qemumips machines.
-MIPSREMOVE ??= "buildcpio buildiptables buildgalculator"
+MIPSREMOVE ??= "buildcpio buildlzip buildgalculator"
  DEFAULT_TEST_SUITES_remove_qemumips = "${MIPSREMOVE}"
  DEFAULT_TEST_SUITES_remove_qemumips64 = "${MIPSREMOVE}"
  
I sent a series including this patch and the complement to fully apply 
changes for runtime tests


https://patchwork.openembedded.org/series/7615/

--
Saludos
José

--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 1/2] oeqa/runtime: Replace buildiptables for buildlzip on runtime tests

2017-07-06 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Buildiptables test cases are conflicting with images built with “musl”
as standard C library, in order to avoid those issues lzip package was
selected to be used on the tests as this does not have any "musl"
dependency.

This patch is applicable for testimage tests

[YOCTO # 11713]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/runtime/cases/{buildiptables.py => buildlzip.py} | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
 rename meta/lib/oeqa/runtime/cases/{buildiptables.py => buildlzip.py} (89%)

diff --git a/meta/lib/oeqa/runtime/cases/buildiptables.py 
b/meta/lib/oeqa/runtime/cases/buildlzip.py
similarity index 89%
rename from meta/lib/oeqa/runtime/cases/buildiptables.py
rename to meta/lib/oeqa/runtime/cases/buildlzip.py
index 002b16c4835..ca3fead2e49 100644
--- a/meta/lib/oeqa/runtime/cases/buildiptables.py
+++ b/meta/lib/oeqa/runtime/cases/buildlzip.py
@@ -5,12 +5,12 @@ from oeqa.core.decorator.data import skipIfNotFeature
 
 from oeqa.runtime.utils.targetbuildproject import TargetBuildProject
 
-class BuildIptablesTest(OERuntimeTestCase):
+class BuildLzipTest(OERuntimeTestCase):
 
 @classmethod
 def setUpClass(cls):
 uri = 'http://downloads.yoctoproject.org/mirror/sources'
-uri = '%s/iptables-1.4.13.tar.bz2' % uri
+uri = '%s/lzip-1.19.tar.gz' % uri
 cls.project = TargetBuildProject(cls.tc.target,
  uri,
  dl_dir = cls.tc.td['DL_DIR'])
@@ -24,7 +24,7 @@ class BuildIptablesTest(OERuntimeTestCase):
 @skipIfNotFeature('tools-sdk',
   'Test requires tools-sdk to be in IMAGE_FEATURES')
 @OETestDepends(['ssh.SSHTest.test_ssh'])
-def test_iptables(self):
+def test_lzip(self):
 self.project.run_configure()
 self.project.run_make()
 self.project.run_install()
-- 
2.12.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/2] testimage: Use the renamed buildlzip

2017-07-06 Thread jose . perez . carranza
From: Khem Raj 

buildiptables has been replaced with buildlzip

Signed-off-by: Khem Raj 
---
 meta/classes/testimage.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 6fa2d6fd9f4..0c4a84e1119 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -49,10 +49,10 @@ DEFAULT_TEST_SUITES_pn-core-image-x11 = "${MINTESTSUITE}"
 DEFAULT_TEST_SUITES_pn-core-image-lsb = "${NETTESTSUITE} pam parselogs 
${RPMTESTSUITE}"
 DEFAULT_TEST_SUITES_pn-core-image-sato = "${NETTESTSUITE} connman xorg 
parselogs ${RPMTESTSUITE} \
 ${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python', '', d)}"
-DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} buildcpio 
buildiptables buildgalculator \
+DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} buildcpio 
buildlzip buildgalculator \
 connman ${DEVTESTSUITE} logrotate perl parselogs python ${RPMTESTSUITE} 
xorg"
 DEFAULT_TEST_SUITES_pn-core-image-lsb-dev = "${NETTESTSUITE} pam perl python 
parselogs ${RPMTESTSUITE}"
-DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcpio 
buildiptables buildgalculator \
+DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcpio 
buildlzip buildgalculator \
 connman ${DEVTESTSUITE} logrotate pam parselogs perl python 
${RPMTESTSUITE}"
 DEFAULT_TEST_SUITES_pn-meta-toolchain = "auto"
 
@@ -61,7 +61,7 @@ DEFAULT_TEST_SUITES_remove_aarch64 = "xorg"
 
 # qemumips is quite slow and has reached the timeout limit several times on 
the YP build cluster,
 # mitigate this by removing build tests for qemumips machines.
-MIPSREMOVE ??= "buildcpio buildiptables buildgalculator"
+MIPSREMOVE ??= "buildcpio buildlzip buildgalculator"
 DEFAULT_TEST_SUITES_remove_qemumips = "${MIPSREMOVE}"
 DEFAULT_TEST_SUITES_remove_qemumips64 = "${MIPSREMOVE}"
 
-- 
2.12.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 0/2] Add lzip test instead of iptables for runtime

2017-07-06 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

This series is created to replace iptables tests for lzip test and avoid 
conflicts with images built with “musl”. A two separate patches were sent 
before related to this, one for SDK [1] and other one to add changes to 
testimage.bbclass[2], the second one itself doe not works, hence in this series 
the second patch is included and also the complement fully apply the test on 
runtime.

Patch [1] is still applicable and does not conflicts with this series.

  1-  https://patchwork.openembedded.org/patch/141496/
  2-  https://patchwork.openembedded.org/patch/141620/

The following changes since commit 754c03006943a219ffd417c36ab909b464f57f67:

  local.conf.sample: drop image-swab reference (2017-07-06 15:03:10 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib jperez/bug11713
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=jperez/bug11713

Jose Perez Carranza (1):
  oeqa/runtime: Replace buildiptables for buildlzip on runtime tests

Khem Raj (1):
  testimage: Use the renamed buildlzip

 meta/classes/testimage.bbclass | 6 +++---
 meta/lib/oeqa/runtime/cases/{buildiptables.py => buildlzip.py} | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
 rename meta/lib/oeqa/runtime/cases/{buildiptables.py => buildlzip.py} (89%)

-- 
2.12.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 22/22] testimage: Use the renamed buildlzip

2017-07-06 Thread Jose Perez Carranza



On 07/06/2017 10:40 AM, Khem Raj wrote:

On Thu, Jul 6, 2017 at 8:34 AM, Jose Perez Carranza
<jose.perez.carra...@linux.intel.com> wrote:

On 07/06/2017 09:33 AM, Khem Raj wrote:

buildiptables has been replaced with buildlzip

Signed-off-by: Khem Raj <raj.k...@gmail.com>
---
   meta/classes/testimage.bbclass | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/testimage.bbclass
b/meta/classes/testimage.bbclass
index 6fa2d6fd9f..0c4a84e111 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -49,10 +49,10 @@ DEFAULT_TEST_SUITES_pn-core-image-x11 =
"${MINTESTSUITE}"
   DEFAULT_TEST_SUITES_pn-core-image-lsb = "${NETTESTSUITE} pam parselogs
${RPMTESTSUITE}"
   DEFAULT_TEST_SUITES_pn-core-image-sato = "${NETTESTSUITE} connman xorg
parselogs ${RPMTESTSUITE} \
   ${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python', '', d)}"
-DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} buildcpio
buildiptables buildgalculator \
+DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} buildcpio
buildlzip buildgalculator \
   connman ${DEVTESTSUITE} logrotate perl parselogs python
${RPMTESTSUITE} xorg"
   DEFAULT_TEST_SUITES_pn-core-image-lsb-dev = "${NETTESTSUITE} pam perl
python parselogs ${RPMTESTSUITE}"
-DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcpio
buildiptables buildgalculator \
+DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcpio
buildlzip buildgalculator \
   connman ${DEVTESTSUITE} logrotate pam parselogs perl python
${RPMTESTSUITE}"
   DEFAULT_TEST_SUITES_pn-meta-toolchain = "auto"
   @@ -61,7 +61,7 @@ DEFAULT_TEST_SUITES_remove_aarch64 = "xorg"
 # qemumips is quite slow and has reached the timeout limit several
times on the YP build cluster,
   # mitigate this by removing build tests for qemumips machines.
-MIPSREMOVE ??= "buildcpio buildiptables buildgalculator"
+MIPSREMOVE ??= "buildcpio buildlzip buildgalculator"
   DEFAULT_TEST_SUITES_remove_qemumips = "${MIPSREMOVE}"
   DEFAULT_TEST_SUITES_remove_qemumips64 = "${MIPSREMOVE}"


I think this patch is not applicable as for runtime tests
(meta/lib/oeqa/runtime/cases/) we do actually use buildiptables test, for
sdk test there are not filters so in the case of using "testsdk" all the
available test under meta/lib/oeqa/sdk/cases should be executed.


Thats fine, send a followup. Without this patch I was still seeing
that bitbake -ctestimage  would not execute the new test and
looking for old test.
The new test is only applicable to sdk test, to execute this tests 
"bitbake -c testsdk " should be used an this actually executes 
new lzip tests, on the bug 11713 is tatetd tht the problems are in 
sdl/cases/iptables, are you also having issues on the 
"runtime/cases/buildiptables"? if that is the case please add a comment 
on the bug as this will need some more effort.

"
As can be seen the patch is just a rename the occurrences of old test
with new test.


--
Saludos
José



--
Saludos
José

--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 22/22] testimage: Use the renamed buildlzip

2017-07-06 Thread Jose Perez Carranza


On 07/06/2017 09:33 AM, Khem Raj wrote:

buildiptables has been replaced with buildlzip

Signed-off-by: Khem Raj 
---
  meta/classes/testimage.bbclass | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 6fa2d6fd9f..0c4a84e111 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -49,10 +49,10 @@ DEFAULT_TEST_SUITES_pn-core-image-x11 = "${MINTESTSUITE}"
  DEFAULT_TEST_SUITES_pn-core-image-lsb = "${NETTESTSUITE} pam parselogs 
${RPMTESTSUITE}"
  DEFAULT_TEST_SUITES_pn-core-image-sato = "${NETTESTSUITE} connman xorg 
parselogs ${RPMTESTSUITE} \
  ${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python', '', d)}"
-DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} buildcpio 
buildiptables buildgalculator \
+DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "${NETTESTSUITE} buildcpio 
buildlzip buildgalculator \
  connman ${DEVTESTSUITE} logrotate perl parselogs python ${RPMTESTSUITE} 
xorg"
  DEFAULT_TEST_SUITES_pn-core-image-lsb-dev = "${NETTESTSUITE} pam perl python 
parselogs ${RPMTESTSUITE}"
-DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcpio 
buildiptables buildgalculator \
+DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "${NETTESTSUITE} buildcpio 
buildlzip buildgalculator \
  connman ${DEVTESTSUITE} logrotate pam parselogs perl python 
${RPMTESTSUITE}"
  DEFAULT_TEST_SUITES_pn-meta-toolchain = "auto"
  
@@ -61,7 +61,7 @@ DEFAULT_TEST_SUITES_remove_aarch64 = "xorg"
  
  # qemumips is quite slow and has reached the timeout limit several times on the YP build cluster,

  # mitigate this by removing build tests for qemumips machines.
-MIPSREMOVE ??= "buildcpio buildiptables buildgalculator"
+MIPSREMOVE ??= "buildcpio buildlzip buildgalculator"
  DEFAULT_TEST_SUITES_remove_qemumips = "${MIPSREMOVE}"
  DEFAULT_TEST_SUITES_remove_qemumips64 = "${MIPSREMOVE}"
  
I think this patch is not applicable as for runtime tests 
(meta/lib/oeqa/runtime/cases/) we do actually use buildiptables test, 
for sdk test there are not filters so in the case of using "testsdk" all 
the available test under meta/lib/oeqa/sdk/cases should be executed.


--
Saludos
José

--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] oeqa/sdk: Replace buildiptables for buildlzip tests

2017-07-03 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Buildiptables test cases are conflicting with images built with “musl”
as standard C library, in order to avoid those issues lzip package was
selected to be used on the tests as this does not have any "musl"
dependency.

[YOCTO #11713]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/sdk/cases/{buildiptables.py => buildlzip.py} | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
 rename meta/lib/oeqa/sdk/cases/{buildiptables.py => buildlzip.py} (84%)

diff --git a/meta/lib/oeqa/sdk/cases/buildiptables.py 
b/meta/lib/oeqa/sdk/cases/buildlzip.py
similarity index 84%
rename from meta/lib/oeqa/sdk/cases/buildiptables.py
rename to meta/lib/oeqa/sdk/cases/buildlzip.py
index 419c7ebd09b..3a89ce86276 100644
--- a/meta/lib/oeqa/sdk/cases/buildiptables.py
+++ b/meta/lib/oeqa/sdk/cases/buildlzip.py
@@ -3,15 +3,15 @@ from oeqa.sdk.case import OESDKTestCase
 from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
 
 
-class BuildIptablesTest(OESDKTestCase):
+class BuildLzipTest(OESDKTestCase):
 td_vars = ['DATETIME']
 
 @classmethod
 def setUpClass(self):
 dl_dir = self.td.get('DL_DIR', None)
 
-self.project = SDKBuildProject(self.tc.sdk_dir + "/iptables/", 
self.tc.sdk_env, 
-
"http://downloads.yoctoproject.org/mirror/sources/iptables-1.4.13.tar.bz2;,
+self.project = SDKBuildProject(self.tc.sdk_dir + "/lzip/", 
self.tc.sdk_env,
+
"http://downloads.yoctoproject.org/mirror/sources/lzip-1.19.tar.gz;,
 self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
 self.project.download_archive()
 
@@ -21,7 +21,7 @@ class BuildIptablesTest(OESDKTestCase):
 self.tc.hasTargetPackage("gcc")):
 raise unittest.SkipTest("SDK doesn't contain a cross-canadian 
toolchain")
 
-def test_iptables(self):
+def test_lzip(self):
 self.assertEqual(self.project.run_configure(), 0,
 msg="Running configure failed")
 
-- 
2.12.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] oeqa/sdk: Replace buildiptables for buildgzip tests

2017-07-03 Thread Jose Perez Carranza

On 07/03/2017 11:59 AM, Khem Raj wrote:

On Mon, Jul 3, 2017 at 9:26 AM,  <jose.perez.carra...@linux.intel.com> wrote:

From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Buildiptables test cases are conflicting with images built with “musl”
as standard C library, in order to avoid those issues gzip package was
selected to be used on the tests as this does not conflicts with “musl”.

[YOCTO #11713]

I see that gzip recipes also have musl appends for do_configure, I
understand, that this test case will compile on device so it will get
hosted env and it might be working fine. I would think it will be good
to use a package which we dont patch even in OE
I did some test also suing "Lzip", I did not see any reference to "musl" 
on that recipe, did you see any problem using "lzip"instead "gzip"?


Regards
José



Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
  meta/lib/oeqa/sdk/cases/{buildiptables.py => buildgzip.py} | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)
  rename meta/lib/oeqa/sdk/cases/{buildiptables.py => buildgzip.py} (84%)

diff --git a/meta/lib/oeqa/sdk/cases/buildiptables.py 
b/meta/lib/oeqa/sdk/cases/buildgzip.py
similarity index 84%
rename from meta/lib/oeqa/sdk/cases/buildiptables.py
rename to meta/lib/oeqa/sdk/cases/buildgzip.py
index 419c7ebd09b..a92df65c28b 100644
--- a/meta/lib/oeqa/sdk/cases/buildiptables.py
+++ b/meta/lib/oeqa/sdk/cases/buildgzip.py
@@ -3,15 +3,15 @@ from oeqa.sdk.case import OESDKTestCase
  from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject


-class BuildIptablesTest(OESDKTestCase):
+class BuildGzipTest(OESDKTestCase):
  td_vars = ['DATETIME']

  @classmethod
  def setUpClass(self):
  dl_dir = self.td.get('DL_DIR', None)

-self.project = SDKBuildProject(self.tc.sdk_dir + "/iptables/", 
self.tc.sdk_env,
-
"http://downloads.yoctoproject.org/mirror/sources/iptables-1.4.13.tar.bz2;,
+self.project = SDKBuildProject(self.tc.sdk_dir + "/gzip/", 
self.tc.sdk_env,
+
"http://downloads.yoctoproject.org/mirror/sources/gzip-1.8.tar.gz;,
  self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
  self.project.download_archive()

@@ -21,7 +21,7 @@ class BuildIptablesTest(OESDKTestCase):
  self.tc.hasTargetPackage("gcc")):
  raise unittest.SkipTest("SDK doesn't contain a cross-canadian 
toolchain")

-def test_iptables(self):
+def test_gzip(self):
  self.assertEqual(self.project.run_configure(), 0,
  msg="Running configure failed")

--
2.12.0



--
Saludos
José

--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] oeqa/sdk: Replace buildiptables for buildgzip tests

2017-07-03 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Buildiptables test cases are conflicting with images built with “musl”
as standard C library, in order to avoid those issues gzip package was
selected to be used on the tests as this does not conflicts with “musl”.

[YOCTO #11713]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/sdk/cases/{buildiptables.py => buildgzip.py} | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
 rename meta/lib/oeqa/sdk/cases/{buildiptables.py => buildgzip.py} (84%)

diff --git a/meta/lib/oeqa/sdk/cases/buildiptables.py 
b/meta/lib/oeqa/sdk/cases/buildgzip.py
similarity index 84%
rename from meta/lib/oeqa/sdk/cases/buildiptables.py
rename to meta/lib/oeqa/sdk/cases/buildgzip.py
index 419c7ebd09b..a92df65c28b 100644
--- a/meta/lib/oeqa/sdk/cases/buildiptables.py
+++ b/meta/lib/oeqa/sdk/cases/buildgzip.py
@@ -3,15 +3,15 @@ from oeqa.sdk.case import OESDKTestCase
 from oeqa.sdk.utils.sdkbuildproject import SDKBuildProject
 
 
-class BuildIptablesTest(OESDKTestCase):
+class BuildGzipTest(OESDKTestCase):
 td_vars = ['DATETIME']
 
 @classmethod
 def setUpClass(self):
 dl_dir = self.td.get('DL_DIR', None)
 
-self.project = SDKBuildProject(self.tc.sdk_dir + "/iptables/", 
self.tc.sdk_env, 
-
"http://downloads.yoctoproject.org/mirror/sources/iptables-1.4.13.tar.bz2;,
+self.project = SDKBuildProject(self.tc.sdk_dir + "/gzip/", 
self.tc.sdk_env,
+
"http://downloads.yoctoproject.org/mirror/sources/gzip-1.8.tar.gz;,
 self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
 self.project.download_archive()
 
@@ -21,7 +21,7 @@ class BuildIptablesTest(OESDKTestCase):
 self.tc.hasTargetPackage("gcc")):
 raise unittest.SkipTest("SDK doesn't contain a cross-canadian 
toolchain")
 
-def test_iptables(self):
+def test_gzip(self):
 self.assertEqual(self.project.run_configure(), 0,
 msg="Running configure failed")
 
-- 
2.12.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] selftest/bbtests: Create test case to verify bberror/waring

2017-06-30 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Create test case that uses “crasher.bbclass” to generate some warnings
and errors and verify that are correctly displayed on log.

[YOCTO #9949]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta-selftest/classes/crasher.bbclass   | 37 +++
 meta/lib/oeqa/selftest/cases/bbtests.py | 80 +
 2 files changed, 117 insertions(+)
 create mode 100644 meta-selftest/classes/crasher.bbclass

diff --git a/meta-selftest/classes/crasher.bbclass 
b/meta-selftest/classes/crasher.bbclass
new file mode 100644
index 00..63501c60f4
--- /dev/null
+++ b/meta-selftest/classes/crasher.bbclass
@@ -0,0 +1,37 @@
+addtask throwerror
+do_throwerror[nostamp] = "1"
+python do_throwerror() {
+bb.warn("About to crash...")
+raise RuntimeError("argh!")
+}
+
+addtask spawnerror
+do_spawnerror[nostamp] = "1"
+python do_spawnerror() {
+import subprocess
+subprocess.check_output("echo about to fail; echo here we go; false", 
shell=True, stderr=subprocess.STDOUT)
+}
+
+addtask spawnerrorbinary
+do_spawnerrorbinary[nostamp] = "1"
+python do_spawnerrorbinary() {
+import subprocess
+subprocess.check_output("head -c 10 /bin/bash; false", shell=True, 
stderr=subprocess.STDOUT)
+}
+
+addtask emiterror
+do_emiterror[nostamp] = "1"
+python do_emiterror() {
+bb.warn("this is a warning")
+bb.error("this is an error")
+bb.error("this is an error\non two lines")
+}
+
+addtask shellerror
+do_shellerror[nostamp] = "1"
+do_shellerror() {
+bbwarn This is a warning
+bberror This is an error
+bbfatal This is fatal
+bbwarn This should not appear
+}
diff --git a/meta/lib/oeqa/selftest/cases/bbtests.py 
b/meta/lib/oeqa/selftest/cases/bbtests.py
index 4c82049032..1bdcf808c0 100644
--- a/meta/lib/oeqa/selftest/cases/bbtests.py
+++ b/meta/lib/oeqa/selftest/cases/bbtests.py
@@ -14,6 +14,19 @@ class BitbakeTests(OESelftestTestCase):
 if line in l:
 return l
 
+def check_log_exception(self, test_recipe, test_task, result):
+found = re.search('%s' % test_task, result.output)
+
+return found
+
+def check_log_error_warning(self, bbtype, test_recipe, test_task, result):
+bbtype_regex = re.compile('%s: %s.* %s: %s.*'% (bbtype, test_recipe,
+   test_task['TASK'], 
test_task[bbtype]))
+found = bbtype_regex.search(result.output)
+
+return found
+
+
 @OETestID(789)
 def test_run_bitbake_from_dir_1(self):
 os.chdir(os.path.join(self.builddir, 'conf'))
@@ -277,3 +290,70 @@ INHERIT_remove = \"report-error\"
 
 test_recipe_summary_after = get_bb_var('SUMMARY', test_recipe)
 self.assertEqual(expected_recipe_summary, test_recipe_summary_after)
+
+@OETestID(1886)
+def test_bberror_types(self):
+test_recipe = 'm4-native'
+self.write_config("INHERIT += \"crasher\"")
+
+throwerror = {'TASK' : 'do_throwerror', 'ERROR' : 'Function failed:',
+  'WARNING' : 'About to crash...',
+  'EXCEPTION' : 'Exception: RuntimeError: argh!'}
+spawnerror = {'TASK' : 'do_spawnerror', 'ERROR' : 'Function failed:',
+  'EXCEPTION' : "Exception: subprocess.CalledProcessError: 
Command 'echo about to fail; echo here we go; false",
+  'OUTPUT' : "Subprocess output:\nabout to fail\nhere we 
go"}
+spawnerrorbin = {'TASK' : 'do_spawnerrorbinary', 'ERROR' : '',
+ 'EXCEPTION': "Exception: 
subprocess.CalledProcessError: Command 'head -c 10 /bin/bash; false"}
+emiterror = {'TASK' : 'do_emiterror', 'ERROR' : 'this is an error', 
'WARNING' : 'this is a warning'}
+emiterror_twol = {'TASK' : 'do_emiterror', 'ERROR' : "this is an 
error\non two lines"}
+shellerror = {'TASK' : 'do_shellerror', 'ERROR' : 'This is an error', 
'WARNING' : 'This is a warning'}
+shellfatal = {'TASK' : 'do_shellerror', 'ERROR' : 'This is fatal', 
'WARNING' : 'This should not appear'}
+
+tasks_to_execute = "%s:%s "%(test_recipe, throwerror['TASK']) + \
+"%s:%s "%(test_recipe, spawnerror['TASK']) + "%s:%s 
"%(test_recipe, spawnerrorbin['TASK']) + \
+"%s:%s "%(test_recipe, emiterror['TASK']) + "%s:%s"%(test_recipe, 
shellerror['TASK'])
+
+result = bitbake('%s '% tasks_to_execute, ignore_status=True)
+
+#Test do_throwerror
+find_error = self.check_log_error_warning('ERROR', test_recipe, 
throwerror, result)
+self.assertTrue(find_error, msg = "%s not found on :\n%s" % 
(throwerror['ERROR'] ,resu

[OE-core] [PATCH] selftest/seltest.py: Add test to check imports from other layers

2017-06-22 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

This tests adds a check of selftest itself to verify if can
add test from other layers.

[YOCTO #9770]

Signed-off-by: Mariano Lopez <mariano.lo...@linux.intel.com>
Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 .../lib/oeqa/selftest/cases/external-layer.py  | 16 +++
 meta/lib/oeqa/selftest/cases/selftest.py   | 51 ++
 2 files changed, 67 insertions(+)
 create mode 100644 meta-selftest/lib/oeqa/selftest/cases/external-layer.py
 create mode 100644 meta/lib/oeqa/selftest/cases/selftest.py

diff --git a/meta-selftest/lib/oeqa/selftest/cases/external-layer.py 
b/meta-selftest/lib/oeqa/selftest/cases/external-layer.py
new file mode 100644
index 000..59b1afab7d1
--- /dev/null
+++ b/meta-selftest/lib/oeqa/selftest/cases/external-layer.py
@@ -0,0 +1,16 @@
+#from oeqa.selftest.base import oeSelfTest
+from oeqa.selftest.case import OESelftestTestCase
+#from oeqa.utils.decorators import testcase
+
+
+class ImportedTests(OESelftestTestCase):
+
+def test_unconditional_pass(self):
+"""
+Summary: Doesn't check anything, used to check import test from other 
layers.
+Expected: 1. Pass unconditionally
+Product: oe-core
+Author: Mariano Lopez <mariano.lo...@intel.com
+"""
+
+self.assertEqual(True, True, msg = "Impossible to fail this test")
diff --git a/meta/lib/oeqa/selftest/cases/selftest.py 
b/meta/lib/oeqa/selftest/cases/selftest.py
new file mode 100644
index 000..4b3cb144638
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/selftest.py
@@ -0,0 +1,51 @@
+import importlib
+from oeqa.utils.commands import runCmd
+import oeqa.selftest
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator.oeid import OETestID
+
+class ExternalLayer(OESelftestTestCase):
+
+@OETestID(1885)
+def test_list_imported(self):
+"""
+Summary: Checks functionality to import tests from other layers.
+Expected: 1. File "external-layer.py" must be in
+oeqa.selftest.__path__
+  2. test_unconditional_pas method must exists
+ in ImportedTests class
+Product: oe-core
+Author: Mariano Lopez <mariano.lo...@intel.com>
+"""
+
+test_file = "external-layer.py"
+test_module = "oeqa.selftest.cases.external-layer"
+method_name = "test_unconditional_pass"
+
+# Check if "external-layer.py" is in oeqa path
+found_file = search_test_file(test_file)
+self.assertTrue(found_file, msg="Can't find %s in the oeqa path" % 
test_file)
+
+# Import oeqa.selftest.external-layer module and search for
+# test_unconditional_pass method of ImportedTests class
+found_method = search_method(test_module, method_name)
+self.assertTrue(method_name, msg="Can't find %s method" % method_name)
+
+def search_test_file(file_name):
+for layer_path in oeqa.selftest.__path__:
+for _, _, files in os.walk(layer_path):
+for f in files:
+if f == file_name:
+return True
+return False
+
+def search_method(module, method):
+modlib = importlib.import_module(module)
+for var in vars(modlib):
+klass = vars(modlib)[var]
+if isinstance(klass, type(OESelftestTestCase)) and issubclass(klass, 
OESelftestTestCase):
+for m in dir(klass):
+if m == method:
+return True
+return False
+
-- 
2.12.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/2] selftest: Add Testopia ID to test cases

2017-06-15 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add decorator @OETestID() with proper Tesopia TC ID to the test cases
that did not have it set.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/selftest/cases/containerimage.py |  2 ++
 meta/lib/oeqa/selftest/cases/devtool.py| 10 ++
 meta/lib/oeqa/selftest/cases/image_typedep.py  |  2 ++
 meta/lib/oeqa/selftest/cases/imagefeatures.py  |  1 +
 meta/lib/oeqa/selftest/cases/liboe.py  |  4 
 meta/lib/oeqa/selftest/cases/oelib/buildhistory.py |  4 
 meta/lib/oeqa/selftest/cases/package.py|  4 
 meta/lib/oeqa/selftest/cases/recipetool.py |  4 
 meta/lib/oeqa/selftest/cases/runtime_test.py   |  4 
 meta/lib/oeqa/selftest/cases/sstatetests.py|  2 ++
 meta/lib/oeqa/selftest/cases/tinfoil.py|  1 +
 meta/lib/oeqa/selftest/cases/wic.py| 19 +++
 12 files changed, 57 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/containerimage.py 
b/meta/lib/oeqa/selftest/cases/containerimage.py
index 73162fa600a..99a5cc9e575 100644
--- a/meta/lib/oeqa/selftest/cases/containerimage.py
+++ b/meta/lib/oeqa/selftest/cases/containerimage.py
@@ -2,6 +2,7 @@ import os
 
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.utils.commands import bitbake, get_bb_vars, runCmd
+from oeqa.core.decorator.oeid import OETestID
 
 # This test builds an image with using the "container" IMAGE_FSTYPE, and
 # ensures that then files in the image are only the ones expected.
@@ -20,6 +21,7 @@ class ContainerImageTests(OESelftestTestCase):
 
 # Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
 # the conversion type bar gets added as a dep as well
+@OETestID(1619)
 def test_expected_files(self):
 
 def get_each_path_part(path):
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py 
b/meta/lib/oeqa/selftest/cases/devtool.py
index 06ecf404738..a0406e6b1f6 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -491,6 +491,7 @@ class DevtoolTests(DevtoolBase):
 result = runCmd('devtool status')
 self.assertNotIn('mdadm', result.output)
 
+@OETestID(1620)
 def test_devtool_buildclean(self):
 def assertFile(path, *paths):
 f = os.path.join(path, *paths)
@@ -1013,6 +1014,7 @@ class DevtoolTests(DevtoolBase):
('??', '.*/0001-Add-new-file.patch$')]
 self._check_repo_status(os.path.dirname(recipefile), expected_status)
 
+@OETestID(1627)
 def test_devtool_update_recipe_local_files_3(self):
 # First, modify the recipe
 testrecipe = 'devtool-test-localonly'
@@ -1032,6 +1034,7 @@ class DevtoolTests(DevtoolBase):
 expected_status = [(' M', '.*/%s/file2$' % testrecipe)]
 self._check_repo_status(os.path.dirname(recipefile), expected_status)
 
+@OETestID(1629)
 def test_devtool_update_recipe_local_patch_gz(self):
 # First, modify the recipe
 testrecipe = 'devtool-test-patch-gz'
@@ -1059,6 +1062,7 @@ class DevtoolTests(DevtoolBase):
 if 'gzip compressed data' not in result.output:
 self.fail('New patch file is not gzipped - file reports:\n%s' % 
result.output)
 
+@OETestID(1628)
 def test_devtool_update_recipe_local_files_subdir(self):
 # Try devtool extract on a recipe that has a file with subdir= set in
 # SRC_URI such that it overwrites a file that was in an archive that
@@ -1363,6 +1367,7 @@ class DevtoolTests(DevtoolBase):
 shutil.copy(srcfile, dstfile)
 self.track_for_cleanup(dstfile)
 
+@OETestID(1625)
 def test_devtool_load_plugin(self):
 """Test that devtool loads only the first found plugin in BBPATH."""
 
@@ -1430,6 +1435,7 @@ class DevtoolTests(DevtoolBase):
 self.assertTrue(os.path.exists(os.path.join(olddir, patchfn)), 
'Original patch file does not exist')
 return recipe, oldrecipefile, recipedir, olddir, newversion, patchfn
 
+@OETestID(1623)
 def test_devtool_finish_upgrade_origlayer(self):
 recipe, oldrecipefile, recipedir, olddir, newversion, patchfn = 
self._setup_test_devtool_finish_upgrade()
 # Ensure the recipe is where we think it should be (so that cleanup 
doesn't trash things)
@@ -1448,6 +1454,7 @@ class DevtoolTests(DevtoolBase):
 self.assertTrue(os.path.exists(os.path.join(newdir, patchfn)), 'Patch 
file should have been copied into new directory but wasn\'t')
 self.assertTrue(os.path.exists(os.path.join(newdir, 
'0002-Add-a-comment-to-the-code.patch')), 'New patch file should have been 
created but wasn\'t')
 
+@OETestID(1624)
 def test_devtool_finish_upgrade_otherlayer(self):
 recipe, oldrecipefile, recipedir, olddir, 

[OE-core] [PATCH 1/2] systemdboot: Add Test to check boot file is created correctly

2017-06-15 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add Test case to verify if EFI bootloader for
systemd boot is correctly build inside of image.

[YOCTO #9903]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 .../lib/oeqa/selftest/cases/systemd_boot.py| 54 --
 1 file changed, 50 insertions(+), 4 deletions(-)

diff --git a/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py 
b/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
index 848cdf78524..dd5eeec1633 100644
--- a/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
+++ b/meta-yocto-bsp/lib/oeqa/selftest/cases/systemd_boot.py
@@ -2,25 +2,26 @@ import os
 
 from oeqa.selftest.case import OESelftestTestCase
 from oeqa.core.decorator.oeid import OETestID
+from oeqa.core.decorator.depends import OETestDepends
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
 
 class Systemdboot(OESelftestTestCase):
 def _common_setup(self):
 """
-Common setup for test cases: 1445, 
+Common setup for test cases: 1445, 1528
 """
 
-# Set EFI_PROVIDER = "gummiboot" and MACHINE = "genericx86-64" in 
conf/local.conf
+# Set EFI_PROVIDER = "systemdboot" and MACHINE = "genericx86-64" in 
conf/local.conf
 features = 'EFI_PROVIDER = "systemd-boot"\n'
 features += 'MACHINE = "genericx86-64"'
 self.append_config(features)
 
 def _common_build(self):
 """
-Common build for test cases: 1445 , 
+Common build for test cases: 1445 , 1528
 """
 
-# Build a genericx86-64/efi gummiboot image
+# Build a genericx86-64/efi systemdboot image
 bitbake('mtools-native core-image-minimal')
 
 
@@ -50,3 +51,48 @@ class Systemdboot(OESelftestTestCase):
 
 found = os.path.isfile(systemdbootfile)
 self.assertTrue(found, 'Systemd-Boot file %s not found' % 
systemdbootfile)
+
+@OETestID(1528)
+
@OETestDepends(['systemd_boot.Systemdboot.test_efi_systemdboot_images_can_be_built'])
+def test_image_efi_file(self):
+
+"""
+Summary:  Check if EFI bootloader for systemd is correctly build
+Dependencies: Image was built correctly on testcase 1445
+Steps:1. Copy bootx64.efi file form the hddimg created
+  under build/tmp/deploy/images/genericx86-64
+  2. Check bootx64.efi was copied form hddimg
+  3. Verify the checksums from the copied and previously
+  created file are equal.
+Expected :Systemd-bootx64.efi and bootx64.efi should be the same
+      hence checksums should be equal.
+Product:  oe-core
+Author:   Jose Perez Carranza 
+AutomatedBy:  Jose Perez Carranza 
+"""
+
+systemdbootfile = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 
'genericx86-64',
+   'systemd-bootx64.efi')
+systemdbootimage = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 
'genericx86-64',
+
'core-image-minimal-genericx86-64.hddimg')
+imagebootfile = os.path.join(get_bb_var('DEPLOY_DIR'), 'images', 
'genericx86-64',
+'bootx64.efi')
+mcopynative = os.path.join(get_bb_var('STAGING_BINDIR_NATIVE'), 
'mcopy')
+
+#Clean environment before start the test
+if os.path.isfile(imagebootfile):
+runCmd('rm -f %s' % imagebootfile)
+
+#Step 1
+runCmd('%s -i %s ::EFI/BOOT/bootx64.efi %s' % (mcopynative 
,systemdbootimage,
+   imagebootfile))
+
+#Step 2
+found = os.path.isfile(imagebootfile)
+self.assertTrue(found, 'bootx64.efi file %s was not copied from 
image'
+% imagebootfile)
+
+#Step 3
+result = runCmd('md5sum %s %s' % (systemdbootfile, imagebootfile))
+self.assertEqual(result.output.split()[0], 
result.output.split()[2],
+ '%s was not correclty generated' % imagebootfile)
-- 
2.12.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v4] runtime/dnf: Add new dnf test cases

2017-06-14 Thread Jose Perez Carranza



On 06/14/2017 07:00 AM, Alexander Kanavin wrote:

On 06/13/2017 10:56 PM, jose.perez.carra...@linux.intel.com wrote:

From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.


Looks good. Hopefully this is the last time you needed to revise the 
patch :)
Thanks for you advise on this, I hope so too, this time I do a series of 
tests on AB and they were executed correctly


Alex



--
Saludos
José

--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v4] runtime/dnf: Add new dnf test cases

2017-06-13 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/classes/testimage.bbclass | 11 ---
 meta/lib/oeqa/runtime/cases/dnf.py | 22 ++
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 6fa2d6fd9f..d76d64d442 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
 return None
 
 def create_rpm_index(d):
+import glob
 # Index RPMs
 rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
 index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
 lf = bb.utils.lockfile(lockfilename, False)
 oe.path.copyhardlinktree(rpm_dir, idx_path)
 # Full indexes overload a 256MB image so reduce the number of rpms
-# in the feed. Filter to r* since we use the run-postinst packages and
-# this leaves some allarch and machine arch packages too.
-bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+# in the feed by filtering to specific packages needed by the tests.
+package_list = glob.glob(idx_path + "*/*.rpm")
+
+for pkg in package_list:
+if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", 
"busybox", "bash", "update-alternatives", "libc6", "curl")):
+bb.utils.remove(pkg)
+
 bb.utils.unlockfile(lf)
 cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py 
b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e..25db9bacd2 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -120,4 +120,26 @@ class DnfRepoTest(DnfTest):
 def test_dnf_reinstall(self):
 self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
+@OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+@OETestID(1771)
+def test_dnf_installroot(self):
+rootpath = '/home/root/chroot/test'
+self.target.run('mkdir -p %s/etc' % rootpath, 1500)
+self.target.run('cp -r /etc/rpm %s/etc' % rootpath, 1500)
+self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500)
+self.dnf_with_repo('install --installroot=%s -v -y busybox 
run-postinsts' % rootpath)
+status, output = self.target.run('test -e %s/var/cache/dnf' % 
rootpath, 1500)
+self.assertEqual(0, status, output)
+status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 
1500)
+self.assertEqual(0, status, output)
 
+@OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+@OETestID(1772)
+def test_dnf_exclude(self):
+excludepkg = 'curl-dev'
+self.dnf_with_repo('install -y curl*')
+self.dnf('list %s' % excludepkg, 0)
+self.dnf_with_repo('remove -y curl*')
+self.dnf('list %s' % excludepkg, 1)
+self.dnf_with_repo('install -y --exclude=%s curl*' % excludepkg)
+self.dnf('list %s' % excludepkg, 1)
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v3] runtime/dnf: Add new dnf test cases

2017-06-09 Thread Jose Perez Carranza

Thank you Alex !

I will work on a patch with your approach

On 06/09/2017 04:22 AM, Alexander Kanavin wrote:

On 06/08/2017 07:35 PM, Alexander Kanavin wrote:
I haven't been able to reproduce the installroot failure, works fine 
here.


The installroot issue is most likely due to dnf architectures not 
being properly configured (which causes breakage when the architecture 
is not one of the standard ones that the upstream has hardcoded). Yes, 
the error message is unhelpful and leads one to think the repo is 
somehow broken or is missing packages :)


Copy the contents of /etc/rpm and /etc/dnf into installroot dir before 
running dnf, and you should be good to go. Test on x32, for example.


Alex



--
Saludos
José

--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v3] runtime/dnf: Add new dnf test cases

2017-06-08 Thread Jose Perez Carranza



On 06/08/2017 07:49 AM, Alexander Kanavin wrote:

On 06/08/2017 03:49 PM, Jose Perez Carranza wrote:


1. bitbake core-image-sato using shared states (I'm using local sstates)


When you do this, tmp/deploy/rpm should get re-populated with rpm 
packages, regardless of whether they're taken from sstate, or rebuilt.
All those steps are done on a fresh build directory, so the first time 
that image is built packages are not being populated when rebuilding the 
image packages are get pupulated, but AB only built once the image and 
then execute testimage.


Can you check why this does not happen on your side?

Alex


--
Saludos
José

--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v3] runtime/dnf: Add new dnf test cases

2017-06-08 Thread Jose Perez Carranza



On 06/08/2017 06:31 AM, Alexander Kanavin wrote:

On 06/07/2017 08:31 PM, Jose Perez Carranza wrote:

When I tried this test image was built without using states hence
"busybox*.rpm" and "curl*.rpm"where present under
"tmp/deploy/rpm/core2_64" hence the repo i taking tha packages form
there to add them to repo and used on the image, but when using sstates
those packages are not being built so are not present on local build
directory. is there any way to force those packages to be built to have
them available on tmp/deploy/rpm/core2_64?


I can try to help if you provide steps to reproduce: if I merely do

rm -rf build/tmp
bitbake core-image-sato

then the build/tmp/deploy/rpm directory gets fully re-populated.


Sure I'm using this branch [1]

The steps that Iḿ following are :

1. bitbake core-image-sato using shared states (I'm using local sstates)
2. Add to the local.conf
INHERIT += "testimage"
TEST_SUITES += " ping ssh dnf"
3. bitbake core-image-sato -c testimage

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=jperez/dnf-updates


Alex



--
Saludos
José

--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v3] runtime/dnf: Add new dnf test cases

2017-06-07 Thread Jose Perez Carranza
When I tried this test image was built without using states hence 
"busybox*.rpm" and "curl*.rpm"where present under 
"tmp/deploy/rpm/core2_64" hence the repo i taking tha packages form 
there to add them to repo and used on the image, but when using sstates 
those packages are not being built so are not present on local build 
directory. is there any way to force those packages to be built to have 
them available on tmp/deploy/rpm/core2_64?


On 06/07/2017 05:21 AM, Burton, Ross wrote:


On 15 May 2017 at 14:50, > wrote:


Add test cases to test “exclude” and “installroot“ options, also
modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.


Fails all over the autobuilder, for example:

http://errors.yoctoproject.org/Errors/Details/143886/

Ross


--
Saludos
José

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v3] runtime/dnf: Add new dnf test cases

2017-05-15 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/classes/testimage.bbclass | 11 ---
 meta/lib/oeqa/runtime/cases/dnf.py | 23 ++-
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index fb214604a97..a0d07c9f003 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
 return None
 
 def create_rpm_index(d):
+import glob
 # Index RPMs
 rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
 index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
 lf = bb.utils.lockfile(lockfilename, False)
 oe.path.copyhardlinktree(rpm_dir, idx_path)
 # Full indexes overload a 256MB image so reduce the number of rpms
-# in the feed. Filter to r* since we use the run-postinst packages and
-# this leaves some allarch and machine arch packages too.
-bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+# in the feed by filtering to specific packages needed by the tests.
+package_list = glob.glob(idx_path + "*/*.rpm")
+
+for pkg in package_list:
+if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", 
"busybox", "bash", "update-alternatives", "libc6", "curl")):
+bb.utils.remove(pkg)
+
 bb.utils.unlockfile(lf)
 cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py 
b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e0..4f274d57f8d 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -74,7 +74,6 @@ class DnfRepoTest(DnfTest):
 def test_dnf_makecache(self):
 self.dnf_with_repo('makecache')
 
-
 # Does not work when repo is specified on the command line
 #@OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
 #def test_dnf_repolist(self):
@@ -120,4 +119,26 @@ class DnfRepoTest(DnfTest):
 def test_dnf_reinstall(self):
 self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
+@OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+@OETestID(1771)
+def test_dnf_installroot(self):
+rootpath = '/home/root/chroot/test'
+self.dnf_with_repo('install --installroot=%s --allowerasing -v -y 
busybox run-postinsts' % rootpath)
+status, output = self.target.run('test -e %s/var/cache/dnf' % 
rootpath, 1500)
+self.assertEqual(0, status, output)
+status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 
1500)
+self.assertEqual(0, status, output)
 
+@OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+@OETestID(1772)
+def test_dnf_exclude(self):
+excludepkg = 'curl-dev'
+if self.dnf('list curl %s' % excludepkg ,0):
+self.dnf_with_repo('remove -y curl*')
+
+self.dnf('list %s' % excludepkg, 1)
+self.dnf_with_repo('install -y curl*')
+self.dnf('list %s' % excludepkg, 0)
+self.dnf_with_repo('remove -y curl*')
+self.dnf_with_repo('install -y --exclude=%s curl*' % excludepkg)
+self.dnf('list %s' % excludepkg, 1)
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2] runtime/dnf: Add new dnf test cases

2017-05-11 Thread Jose Perez Carranza



On 05/11/2017 01:56 PM, Alexander Kanavin wrote:

On 05/11/2017 08:33 PM, jose.perez.carra...@linux.intel.com wrote:

+def test_dnf_exclude(self):
+excludepkg = 'curl-dev'
+self.dnf('list %s' % excludepkg, 0)
+self.dnf_with_repo('remove -y curl')
+self.dnf_with_repo('install -y --exclude=%s curl' % excludepkg)
+self.dnf('list %s' % excludepkg, 1)


1) Why is curl-dev already installed when the test starts? Will that 
be always the case?
Will add logic to validate if curl is not installed then not try to 
remove it and go directly to test --exclude option


2) I still don't understand how the test works. You are asking for 
curl to be installed and curl-dev to be excluded, but curl-dev would 
not be installed regardless of --exclude option, because curl does not 
depend on it. You need to test a situation where --exclude makes a 
difference, and check that there is indeed a difference.
curl-dev is always installed with curl as a weak dependency, so every 
time you install or remove curl also curl-dev is affected, hence this 
test validate that --exclude option is working correctly by checking 
that curl-dev (weak dependency) is not installed,


Alex



--
Saludos
José

--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] runtime/dnf: Add new dnf test cases

2017-05-11 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/classes/testimage.bbclass | 11 ---
 meta/lib/oeqa/runtime/cases/dnf.py | 19 ++-
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index fb214604a97..a0d07c9f003 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
 return None
 
 def create_rpm_index(d):
+import glob
 # Index RPMs
 rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
 index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
 lf = bb.utils.lockfile(lockfilename, False)
 oe.path.copyhardlinktree(rpm_dir, idx_path)
 # Full indexes overload a 256MB image so reduce the number of rpms
-# in the feed. Filter to r* since we use the run-postinst packages and
-# this leaves some allarch and machine arch packages too.
-bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+# in the feed by filtering to specific packages needed by the tests.
+package_list = glob.glob(idx_path + "*/*.rpm")
+
+for pkg in package_list:
+if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", 
"busybox", "bash", "update-alternatives", "libc6", "curl")):
+bb.utils.remove(pkg)
+
 bb.utils.unlockfile(lf)
 cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py 
b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e0..0baf796278b 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -120,4 +120,21 @@ class DnfRepoTest(DnfTest):
 def test_dnf_reinstall(self):
 self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
-
+@OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+@OETestID(1771)
+def test_dnf_installroot(self):
+rootpath = '/home/root/chroot/test'
+self.dnf_with_repo('install --installroot=%s --allowerasing -v -y 
busybox run-postinsts' % rootpath)
+status, output = self.target.run('test -e %s/var/cache/dnf' % 
rootpath, 1500)
+self.assertEqual(0, status, output)
+status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 
1500)
+self.assertEqual(0, status, output)
+
+@OETestDepends(['dnf.DnfRepoTest.test_dnf_reinstall'])
+@OETestID(1772)
+def test_dnf_exclude(self):
+excludepkg = 'curl-dev'
+self.dnf('list %s' % excludepkg, 0)
+self.dnf_with_repo('remove -y curl')
+self.dnf_with_repo('install -y --exclude=%s curl' % excludepkg)
+self.dnf('list %s' % excludepkg, 1)
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] runtime/dnf: Add new dnf test cases

2017-05-10 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/classes/testimage.bbclass | 11 ---
 meta/lib/oeqa/runtime/cases/dnf.py | 16 +++-
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index fb214604a97..2ae2eed053c 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
 return None
 
 def create_rpm_index(d):
+import glob
 # Index RPMs
 rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
 index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
 lf = bb.utils.lockfile(lockfilename, False)
 oe.path.copyhardlinktree(rpm_dir, idx_path)
 # Full indexes overload a 256MB image so reduce the number of rpms
-# in the feed. Filter to r* since we use the run-postinst packages and
-# this leaves some allarch and machine arch packages too.
-bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+# in the feed by filtering to specific packages needed by the tests.
+package_list = glob.glob(idx_path + "*/*.rpm")
+
+for pkg in package_list:
+if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", 
"busybox", "bash", "update-alternatives", "libc6")):
+bb.utils.remove(pkg)
+
 bb.utils.unlockfile(lf)
 cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py 
b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e0..4ca4850ed1d 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -120,4 +120,18 @@ class DnfRepoTest(DnfTest):
 def test_dnf_reinstall(self):
 self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
-
+@OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+@OETestID(1771)
+def test_dnf_installroot(self):
+rootpath = '/home/root/chroot/test'
+self.dnf_with_repo('install --installroot=%s --allowerasing -v -y 
busybox run-postinsts' % rootpath)
+status, output = self.target.run('test -e %s/var/cache/dnf' % 
rootpath, 1500)
+self.assertEqual(0, status, output)
+
+@OETestDepends(['dnf.DnfRepoTest.test_dnf_reinstall'])
+@OETestID(1772)
+def test_dnf_exclude(self):
+excludepkg = 'run-postinsts-dev'
+self.dnf_with_repo('remove -y run-postinsts')
+self.dnf_with_repo('install -y --exclude=%s run-postinsts' % 
excludepkg)
+self.dnf('list %s' % excludepkg, 1)
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] selftest/devtool: Modify test to use default config

2017-05-05 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Modify “test_devtool_virtual_kernel_modify” to be executed with default
configuration defined on oe-selftest test suite. A shorter string was
added to the the header file to avoid overlapped sections when building
kernel for qemux86-64.

[Yocto #11300]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/selftest/devtool.py | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/meta/lib/oeqa/selftest/devtool.py 
b/meta/lib/oeqa/selftest/devtool.py
index 8e7642c32b6..6d70399584b 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -1632,10 +1632,6 @@ class DevtoolTests(DevtoolBase):
  and modification to the source and configurations are 
reflected
  when building the kernel.
  """
-#Set machine to qemxu86 to be able to modify the kernel and
-#verify the modification.
-features = 'MACHINE = "qemux86"\n'
-self.write_config(features)
 kernel_provider = get_bb_var('PREFERRED_PROVIDER_virtual/kernel')
 # Clean up the enviroment
 bitbake('%s -c clean' % kernel_provider)
@@ -1673,10 +1669,10 @@ class DevtoolTests(DevtoolBase):
 kernelfile = os.path.join(get_bb_var('KBUILD_OUTPUT', 
kernel_provider), 'vmlinux')
 self.assertTrue(os.path.exists(kernelfile),'Kernel was not build 
correctly')
 
-#Modify the kernel source, this is specific for qemux86
+#Modify the kernel source
 modfile = os.path.join(tempdir,'arch/x86/boot/header.S')
-modstring = "use a boot loader - Devtool kernel testing"
-modapplied = runCmd("sed -i 's/boot loader/%s/' %s" % (modstring, 
modfile))
+modstring = "Use a boot loader. Devtool testing."
+modapplied = runCmd("sed -i 's/Use a boot loader./%s/' %s" % 
(modstring, modfile))
 self.assertEqual(0,modapplied.status,'Modification to %s on kernel 
source failed' % modfile)
 #Modify the configuration
 codeconfigfile = os.path.join(tempdir,'.config.new')
-- 
2.12.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] devtool: Avoid touch sstates when cleaning linux-yocto environment

2017-04-26 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

sstates are cleaned when ruining  test_devtool_virtual_kernel_modify to
have a clean environment but this is affecting eSDK test that are
dependent of those sstates, hence “cleansstate” is replaced for
“clean”.

[YOCTO #11300]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/selftest/devtool.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/selftest/devtool.py 
b/meta/lib/oeqa/selftest/devtool.py
index 762c7bacec5..8e7642c32b6 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -1638,7 +1638,7 @@ class DevtoolTests(DevtoolBase):
 self.write_config(features)
 kernel_provider = get_bb_var('PREFERRED_PROVIDER_virtual/kernel')
 # Clean up the enviroment
-bitbake('%s -c cleansstate' % kernel_provider)
+bitbake('%s -c clean' % kernel_provider)
 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
 self.track_for_cleanup(tempdir)
 self.track_for_cleanup(self.workspacedir)
-- 
2.12.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] oe-selftest : Unset SANITY_TESTED_DISTROS to avoid warnings on execution

2017-04-24 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Unsetting SANITY_TESTED_DISTROS is required to avoid warnings that are
treated like failures by oe-selftest suite.

[YOCTO #11401]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 scripts/oe-selftest | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index 52366b1c8d..8c72b8c601 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -151,14 +151,24 @@ def preflight_check():
 return False
 
 if get_bb_var("SANITY_TESTED_DISTROS"):
-log.error("Please unset SANITY_TESTED_DISTROS in order to run 
oe-selftest")
-return False
+log.info("Unsetting SANITY_TESTED_DISTROS in order to run oe-selftest")
+ftools.append_file(os.path.join(builddir, "conf/local.conf"), \
+   "\n#Unset SANITY_TESTED_DISTROS added by 
oe-selftest.py\nSANITY_TESTED_DISTROS=''")
 
 log.info("Running bitbake -p")
 runCmd("bitbake -p")
 
 return True
 
+def remove_variables():
+   if "#Unset SANITY_TESTED_DISTROS added by oe-selftest.py" \
+   in ftools.read_file(os.path.join(builddir, "conf/local.conf")):
+   log.info("Removing SANITY_TESTED_DISTROS from local.conf")
+   ftools.remove_from_file(os.path.join(builddir, "conf/local.conf"), \
+   "\n#Unset SANITY_TESTED_DISTROS added by 
oe-selftest.py\nSANITY_TESTED_DISTROS=''")
+
+
+
 def add_include():
 global builddir
 if "#include added by oe-selftest.py" \
@@ -811,4 +821,5 @@ if __name__ == "__main__":
 finally:
 remove_include()
 remove_inc_files()
+remove_variables()
 sys.exit(ret)
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] runtime/dnf : Add ID to the dnf test cases

2017-04-04 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add the corresponding Testopia ID to the test cases for dnf

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/runtime/cases/dnf.py | 12 
 1 file changed, 12 insertions(+)

diff --git a/meta/lib/oeqa/runtime/cases/dnf.py 
b/meta/lib/oeqa/runtime/cases/dnf.py
index eb3af07f0f..2f87296b4e 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -26,22 +26,27 @@ class DnfBasicTest(DnfTest):
   'RPM is not the primary package manager')
 @OEHasPackage(['dnf'])
 @OETestDepends(['ssh.SSHTest.test_ssh'])
+@OETestID(1735)
 def test_dnf_help(self):
 self.dnf('--help')
 
 @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+@OETestID(1739)
 def test_dnf_version(self):
 self.dnf('--version')
 
 @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+@OETestID(1737)
 def test_dnf_info(self):
 self.dnf('info dnf')
 
 @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+@OETestID(1738)
 def test_dnf_search(self):
 self.dnf('search dnf')
 
 @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+@OETestID(1736)
 def test_dnf_history(self):
 self.dnf('history')
 
@@ -65,6 +70,7 @@ class DnfRepoTest(DnfTest):
 self.dnf(" ".join(cmdlinerepoopts) + " --nogpgcheck " + command)
 
 @OETestDepends(['dnf.DnfBasicTest.test_dnf_help'])
+@OETestID(1744)
 def test_dnf_makecache(self):
 self.dnf_with_repo('makecache')
 
@@ -75,19 +81,23 @@ class DnfRepoTest(DnfTest):
 #self.dnf_with_repo('repolist')
 
 @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+@OETestID(1746)
 def test_dnf_repoinfo(self):
 self.dnf_with_repo('repoinfo')
 
 @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+@OETestID(1740)
 def test_dnf_install(self):
 self.dnf_with_repo('install -y run-postinsts-dev')
 
 @OETestDepends(['dnf.DnfRepoTest.test_dnf_install'])
+@OETestID(1741)
 def test_dnf_install_dependency(self):
 self.dnf_with_repo('remove -y run-postinsts')
 self.dnf_with_repo('install -y run-postinsts-dev')
 
 @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_dependency'])
+@OETestID(1742)
 def test_dnf_install_from_disk(self):
 self.dnf_with_repo('remove -y run-postinsts-dev')
 self.dnf_with_repo('install -y --downloadonly run-postinsts-dev')
@@ -96,6 +106,7 @@ class DnfRepoTest(DnfTest):
 self.dnf_with_repo('install -y %s' % output)
 
 @OETestDepends(['dnf.DnfRepoTest.test_dnf_install_from_disk'])
+@OETestID(1743)
 def test_dnf_install_from_http(self):
 output = subprocess.check_output('%s %s -name run-postinsts-dev*' % 
(bb.utils.which(os.getenv('PATH'), "find"),

os.path.join(self.tc.td['WORKDIR'], 'oe-testimage-repo')), 
shell=True).decode("utf-8")
@@ -105,6 +116,7 @@ class DnfRepoTest(DnfTest):
 self.dnf_with_repo('install -y %s' % url)
 
 @OETestDepends(['dnf.DnfRepoTest.test_dnf_install'])
+@OETestID(1745)
 def test_dnf_reinstall(self):
 self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
-- 
2.11.0

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] selftest/devtool: Add test to verify "modify virtual/kernel"

2017-03-10 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux-ntel.com>

The purpose of this test case is to verify that
devtool modify works correctly when building
the kernel.

[YOCTO #10817]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/selftest/devtool.py | 85 +++
 1 file changed, 85 insertions(+)

diff --git a/meta/lib/oeqa/selftest/devtool.py 
b/meta/lib/oeqa/selftest/devtool.py
index f1661ef..c389d50 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -1606,3 +1606,88 @@ class DevtoolTests(DevtoolBase):
 checkvars['S'] = '${WORKDIR}/${BPN}-%s' % recipever
 checkvars['SRC_URI'] = url
 self._test_recipe_contents(newrecipefile, checkvars, [])
+
+@testcase(1577)
+def test_devtool_virtual_kernel_modify(self):
+"""
+Summary:The purpose of this test case is to verify that
+devtool modify works correctly when building
+the kernel.
+Dependencies:   NA
+Steps:  1. Build kernel with bitbake.
+2. Save the config file generated.
+3. Clean the environment.
+4. Use `devtool modify virtual/kernel` to validate 
following:
+   4.1 The source is checked out correctly.
+   4.2 The resulting configuration is the same as
+   what was get on step 2.
+   4.3 The Kernel can be build correctly.
+   4.4 Changes made on the source are reflected on the
+   subsequent builds.
+   4.5 Changes on the configuration are reflected on 
the
+   subsequent builds
+ Expected:   devtool modify is able to checkout the source of the 
kernel
+ and modification to the source and configurations are 
reflected
+ when building the kernel.
+ """
+#Set machine to qemxu86 to be able to modify the kernel and
+#verify the modification.
+features = 'MACHINE = "qemux86"\n'
+self.write_config(features)
+# Clean up the enviroment
+bitbake('linux-yocto -c cleansstate')
+tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+self.track_for_cleanup(tempdir)
+self.track_for_cleanup(self.workspacedir)
+self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+self.add_command_to_tearDown('bitbake -c clean linux-yocto')
+#Step 1
+#Here is just generated the config file instead of all the kernel to 
optimize the
+#time of executing this test case.
+bitbake('linux-yocto -c configure')
+bbconfig = os.path.join(get_bb_var('B',"linux-yocto"),'.config')
+buildir= get_bb_var('TOPDIR')
+#Step 2
+runCmd('cp %s %s' % (bbconfig, buildir))
+self.assertTrue(os.path.exists(os.path.join(buildir, '.config')),
+'Could not copy .config file from kernel')
+
+tmpconfig = os.path.join(buildir, '.config')
+#Step 3
+bitbake('linux-yocto -c cleanall')
+#Step 4.1
+runCmd('devtool modify virtual/kernel -x %s' % tempdir)
+self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')),
+'Extracted source could not be found')
+#Step 4.2
+configfile = os.path.join(tempdir,'.config')
+diff = runCmd('diff %s %s' % (tmpconfig, configfile))
+self.assertEqual(0,diff.status,'Kernel .config file is not the same 
using bitbake and devtool')
+#Step 4.3
+#NOTE: virtual/kernel is mapped to linux-yocto
+result = runCmd('devtool build linux-yocto')
+self.assertEqual(0,result.status,'Cannot build kernel using `devtool 
build`')
+kernelfile = os.path.join(get_bb_var('KBUILD_OUTPUT',"linux-yocto"), 
'vmlinux')
+self.assertTrue(os.path.exists(kernelfile),'Kernel was not build 
correctly')
+
+#Modify the kernel source, this is specific for qemux86
+modfile = os.path.join(tempdir,'arch/x86/boot/header.S')
+modstring = "use a boot loader - Devtool kernel testing"
+modapplied = runCmd("sed -i 's/boot loader/%s/' %s" % (modstring, 
modfile))
+self.assertEqual(0,modapplied.status,'Modification to %s on kernel 
source failed' % modfile)
+#Modify the configuration
+codeconfigfile = os.path.join(tempdir,'.config.new')
+modconfopt = "CONFIG_SG_POOL=n"
+modconf = runCmd("sed -i 's/CONFIG_SG_POOL=y/%s/' %s" % (modconfopt, 
codeconfigfile))
+self.assertEqual(0,modconf.status,'Modification to %s failed' %

Re: [OE-core] [PATCH] selftest/devtool: Add test to verify "modify virtual/kernel"

2017-03-09 Thread Jose Perez Carranza

On 03/09/2017 01:57 PM, Burton, Ross wrote:


On 23 January 2017 at 22:13, > wrote:

>
> +checkmodcode = runCmd("strings %s | head -n 10 | grep '%s'" 
% (bzimagefile, modstring))



Annoyingly this bit is failing on some autobuilders:


Do you have a list of workers where this is failing ?
AssertionError: Command 'strings 
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86-poky-linux/linux-yocto/4.10+git999-r0/image/boot/bzImage-4.10.0-yocto-standard 
| head -n 10 | grep 'use a boot loader - Devtool kernel testing'' 
returned non-zero exit status 1:
BFD: 
/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/work/qemux86-poky-linux/linux-yocto/4.10+git999-r0/image/boot/bzImage-4.10.0-yocto-standard: 
Warning: Ignoring section flag IMAGE_SCN_MEM_NOT_PAGED in section .bss


I'm wondering if grep on its own - not strings|head|grep - would work 
around this?


I will try using grep and do some test to see if everything is OK. on 
local AB's
(note that strings is "smart" and if executed on an ELF will use 
libbfd to extract the segments with human strings in, which is why 
it's returning errors from BFD)


Ross


--
Saludos
José

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] selftest/runtime-tests: Modify positins test to reduce execution time

2017-01-30 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Currently test_postinst_roofs_and_boot is building a full-cmdline image
this is taking a lot of time to execute the test, so a minimal image
will be build instead.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/selftest/runtime-test.py | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/meta/lib/oeqa/selftest/runtime-test.py 
b/meta/lib/oeqa/selftest/runtime-test.py
index 9e2ecc6..52e5b27 100644
--- a/meta/lib/oeqa/selftest/runtime-test.py
+++ b/meta/lib/oeqa/selftest/runtime-test.py
@@ -176,7 +176,7 @@ postinst-delayed-t \
 that script can be delayed to run at first boot.
 Dependencies:   NA
 Steps:  1. Add proper configuration to local.conf file
-2. Build a "core-image-full-cmdline" image
+2. Build a "core-image-minimal" image
 3. Verify that file created by postinst_rootfs recipe 
is
present on rootfs dir.
 4. Boot the image created on qemu and verify that the 
file
@@ -195,6 +195,7 @@ postinst-delayed-t \
 #Step 1
 features = 'MACHINE = "qemux86"\n'
 features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, 
boot_pkg)
+features += 'IMAGE_FEATURES += "ssh-server-openssh"\n'
 for init_manager in ("sysvinit", "systemd"):
 #for sysvinit no extra configuration is needed,
 if (init_manager is "systemd"):
@@ -209,10 +210,10 @@ postinst-delayed-t \
 self.write_config(features)
 
 #Step 2
-bitbake('core-image-full-cmdline')
+bitbake('core-image-minimal')
 
 #Step 3
-file_rootfs_created = 
os.path.join(get_bb_var('IMAGE_ROOTFS',"core-image-full-cmdline"),
+file_rootfs_created = 
os.path.join(get_bb_var('IMAGE_ROOTFS',"core-image-minimal"),
file_rootfs_name)
 found = os.path.isfile(file_rootfs_created)
 self.assertTrue(found, "File %s was not created at rootfs time 
by %s" % \
@@ -220,11 +221,11 @@ postinst-delayed-t \
 
 #Step 4
 testcommand = 'ls /etc/'+fileboot_name
-with runqemu('core-image-full-cmdline') as qemu:
+with runqemu('core-image-minimal') as qemu:
 sshargs = '-o UserKnownHostsFile=/dev/null -o 
StrictHostKeyChecking=no'
 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, 
testcommand))
 self.assertEqual(result.status, 0, 'File %s was not 
created at firts boot'% fileboot_name)
 
 #Step 5
 bitbake(' %s %s -c cleanall' % (rootfs_pkg, boot_pkg))
-bitbake('core-image-full-cmdline -c cleanall')
+bitbake('core-image-minimal -c cleanall')
-- 
2.1.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] selftest/devtool: Add test to verify "modify virtual/kernel"

2017-01-23 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux-ntel.com>

The purpose of this test case is to verify that
devtool modify works correctly when building
the kernel.

[YOCTO #10817]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux-ntel.com>
---
 meta/lib/oeqa/selftest/devtool.py | 85 +++
 1 file changed, 85 insertions(+)

diff --git a/meta/lib/oeqa/selftest/devtool.py 
b/meta/lib/oeqa/selftest/devtool.py
index 79a4b1f..1ba8e00 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -1579,3 +1579,88 @@ class DevtoolTests(DevtoolBase):
 checkvars['S'] = '${WORKDIR}/${BPN}-%s' % recipever
 checkvars['SRC_URI'] = url
 self._test_recipe_contents(newrecipefile, checkvars, [])
+
+@testcase(1577)
+def test_devtool_virtual_kernel_modify(self):
+"""
+Summary:The purpose of this test case is to verify that
+devtool modify works correctly when building
+the kernel.
+Dependencies:   NA
+Steps:  1. Build kernel with bitbake.
+2. Save the config file generated.
+3. Clean the environment.
+4. Use `devtool modify virtual/kernel` to validate 
following:
+   4.1 The source is checked out correctly.
+   4.2 The resulting configuration is the same as
+   what was get on step 2.
+   4.3 The Kernel can be build correctly.
+   4.4 Changes made on the source are reflected on the
+   subsequent builds.
+   4.5 Changes on the configuration are reflected on 
the
+   subsequent builds
+ Expected:   devtool modify is able to checkout the source of the 
kernel
+ and modification to the source and configurations are 
reflected
+ when building the kernel.
+ """
+#Set machine to qemxu86 to be able to modify the kernel and
+#verify the modification.
+features = 'MACHINE = "qemux86"\n'
+self.write_config(features)
+# Clean up the enviroment
+bitbake('linux-yocto -c cleansstate')
+tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+self.track_for_cleanup(tempdir)
+self.track_for_cleanup(self.workspacedir)
+self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+self.add_command_to_tearDown('bitbake -c clean linux-yocto')
+#Step 1
+#Here is just generated the config file instead of all the kernel to 
optimize the
+#time of executing this test case.
+bitbake('linux-yocto -c configure')
+bbconfig = os.path.join(get_bb_var('B',"linux-yocto"),'.config')
+buildir= get_bb_var('TOPDIR')
+#Step 2
+runCmd('cp %s %s' % (bbconfig, buildir))
+self.assertTrue(os.path.exists(os.path.join(buildir, '.config')),
+'Could not copy .config file from kernel')
+
+tmpconfig = os.path.join(buildir, '.config')
+#Step 3
+bitbake('linux-yocto -c cleanall')
+#Step 4.1
+runCmd('devtool modify virtual/kernel -x %s' % tempdir)
+self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')),
+'Extracted source could not be found')
+#Step 4.2
+configfile = os.path.join(tempdir,'.config')
+diff = runCmd('diff %s %s' % (tmpconfig, configfile))
+self.assertEqual(0,diff.status,'Kernel .config file is not the same 
using bitbake and devtool')
+#Step 4.3
+#NOTE: virtual/kernel is mapped to linux-yocto
+result = runCmd('devtool build linux-yocto')
+self.assertEqual(0,result.status,'Cannot build kernel using `devtool 
build`')
+kernelfile = os.path.join(get_bb_var('KBUILD_OUTPUT',"linux-yocto"), 
'vmlinux')
+self.assertTrue(os.path.exists(kernelfile),'Kernel was not build 
correctly')
+
+#Modify the kernel source, this is specific for qemux86
+modfile = os.path.join(tempdir,'arch/x86/boot/header.S')
+modstring = "use a boot loader - Devtool kernel testing"
+modapplied = runCmd("sed -i 's/boot loader/%s/' %s" % (modstring, 
modfile))
+self.assertEqual(0,modapplied.status,'Modification to %s on kernel 
source failed' % modfile)
+#Modify the configuration
+codeconfigfile = os.path.join(tempdir,'.config.new')
+modconfopt = "CONFIG_SG_POOL=n"
+modconf = runCmd("sed -i 's/CONFIG_SG_POOL=y/%s/' %s" % (modconfopt, 
codeconfigfile))
+self.assertEqual(0,modconf.status,'Modification to %s failed' %

[OE-core] [PATCH] Tinfoil: Add test IDs to tinfoil test cases

2017-01-12 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@intel.com>

Testopia entrances were created and the IDs retrieved are
added to their corresponding test case on tinfoil script.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@intel.com>
---
 meta/lib/oeqa/selftest/tinfoil.py | 9 +
 1 file changed, 9 insertions(+)

diff --git a/meta/lib/oeqa/selftest/tinfoil.py 
b/meta/lib/oeqa/selftest/tinfoil.py
index c8d635c..6ad106c 100644
--- a/meta/lib/oeqa/selftest/tinfoil.py
+++ b/meta/lib/oeqa/selftest/tinfoil.py
@@ -10,6 +10,7 @@ from oeqa.utils.decorators import testcase
 class TinfoilTests(oeSelfTest):
 """ Basic tests for the tinfoil API """
 
+@testcase(1568)
 def test_getvar(self):
 with bb.tinfoil.Tinfoil() as tinfoil:
 tinfoil.prepare(True)
@@ -17,6 +18,7 @@ class TinfoilTests(oeSelfTest):
 if not machine:
 self.fail('Unable to get MACHINE value - returned %s' % 
machine)
 
+@testcase(1569)
 def test_expand(self):
 with bb.tinfoil.Tinfoil() as tinfoil:
 tinfoil.prepare(True)
@@ -25,6 +27,7 @@ class TinfoilTests(oeSelfTest):
 if not pid:
 self.fail('Unable to expand "%s" - returned %s' % (expr, pid))
 
+@testcase(1570)
 def test_getvar_bb_origenv(self):
 with bb.tinfoil.Tinfoil() as tinfoil:
 tinfoil.prepare(True)
@@ -33,6 +36,7 @@ class TinfoilTests(oeSelfTest):
 self.fail('Unable to get BB_ORIGENV value - returned %s' % 
origenv)
 self.assertEqual(origenv.getVar('HOME', False), os.environ['HOME'])
 
+@testcase(1571)
 def test_parse_recipe(self):
 with bb.tinfoil.Tinfoil() as tinfoil:
 tinfoil.prepare(config_only=False, quiet=2)
@@ -43,6 +47,7 @@ class TinfoilTests(oeSelfTest):
 rd = tinfoil.parse_recipe_file(best[3])
 self.assertEqual(testrecipe, rd.getVar('PN'))
 
+@testcase(1572)
 def test_parse_recipe_copy_expand(self):
 with bb.tinfoil.Tinfoil() as tinfoil:
 tinfoil.prepare(config_only=False, quiet=2)
@@ -61,6 +66,7 @@ class TinfoilTests(oeSelfTest):
 localdata.setVar('PN', 'hello')
 self.assertEqual('hello', localdata.getVar('BPN'))
 
+@testcase(1573)
 def test_parse_recipe_initial_datastore(self):
 with bb.tinfoil.Tinfoil() as tinfoil:
 tinfoil.prepare(config_only=False, quiet=2)
@@ -74,6 +80,7 @@ class TinfoilTests(oeSelfTest):
 # Check we can get variable values
 self.assertEqual('somevalue', rd.getVar('MYVARIABLE'))
 
+@testcase(1574)
 def test_list_recipes(self):
 with bb.tinfoil.Tinfoil() as tinfoil:
 tinfoil.prepare(config_only=False, quiet=2)
@@ -92,6 +99,7 @@ class TinfoilTests(oeSelfTest):
 if checkpns:
 self.fail('Unable to find pkg_fn entries for: %s' % ', 
'.join(checkpns))
 
+@testcase(1575)
 def test_wait_event(self):
 with bb.tinfoil.Tinfoil() as tinfoil:
 tinfoil.prepare(config_only=True)
@@ -122,6 +130,7 @@ class TinfoilTests(oeSelfTest):
 self.assertNotEqual(waitcount, 0, 'Timed out waiting for 
CommandCompleted event from bitbake server')
 self.assertTrue(eventreceived, 'Did not receive FilesMatchingFound 
event from bitbake server')
 
+@testcase(1576)
 def test_setvariable_clean(self):
 # First check that setVariable affects the datastore
 with bb.tinfoil.Tinfoil() as tinfoil:
-- 
2.6.6

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] runtime: Add cleanup for logrotate tests

2017-01-06 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Delete logrotate dir to avoid errors
when test are executed more than 1
time on the same target.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/runtime/logrotate.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/lib/oeqa/runtime/logrotate.py 
b/meta/lib/oeqa/runtime/logrotate.py
index cf88c54..063280b 100644
--- a/meta/lib/oeqa/runtime/logrotate.py
+++ b/meta/lib/oeqa/runtime/logrotate.py
@@ -27,3 +27,4 @@ class LogrotateTest(oeRuntimeTest):
 self.assertEqual(status, 0, msg = "logrotate service could not be 
reloaded. Status and output: %s and %s" % (status, output))
 output = self.target.run('ls -la $HOME/logrotate_dir/ | wc -l')[1]
 self.assertTrue(int(output)>=3, msg = "new logfile could not be 
created. List of files within log directory: %s" %(self.target.run('ls -la 
$HOME/logrotate_dir')[1]))
+self.target.run('rm -rf $HOME/logrotate_dir')
-- 
2.1.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2] oe-tests: Migrate tests from /oe/test to /oeqa/selftest/oe-tests

2016-12-13 Thread Jose Perez Carranza



On 12/13/2016 10:32 AM, Burton, Ross wrote:


On 13 December 2016 at 16:17, Burton, Ross > wrote:


It took over a minute to load a few tests.  Do you have any idea
why the discovery is so slow?



at my host is very fast the load (1 second)

jgperezc@jgperezc:~/poky-oetest/build$ oe-selftest  -r oelib-tests.elf 
oelib-tests.license oelib-tests.path oelib-tests.types oelib-tests.utils

2016-12-13 10:48:28,333 - selftest - INFO - Running bitbake -e to get BBPATH
2016-12-13 10:48:29,125 - selftest - INFO - Checking that everything is 
in order before running the tests

2016-12-13 10:48:29,833 - selftest - INFO - Running bitbake -p
2016-12-13 10:48:52,181 - selftest - INFO - test runner init'ed like 
unittest
2016-12-13 10:48:52,995 - selftest - INFO - Loading tests from: 
oeqa.selftest.oelib-tests.elf
2016-12-13 10:48:52,998 - selftest - INFO - Loading tests from: 
oeqa.selftest.oelib-tests.license
2016-12-13 10:48:53,000 - selftest - INFO - Loading tests from: 
oeqa.selftest.oelib-tests.path
2016-12-13 10:48:53,001 - selftest - INFO - Loading tests from: 
oeqa.selftest.oelib-tests.types
2016-12-13 10:48:53,003 - selftest - INFO - Loading tests from: 
oeqa.selftest.oelib-tests.utils
2016-12-13 10:48:53,005 - selftest - INFO - Adding: "include 
selftest.inc" in local.conf
2016-12-13 10:48:53,005 - selftest - INFO - Adding: "include 
bblayers.inc" in bblayers.conf



Oh, it's because oeselftest does bitbake calls isn't it.

Good news: you don't need to use oeSelfTest at all, the discovery 
works fine with standard unittest.TestCase objects.


Patch incoming. :)


Ok, just wondering if oe-selftest -l will also list those test cases ??

Ross



--
Saludos
José

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] postinst: Add a test case to verify postinst scripts behavior

2016-12-06 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Add test case that verify behavior of postinst scripts at
roofts time and when is delayed to the first boot directly
on the target.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 .../recipes-test/postinst/postinst_1.0.bb  |  2 +
 meta/lib/oeqa/selftest/runtime-test.py | 61 ++
 2 files changed, 63 insertions(+)

diff --git a/meta-selftest/recipes-test/postinst/postinst_1.0.bb 
b/meta-selftest/recipes-test/postinst/postinst_1.0.bb
index 97a1987..6d49734 100644
--- a/meta-selftest/recipes-test/postinst/postinst_1.0.bb
+++ b/meta-selftest/recipes-test/postinst/postinst_1.0.bb
@@ -24,6 +24,7 @@ RDEPENDS_${PN}-delayed-t = "${PN}-delayed-p"
 # Main recipe post-install
 pkg_postinst_${PN}-at-rootfs () {
 tfile="/etc/postinsta-test"
+touch "$D"/this-was-created-at-rootfstime
 if test "x$D" != "x" then
 # Need to run on first boot
 exit 1
@@ -42,6 +43,7 @@ pkg_postinst_${PN}-delayed-a () {
   # Need to run on first boot
   exit 1
 else
+  touch /etc/this-was-created-at-first-boot
   if test -e $efile ; then
 echo 'success' > $tfile
   else
diff --git a/meta/lib/oeqa/selftest/runtime-test.py 
b/meta/lib/oeqa/selftest/runtime-test.py
index 1dbfae1..20caa97 100644
--- a/meta/lib/oeqa/selftest/runtime-test.py
+++ b/meta/lib/oeqa/selftest/runtime-test.py
@@ -155,3 +155,64 @@ postinst-delayed-t \
 elif found:
 self.assertEqual(idx, len(postinst_list), "Not found 
all postinsts")
 break
+
+@testcase(1545)
+def test_postinst_roofs_and_boot(self):
+"""
+Summary:The purpose of this test case is to verify 
Post-installation
+scripts are called when roofs is created and also test
+that script can be delayed to run at first boot.
+Dependencies:   NA
+Steps:  1. Add proper configuration to local.conf file
+2. Build a "core-image-full-cmdline" image
+3. Verify that file created by postinst_rootfs recipe 
is
+   present on rootfs dir.
+4. Boot the image created on qemu and verify that the 
file
+   created by postinst_boot recipe is present on image.
+5. Clean the packages and image created to test with
+   different package managers
+Expected:   The files are successfully created during rootfs and 
boot
+time for 3 different package managers: rpm,ipk,deb and
+for initialization managers: sysvinit and systemd.
+
+"""
+file_rootfs_name = "this-was-created-at-rootfstime"
+fileboot_name = "this-was-created-at-first-boot"
+rootfs_pkg = 'postinst-at-rootfs'
+boot_pkg = 'postinst-delayed-a'
+#Step 1
+features = 'MACHINE = "qemux86"\n'
+features += 'CORE_IMAGE_EXTRA_INSTALL += "%s %s "\n'% (rootfs_pkg, 
boot_pkg)
+for init_manager in ("sysvinit", "systemd"):
+#for sysvinit no extra configuration is needed,
+if (init_manager is "systemd"):
+features += 'DISTRO_FEATURES_append = " systemd"\n'
+features += 'VIRTUAL-RUNTIME_init_manager = "systemd"\n'
+features += 'DISTRO_FEATURES_BACKFILL_CONSIDERED = 
"sysvinit"\n'
+features += 'VIRTUAL-RUNTIME_initscripts = ""\n'
+for classes in ("package_rpm package_deb package_ipk",
+"package_deb package_rpm package_ipk",
+"package_ipk package_deb package_rpm"):
+features += 'PACKAGE_CLASSES = "%s"\n' % classes
+self.write_config(features)
+
+#Step 2
+bitbake('core-image-full-cmdline')
+
+#Step 3
+file_rootfs_created = 
os.path.join(get_bb_var('IMAGE_ROOTFS',"core-image-full-cmdline"),
+   file_rootfs_name)
+found = os.path.isfile(file_rootfs_created)
+self.assertTrue(found, "File %s was not created at rootfs time 
by %s" % \
+(file_rootfs_name, rootfs_pkg))
+
+#Step 4
+testcommand = 'ls /etc/'+fileboot_name
+with runqemu('core-image-full-cmdline') as qemu:
+sshargs = '-o UserKnownHostsFile=/dev/null -o 
StrictHostKeyChecking=no'
+  

[OE-core] [PATCH] runtime: Update test cases numbers for runtime tests

2016-11-24 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Update test case numbers on runtime tests to do match
with templates defined on Testopia for 2.3 release

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oeqa/runtime/buildgalculator.py | 1 +
 meta/lib/oeqa/runtime/kernelmodule.py| 2 +-
 meta/lib/oeqa/runtime/logrotate.py   | 3 ++-
 meta/lib/oeqa/runtime/pam.py | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oeqa/runtime/buildgalculator.py 
b/meta/lib/oeqa/runtime/buildgalculator.py
index 28ba29e..220101d 100644
--- a/meta/lib/oeqa/runtime/buildgalculator.py
+++ b/meta/lib/oeqa/runtime/buildgalculator.py
@@ -7,6 +7,7 @@ def setUpModule():
 skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
 
 class GalculatorTest(oeRuntimeTest):
+@testcase(1526)
 @skipUnlessPassed("test_ssh")
 def test_galculator(self):
 try:
diff --git a/meta/lib/oeqa/runtime/kernelmodule.py 
b/meta/lib/oeqa/runtime/kernelmodule.py
index 38ca184..2ac1bc9 100644
--- a/meta/lib/oeqa/runtime/kernelmodule.py
+++ b/meta/lib/oeqa/runtime/kernelmodule.py
@@ -14,7 +14,7 @@ class KernelModuleTest(oeRuntimeTest):
 self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, 
"hellomod.c"), "/tmp/hellomod.c")
 self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, 
"hellomod_makefile"), "/tmp/Makefile")
 
-@testcase('316')
+@testcase('1541')
 @skipUnlessPassed('test_ssh')
 @skipUnlessPassed('test_gcc_compile')
 def test_kernel_module(self):
diff --git a/meta/lib/oeqa/runtime/logrotate.py 
b/meta/lib/oeqa/runtime/logrotate.py
index de300bf..cf88c54 100644
--- a/meta/lib/oeqa/runtime/logrotate.py
+++ b/meta/lib/oeqa/runtime/logrotate.py
@@ -12,6 +12,7 @@ def setUpModule():
 
 class LogrotateTest(oeRuntimeTest):
 
+@testcase(1544)
 @skipUnlessPassed("test_ssh")
 def test_1_logrotate_setup(self):
 (status, output) = self.target.run('mkdir $HOME/logrotate_dir')
@@ -19,7 +20,7 @@ class LogrotateTest(oeRuntimeTest):
 (status, output) = self.target.run("sed -i \"s#wtmp {#wtmp {\\n
olddir $HOME/logrotate_dir#\" /etc/logrotate.conf")
 self.assertEqual(status, 0, msg = "Could not write to logrotate.conf 
file. Status and output: %s and %s)" % (status, output))
 
-@testcase(289)
+@testcase(1542)
 @skipUnlessPassed("test_1_logrotate_setup")
 def test_2_logrotate(self):
 (status, output) = self.target.run('logrotate -f /etc/logrotate.conf')
diff --git a/meta/lib/oeqa/runtime/pam.py b/meta/lib/oeqa/runtime/pam.py
index c8205c9..b7f2dfa 100644
--- a/meta/lib/oeqa/runtime/pam.py
+++ b/meta/lib/oeqa/runtime/pam.py
@@ -12,7 +12,7 @@ def setUpModule():
 
 class PamBasicTest(oeRuntimeTest):
 
-@testcase(287)
+@testcase(1543)
 @skipUnlessPassed('test_ssh')
 def test_pam(self):
 (status, output) = self.target.run('login --help')
-- 
2.1.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] Test needed to verify postinst script order.

2016-11-17 Thread Jose Perez Carranza



On 11/17/2016 06:14 AM, Burton, Ross wrote:


On 16 November 2016 at 00:50, Francisco Pedraza 
> wrote:


Will verify the following:
1. Compile a minimal image.
2. The compiled image will add the created layer with the
recipes postinstz postinsta postinstb postinstd postinstp postinstt
created previously at "meta-selftest/recipes-test"
2. Run qemu
3. Validate the task execution order.
V4


This is missing the test that some postinsts should be happening at 
rootfs time.
I have assigned the bug 8433 and I will send a different patch to add 
those test cases, I'm just waiting to the final implementation of this  
patch to be accepted to avoid execution and merge conflicts.


Also, can it permute PACKAGE_CLASSES (rotate through all three 
options) so it exercises all backends.


Signed-off-by: Francisco Pedraza
>
---
 .../recipes-test/postinsta/postinsta_1.0.bb
| 20 +++
 .../recipes-test/postinstb/postinstb_1.0.bb
| 22 
 .../recipes-test/postinstd/postinstd_1.0.bb
| 22 
 .../recipes-test/postinstp/postinstp_1.0.bb
| 22 
 .../recipes-test/postinstt/postinstt_1.0.bb
| 22 
 .../recipes-test/postinstz/postinstz_1.0.bb
| 12 +++


For clarity can all of these be squashed into a single recipe with 
clearer names?


Ross




-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] FW: [PATCH v2] oe-tests: Migrate tests from /oe/test to /oeqa/selftest/oe-tests

2016-11-17 Thread Jose Perez Carranza



On 11/15/2016 03:11 PM, Burton, Ross wrote:


On 15 November 2016 at 19:10, Benjamin Esquivel 
> wrote:


The reason for the migration of the tests is for them to be
included in the selftest execution. And for that execution, it
needs to base off of the oeSelfTest class.


Sounds like a problem with the discovery if it mandates oeselftest.  
Is there a reason why it can't also execute bare unittests?


  You are right this is a problem on the suite right now AFAIK there 
will pbe a fix for this on oeqa2 framework adding Marian and Anibal to 
the loop to give an in put on this.

Ross


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH v2] oe-tests: Migrate tests from /oe/test to /oeqa/selftest/oe-tests

2016-11-15 Thread Jose Perez Carranza



On 11/15/2016 11:16 AM, Burton, Ross wrote:


On 15 November 2016 at 16:24, > wrote:


+class TestPackagesFilterOutSystem(oeSelfTest):


As the tests don't need anything special that oeSelfTest provides, can 
they remain as testcase.TestCase instances? There's a lot of 
complication from oeSelfTest that isn't required.


In order to the test cases be recognized and executed as part of the 
suite they need to be in the same context of selftest hence be an 
instance of oeSelftest.

Ross


-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] oe-tests: Migrate tests from /oe/test to /oeqa/selftest/oe-tests

2016-11-15 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Currently the unittests for scripts on meta/lib/oe/tests are not being
executed by any suite hence the best option is migrate them to
meta/lib/oeqa/selftest/oelib-tests to be executed along with the selftest suite.

[YOCTO #7376]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oe/tests/__init__.py  |  0
 meta/lib/oe/tests/test_elf.py  | 21 --
 meta/lib/oe/tests/test_license.py  | 68 ---
 meta/lib/oe/tests/test_path.py | 89 -
 meta/lib/oe/tests/test_types.py| 62 --
 meta/lib/oe/tests/test_utils.py| 51 ---
 meta/lib/oeqa/selftest/oelib-tests/__init__.py |  0
 meta/lib/oeqa/selftest/oelib-tests/elf.py  | 22 +++
 meta/lib/oeqa/selftest/oelib-tests/license.py  | 69 
 meta/lib/oeqa/selftest/oelib-tests/path.py | 90 ++
 meta/lib/oeqa/selftest/oelib-tests/types.py| 61 +
 meta/lib/oeqa/selftest/oelib-tests/utils.py| 52 +++
 12 files changed, 294 insertions(+), 291 deletions(-)
 delete mode 100644 meta/lib/oe/tests/__init__.py
 delete mode 100644 meta/lib/oe/tests/test_elf.py
 delete mode 100644 meta/lib/oe/tests/test_license.py
 delete mode 100644 meta/lib/oe/tests/test_path.py
 delete mode 100644 meta/lib/oe/tests/test_types.py
 delete mode 100644 meta/lib/oe/tests/test_utils.py
 create mode 100644 meta/lib/oeqa/selftest/oelib-tests/__init__.py
 create mode 100644 meta/lib/oeqa/selftest/oelib-tests/elf.py
 create mode 100644 meta/lib/oeqa/selftest/oelib-tests/license.py
 create mode 100644 meta/lib/oeqa/selftest/oelib-tests/path.py
 create mode 100644 meta/lib/oeqa/selftest/oelib-tests/types.py
 create mode 100644 meta/lib/oeqa/selftest/oelib-tests/utils.py

diff --git a/meta/lib/oe/tests/__init__.py b/meta/lib/oe/tests/__init__.py
deleted file mode 100644
index e69de29..000
diff --git a/meta/lib/oe/tests/test_elf.py b/meta/lib/oe/tests/test_elf.py
deleted file mode 100644
index 1f59037..000
--- a/meta/lib/oe/tests/test_elf.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import unittest
-import oe.qa
-
-class TestElf(unittest.TestCase):
-def test_machine_name(self):
-"""
-Test elf_machine_to_string()
-"""
-self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
-self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
-self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
-self.assertEqual(oe.qa.elf_machine_to_string(0x14), "PowerPC")
-self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
-self.assertEqual(oe.qa.elf_machine_to_string(0x2A), "SuperH")
-self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
-self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64")
-self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64")
-
-self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown (0)")
-self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown 
(3735928559)")
-self.assertEqual(oe.qa.elf_machine_to_string("foobar"), "Unknown 
('foobar')")
diff --git a/meta/lib/oe/tests/test_license.py 
b/meta/lib/oe/tests/test_license.py
deleted file mode 100644
index c36..000
--- a/meta/lib/oe/tests/test_license.py
+++ /dev/null
@@ -1,68 +0,0 @@
-import unittest
-import oe.license
-
-class SeenVisitor(oe.license.LicenseVisitor):
-def __init__(self):
-self.seen = []
-oe.license.LicenseVisitor.__init__(self)
-
-def visit_Str(self, node):
-self.seen.append(node.s)
-
-class TestSingleLicense(unittest.TestCase):
-licenses = [
-"GPLv2",
-"LGPL-2.0",
-"Artistic",
-"MIT",
-"GPLv3+",
-"FOO_BAR",
-]
-invalid_licenses = ["GPL/BSD"]
-
-@staticmethod
-def parse(licensestr):
-visitor = SeenVisitor()
-visitor.visit_string(licensestr)
-return visitor.seen
-
-def test_single_licenses(self):
-for license in self.licenses:
-licenses = self.parse(license)
-self.assertListEqual(licenses, [license])
-
-def test_invalid_licenses(self):
-for license in self.invalid_licenses:
-with self.assertRaises(oe.license.InvalidLicense) as cm:
-self.parse(license)
-self.assertEqual(cm.exception.license, license)
-
-class TestSimpleCombinations(unittest.TestCase):
-tests = {
-"FOO": ["FOO", "BAR"],
-"BAZ & MOO": ["BAZ"

Re: [OE-core] [PATCH] oe-tests: Migrate tests from /oe/test to /oeqa/selftest/oe-tests

2016-11-10 Thread Jose Perez Carranza

On 11/03/2016 06:12 PM, Benjamin Esquivel wrote:

Hello José, a couple of comments below.

On Thu, 2016-11-03 at 17:46 -0500, jose.perez.carra...@linux.intel.com
wrote:

From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Currently the unittests for scripts on meta/lib/oe are not being
executed by any suite hence the best option is migrate them to
meta/lib/oeqa/selftest to be executed along with the selftest suite.


How much more time do these tests add to a selftest execution?

Those test cases runs very fast, in about 1 minute all of them

[YOCTO #7376]

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.c
om>
---
  meta/lib/oe/tests/__init__.py   |  0
  meta/lib/oe/tests/test_elf.py   | 21 ---
  meta/lib/oe/tests/test_license.py   | 68 -
-
  meta/lib/oe/tests/test_path.py  | 89 -
---
  meta/lib/oe/tests/test_types.py | 62 -
---
  meta/lib/oe/tests/test_utils.py | 51 
  meta/lib/oeqa/selftest/oe_tests/__init__.py |  0
  meta/lib/oeqa/selftest/oe_tests/elf.py  | 22 +++
  meta/lib/oeqa/selftest/oe_tests/license.py  | 69
++
  meta/lib/oeqa/selftest/oe_tests/path.py | 90
+
  meta/lib/oeqa/selftest/oe_tests/types.py| 61 +++
  meta/lib/oeqa/selftest/oe_tests/utils.py| 52 +
  12 files changed, 294 insertions(+), 291 deletions(-)
  delete mode 100644 meta/lib/oe/tests/__init__.py
  delete mode 100644 meta/lib/oe/tests/test_elf.py
  delete mode 100644 meta/lib/oe/tests/test_license.py
  delete mode 100644 meta/lib/oe/tests/test_path.py
  delete mode 100644 meta/lib/oe/tests/test_types.py
  delete mode 100644 meta/lib/oe/tests/test_utils.py
  create mode 100644 meta/lib/oeqa/selftest/oe_tests/__init__.py

selftest has no other dir in it and this dir name of oe_test makes
little sense if you see it in the context of oeqa/selftest/oe_test. I
suggest using a dir name that brings some additional info as to what is
inside of it or try and see how to integrate these tests into the
selftest/ plain structure.
integrate on the root of selftest is easy but I don't know if its the 
best option as those test are very specific unit test for scripts that 
are under meta/lib/oe that is why I used oe_test/ . Do you have any 
suggestion on the name of the dir?

  create mode 100644 meta/lib/oeqa/selftest/oe_tests/elf.py
  create mode 100644 meta/lib/oeqa/selftest/oe_tests/license.py
  create mode 100644 meta/lib/oeqa/selftest/oe_tests/path.py
  create mode 100644 meta/lib/oeqa/selftest/oe_tests/types.py
  create mode 100644 meta/lib/oeqa/selftest/oe_tests/utils.py

diff --git a/meta/lib/oe/tests/__init__.py
b/meta/lib/oe/tests/__init__.py
deleted file mode 100644
index e69de29..000
diff --git a/meta/lib/oe/tests/test_elf.py
b/meta/lib/oe/tests/test_elf.py
deleted file mode 100644
index 1f59037..000
--- a/meta/lib/oe/tests/test_elf.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import unittest
-import oe.qa
-
-class TestElf(unittest.TestCase):
-def test_machine_name(self):
-"""
-Test elf_machine_to_string()
-"""
-self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
-self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
-self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
-self.assertEqual(oe.qa.elf_machine_to_string(0x14),
"PowerPC")
-self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
-self.assertEqual(oe.qa.elf_machine_to_string(0x2A),
"SuperH")
-self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
-self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-
64")
-self.assertEqual(oe.qa.elf_machine_to_string(0xB7),
"AArch64")
-
-self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown
(0)")
-self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF),
"Unknown (3735928559)")
-self.assertEqual(oe.qa.elf_machine_to_string("foobar"),
"Unknown ('foobar')")
diff --git a/meta/lib/oe/tests/test_license.py
b/meta/lib/oe/tests/test_license.py
deleted file mode 100644
index c36..000
--- a/meta/lib/oe/tests/test_license.py
+++ /dev/null
@@ -1,68 +0,0 @@
-import unittest
-import oe.license
-
-class SeenVisitor(oe.license.LicenseVisitor):
-def __init__(self):
-self.seen = []
-oe.license.LicenseVisitor.__init__(self)
-
-def visit_Str(self, node):
-self.seen.append(node.s)
-
-class TestSingleLicense(unittest.TestCase):
-licenses = [
-"GPLv2",
-"LGPL-2.0",
-"Artistic",
-"MIT",
-"GPLv3+",
-"FOO_BAR",

[OE-core] [PATCH] oe-tests: Migrate tests from /oe/test to /oeqa/selftest/oe-tests

2016-11-03 Thread jose . perez . carranza
From: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>

Currently the unittests for scripts on meta/lib/oe are not being
executed by any suite hence the best option is migrate them to
meta/lib/oeqa/selftest to be executed along with the selftest suite.

[YOCTO #7376]

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@linux.intel.com>
---
 meta/lib/oe/tests/__init__.py   |  0
 meta/lib/oe/tests/test_elf.py   | 21 ---
 meta/lib/oe/tests/test_license.py   | 68 --
 meta/lib/oe/tests/test_path.py  | 89 
 meta/lib/oe/tests/test_types.py | 62 
 meta/lib/oe/tests/test_utils.py | 51 
 meta/lib/oeqa/selftest/oe_tests/__init__.py |  0
 meta/lib/oeqa/selftest/oe_tests/elf.py  | 22 +++
 meta/lib/oeqa/selftest/oe_tests/license.py  | 69 ++
 meta/lib/oeqa/selftest/oe_tests/path.py | 90 +
 meta/lib/oeqa/selftest/oe_tests/types.py| 61 +++
 meta/lib/oeqa/selftest/oe_tests/utils.py| 52 +
 12 files changed, 294 insertions(+), 291 deletions(-)
 delete mode 100644 meta/lib/oe/tests/__init__.py
 delete mode 100644 meta/lib/oe/tests/test_elf.py
 delete mode 100644 meta/lib/oe/tests/test_license.py
 delete mode 100644 meta/lib/oe/tests/test_path.py
 delete mode 100644 meta/lib/oe/tests/test_types.py
 delete mode 100644 meta/lib/oe/tests/test_utils.py
 create mode 100644 meta/lib/oeqa/selftest/oe_tests/__init__.py
 create mode 100644 meta/lib/oeqa/selftest/oe_tests/elf.py
 create mode 100644 meta/lib/oeqa/selftest/oe_tests/license.py
 create mode 100644 meta/lib/oeqa/selftest/oe_tests/path.py
 create mode 100644 meta/lib/oeqa/selftest/oe_tests/types.py
 create mode 100644 meta/lib/oeqa/selftest/oe_tests/utils.py

diff --git a/meta/lib/oe/tests/__init__.py b/meta/lib/oe/tests/__init__.py
deleted file mode 100644
index e69de29..000
diff --git a/meta/lib/oe/tests/test_elf.py b/meta/lib/oe/tests/test_elf.py
deleted file mode 100644
index 1f59037..000
--- a/meta/lib/oe/tests/test_elf.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import unittest
-import oe.qa
-
-class TestElf(unittest.TestCase):
-def test_machine_name(self):
-"""
-Test elf_machine_to_string()
-"""
-self.assertEqual(oe.qa.elf_machine_to_string(0x02), "SPARC")
-self.assertEqual(oe.qa.elf_machine_to_string(0x03), "x86")
-self.assertEqual(oe.qa.elf_machine_to_string(0x08), "MIPS")
-self.assertEqual(oe.qa.elf_machine_to_string(0x14), "PowerPC")
-self.assertEqual(oe.qa.elf_machine_to_string(0x28), "ARM")
-self.assertEqual(oe.qa.elf_machine_to_string(0x2A), "SuperH")
-self.assertEqual(oe.qa.elf_machine_to_string(0x32), "IA-64")
-self.assertEqual(oe.qa.elf_machine_to_string(0x3E), "x86-64")
-self.assertEqual(oe.qa.elf_machine_to_string(0xB7), "AArch64")
-
-self.assertEqual(oe.qa.elf_machine_to_string(0x00), "Unknown (0)")
-self.assertEqual(oe.qa.elf_machine_to_string(0xDEADBEEF), "Unknown 
(3735928559)")
-self.assertEqual(oe.qa.elf_machine_to_string("foobar"), "Unknown 
('foobar')")
diff --git a/meta/lib/oe/tests/test_license.py 
b/meta/lib/oe/tests/test_license.py
deleted file mode 100644
index c36..000
--- a/meta/lib/oe/tests/test_license.py
+++ /dev/null
@@ -1,68 +0,0 @@
-import unittest
-import oe.license
-
-class SeenVisitor(oe.license.LicenseVisitor):
-def __init__(self):
-self.seen = []
-oe.license.LicenseVisitor.__init__(self)
-
-def visit_Str(self, node):
-self.seen.append(node.s)
-
-class TestSingleLicense(unittest.TestCase):
-licenses = [
-"GPLv2",
-"LGPL-2.0",
-"Artistic",
-"MIT",
-"GPLv3+",
-"FOO_BAR",
-]
-invalid_licenses = ["GPL/BSD"]
-
-@staticmethod
-def parse(licensestr):
-visitor = SeenVisitor()
-visitor.visit_string(licensestr)
-return visitor.seen
-
-def test_single_licenses(self):
-for license in self.licenses:
-licenses = self.parse(license)
-self.assertListEqual(licenses, [license])
-
-def test_invalid_licenses(self):
-for license in self.invalid_licenses:
-with self.assertRaises(oe.license.InvalidLicense) as cm:
-self.parse(license)
-self.assertEqual(cm.exception.license, license)
-
-class TestSimpleCombinations(unittest.TestCase):
-tests = {
-"FOO": ["FOO", "BAR"],
-"BAZ & MOO": ["BAZ", "MOO"],
-"ALPHA|B

[OE-core] [PATCH] buildperf: Add support for times without decimal part

2016-08-10 Thread Jose Perez Carranza
Add logic for the cases when the time retrieved does
not have decimal part.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@intel.com>
---
 meta/lib/oeqa/buildperf/base.py | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index 527563b..1eb21f6 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -244,7 +244,11 @@ class BuildPerfTest(object):
 split = strtime.split(':')
 hours = int(split[0]) if len(split) > 2 else 0
 mins = int(split[-2])
-secs, frac = split[-1].split('.')
+try:
+secs, frac = split[-1].split('.')
+except:
+secs = split[-1]
+frac = '0'
 secs = int(secs)
 microsecs = int(float('0.' + frac) * pow(10, 6))
 return timedelta(0, hours*3600 + mins*60 + secs, microsecs)
-- 
1.9.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] oeqa/controllers: Add test target for Systemd-boot

2016-07-13 Thread Jose Perez Carranza
A new test target is neede to test Systemd-boot similar
to gummiboot. Created a copy of GummibootTarget class
and named as SystemdbootTarget, at this point the
gummibootTarget will remain until documentation is
updated with new systed information.

Signed-off-by: Jose Perez Carranza <jose.perez.carra...@intel.com>
---
 meta/lib/oeqa/controllers/masterimage.py | 40 
 1 file changed, 40 insertions(+)

diff --git a/meta/lib/oeqa/controllers/masterimage.py 
b/meta/lib/oeqa/controllers/masterimage.py
index 4cb7553..9ce3bf8 100644
--- a/meta/lib/oeqa/controllers/masterimage.py
+++ b/meta/lib/oeqa/controllers/masterimage.py
@@ -197,3 +197,43 @@ class GummibootTarget(MasterImageHardwareTarget):
 self.power_cycle(self.master)
 # there are better ways than a timeout but this should work for now
 time.sleep(120)
+
+
+class SystemdbootTarget(MasterImageHardwareTarget):
+
+def __init__(self, d):
+super(SystemdbootTarget, self).__init__(d)
+# this the value we need to set in the LoaderEntryOneShot EFI variable
+# so the system boots the 'test' bootloader label and not the default
+# The first four bytes are EFI bits, and the rest is an utf-16le string
+# (EFI vars values need to be utf-16)
+# $ echo -en "test\0" | iconv -f ascii -t utf-16le | hexdump -C
+#   74 00 65 00 73 00 74 00  00 00
|t.e.s.t...|
+self.efivarvalue = 
r'\x07\x00\x00\x00\x74\x00\x65\x00\x73\x00\x74\x00\x00\x00'
+self.deploy_cmds = [
+'mount -L boot /boot',
+'mkdir -p /mnt/testrootfs',
+'mount -L testrootfs /mnt/testrootfs',
+'modprobe efivarfs',
+'mount -t efivarfs efivarfs /sys/firmware/efi/efivars',
+'cp ~/test-kernel /boot',
+'rm -rf /mnt/testrootfs/*',
+'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % 
self.image_fstype,
+'printf "%s" > 
/sys/firmware/efi/efivars/LoaderEntryOneShot-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f'
 % self.efivarvalue
+]
+
+def _deploy(self):
+# make sure these aren't mounted
+self.master.run("umount /boot; umount /mnt/testrootfs; umount 
/sys/firmware/efi/efivars;")
+# from now on, every deploy cmd should return 0
+# else an exception will be thrown by sshcontrol
+self.master.ignore_status = False
+self.master.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype)
+self.master.copy_to(self.kernel, "~/test-kernel")
+for cmd in self.deploy_cmds:
+self.master.run(cmd)
+
+def _start(self, params=None):
+self.power_cycle(self.master)
+# there are better ways than a timeout but this should work for now
+time.sleep(120)
-- 
1.9.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core