From a5f6739f23dda738c7b1862c672b9d9cdec8190e Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Tue, 5 Dec 2017 14:08:22 +1300 Subject: oe-selftest: devtool: fix kernel test for multisrc changes Fix the oe-selftest test to understand that the source will be found in a "source" subdirectory if the kernel inherits linux-yocto since there are multiple trees extracted. Signed-off-by: Paul Eggleton --- meta/lib/oeqa/selftest/cases/devtool.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index b3063de698..96072be189 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py @@ -1676,9 +1676,14 @@ class DevtoolTests(DevtoolBase): bitbake('%s -c clean' % kernel_provider) #Step 4.1 runCmd('devtool modify virtual/kernel -x %s' % tempdir) - self.assertExists(os.path.join(tempdir, 'Makefile'), 'Extracted source could not be found') + # If it's linux-yocto, we'll have two "source" trees (one the actual source, + # the other the kernel metadata) + tempsrc = os.path.join(tempdir, 'source') + if not os.path.isdir(tempsrc): + tempsrc = tempdir + self.assertExists(os.path.join(tempsrc, 'Makefile'), 'Extracted source could not be found') #Step 4.2 - configfile = os.path.join(tempdir,'.config') + configfile = os.path.join(tempsrc, '.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 @@ -1689,12 +1694,12 @@ class DevtoolTests(DevtoolBase): self.assertExists(kernelfile, 'Kernel was not build correctly') #Modify the kernel source - modfile = os.path.join(tempdir,'arch/x86/boot/header.S') + modfile = os.path.join(tempsrc, 'arch/x86/boot/header.S') 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') + codeconfigfile = os.path.join(tempsrc, '.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' % codeconfigfile) -- cgit 1.2.3-korg