All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] selftest/commands: extend variable regex to include A_B variable notation
@ 2017-04-04 16:45 leonardo.sandoval.gonzalez
  2017-04-04 16:45 ` [PATCH 2/2] selftest/devtool: use kernel provider instead of recipe allowing other kernel providers leonardo.sandoval.gonzalez
  0 siblings, 1 reply; 2+ messages in thread
From: leonardo.sandoval.gonzalez @ 2017-04-04 16:45 UTC (permalink / raw)
  To: openembedded-core

From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>

This change allows quering for variables with the format A_B, i.e.
PREFERRED_PROVIDER_virtual/kernel instead of just A.

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
---
 meta/lib/oeqa/utils/commands.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 2951dfb..57286fc 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -165,7 +165,7 @@ def get_bb_vars(variables=None, target=None, postconfig=None):
 
     if variables is not None:
         variables = variables.copy()
-    var_re = re.compile(r'^(export )?(?P<var>\w+)="(?P<value>.*)"$')
+    var_re = re.compile(r'^(export )?(?P<var>\w+(_.*)?)="(?P<value>.*)"$')
     unset_re = re.compile(r'^unset (?P<var>\w+)$')
     lastline = None
     values = {}
-- 
2.10.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] selftest/devtool: use kernel provider instead of recipe allowing other kernel providers
  2017-04-04 16:45 [PATCH 1/2] selftest/commands: extend variable regex to include A_B variable notation leonardo.sandoval.gonzalez
@ 2017-04-04 16:45 ` leonardo.sandoval.gonzalez
  0 siblings, 0 replies; 2+ messages in thread
From: leonardo.sandoval.gonzalez @ 2017-04-04 16:45 UTC (permalink / raw)
  To: openembedded-core

From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>

To generalize the unit test for other kernel providers, use virtual/kernel instead
of linux-yocto, allowing to run the selftest on non-poky distros, i.e. poky-tiny.

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
---
 meta/lib/oeqa/selftest/devtool.py | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 7e65e52..762c7ba 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -1636,18 +1636,19 @@ class DevtoolTests(DevtoolBase):
         #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('linux-yocto -c cleansstate')
+        bitbake('%s -c cleansstate' % kernel_provider)
         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')
+        self.add_command_to_tearDown('bitbake -c clean %s' % kernel_provider)
         #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')
+        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))
@@ -1656,7 +1657,7 @@ class DevtoolTests(DevtoolBase):
 
         tmpconfig = os.path.join(buildir, '.config')
         #Step 3
-        bitbake('linux-yocto -c clean')
+        bitbake('%s -c clean' % kernel_provider)
         #Step 4.1
         runCmd('devtool modify virtual/kernel -x %s' % tempdir)
         self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')),
@@ -1666,10 +1667,10 @@ class DevtoolTests(DevtoolBase):
         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')
+        #NOTE: virtual/kernel is mapped to kernel_provider
+        result = runCmd('devtool build %s' % kernel_provider)
         self.assertEqual(0,result.status,'Cannot build kernel using `devtool build`')
-        kernelfile = os.path.join(get_bb_var('KBUILD_OUTPUT',"linux-yocto"), 'vmlinux')
+        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
@@ -1683,11 +1684,11 @@ class DevtoolTests(DevtoolBase):
         modconf = runCmd("sed -i 's/CONFIG_SG_POOL=y/%s/' %s" % (modconfopt, codeconfigfile))
         self.assertEqual(0,modconf.status,'Modification to %s failed' % codeconfigfile)
         #Build again kernel with devtool
-        rebuild = runCmd('devtool build linux-yocto')
+        rebuild = runCmd('devtool build %s' % kernel_provider)
         self.assertEqual(0,rebuild.status,'Fail to build kernel after modification of source and config')
         #Step 4.4
-        bzimagename = 'bzImage-' + get_bb_var('KERNEL_VERSION_NAME',"linux-yocto")
-        bzimagefile = os.path.join(get_bb_var('D',"linux-yocto"),'boot', bzimagename)
+        bzimagename = 'bzImage-' + get_bb_var('KERNEL_VERSION_NAME', kernel_provider)
+        bzimagefile = os.path.join(get_bb_var('D', kernel_provider),'boot', bzimagename)
         checkmodcode = runCmd("grep '%s' %s" % (modstring, bzimagefile))
         self.assertEqual(0,checkmodcode.status,'Modification on kernel source failed')
         #Step 4.5
-- 
2.10.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-04 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04 16:45 [PATCH 1/2] selftest/commands: extend variable regex to include A_B variable notation leonardo.sandoval.gonzalez
2017-04-04 16:45 ` [PATCH 2/2] selftest/devtool: use kernel provider instead of recipe allowing other kernel providers leonardo.sandoval.gonzalez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.