summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/devtool.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/devtool.py')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py57
1 files changed, 34 insertions, 23 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 8bf9f05bb9..f1661efeb1 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -213,9 +213,10 @@ class DevtoolTests(DevtoolBase):
213 bitbake('pv -c cleansstate') 213 bitbake('pv -c cleansstate')
214 # Test devtool build 214 # Test devtool build
215 result = runCmd('devtool build pv') 215 result = runCmd('devtool build pv')
216 installdir = get_bb_var('D', 'pv') 216 bb_vars = get_bb_vars(['D', 'bindir'], 'pv')
217 installdir = bb_vars['D']
217 self.assertTrue(installdir, 'Could not query installdir variable') 218 self.assertTrue(installdir, 'Could not query installdir variable')
218 bindir = get_bb_var('bindir', 'pv') 219 bindir = bb_vars['bindir']
219 self.assertTrue(bindir, 'Could not query bindir variable') 220 self.assertTrue(bindir, 'Could not query bindir variable')
220 if bindir[0] == '/': 221 if bindir[0] == '/':
221 bindir = bindir[1:] 222 bindir = bindir[1:]
@@ -296,11 +297,12 @@ class DevtoolTests(DevtoolBase):
296 f.write('\nTESTLIBOUTPUT = "${STAGING_DIR}-components/${TUNE_PKGARCH}/${PN}/${libdir}"\n') 297 f.write('\nTESTLIBOUTPUT = "${STAGING_DIR}-components/${TUNE_PKGARCH}/${PN}/${libdir}"\n')
297 # Test devtool build 298 # Test devtool build
298 result = runCmd('devtool build libftdi') 299 result = runCmd('devtool build libftdi')
299 staging_libdir = get_bb_var('TESTLIBOUTPUT', 'libftdi') 300 bb_vars = get_bb_vars(['TESTLIBOUTPUT', 'STAMP'], 'libftdi')
301 staging_libdir = bb_vars['TESTLIBOUTPUT']
300 self.assertTrue(staging_libdir, 'Could not query TESTLIBOUTPUT variable') 302 self.assertTrue(staging_libdir, 'Could not query TESTLIBOUTPUT variable')
301 self.assertTrue(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), "libftdi binary not found in STAGING_LIBDIR. Output of devtool build libftdi %s" % result.output) 303 self.assertTrue(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), "libftdi binary not found in STAGING_LIBDIR. Output of devtool build libftdi %s" % result.output)
302 # Test devtool reset 304 # Test devtool reset
303 stampprefix = get_bb_var('STAMP', 'libftdi') 305 stampprefix = bb_vars['STAMP']
304 result = runCmd('devtool reset libftdi') 306 result = runCmd('devtool reset libftdi')
305 result = runCmd('devtool status') 307 result = runCmd('devtool status')
306 self.assertNotIn('libftdi', result.output) 308 self.assertNotIn('libftdi', result.output)
@@ -463,9 +465,10 @@ class DevtoolTests(DevtoolBase):
463 self.assertNotIn(expected + '\n', f, message) 465 self.assertNotIn(expected + '\n', f, message)
464 466
465 modfile = os.path.join(tempdir, 'mdadm.8.in') 467 modfile = os.path.join(tempdir, 'mdadm.8.in')
466 pkgd = get_bb_var('PKGD', 'mdadm') 468 bb_vars = get_bb_vars(['PKGD', 'mandir'], 'mdadm')
469 pkgd = bb_vars['PKGD']
467 self.assertTrue(pkgd, 'Could not query PKGD variable') 470 self.assertTrue(pkgd, 'Could not query PKGD variable')
468 mandir = get_bb_var('mandir', 'mdadm') 471 mandir = bb_vars['mandir']
469 self.assertTrue(mandir, 'Could not query mandir variable') 472 self.assertTrue(mandir, 'Could not query mandir variable')
470 manfile = oe.path.join(pkgd, mandir, 'man8', 'mdadm.8') 473 manfile = oe.path.join(pkgd, mandir, 'man8', 'mdadm.8')
471 474
@@ -679,8 +682,9 @@ class DevtoolTests(DevtoolBase):
679 def test_devtool_update_recipe(self): 682 def test_devtool_update_recipe(self):
680 # Check preconditions 683 # Check preconditions
681 testrecipe = 'minicom' 684 testrecipe = 'minicom'
682 recipefile = get_bb_var('FILE', testrecipe) 685 bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
683 src_uri = get_bb_var('SRC_URI', testrecipe) 686 recipefile = bb_vars['FILE']
687 src_uri = bb_vars['SRC_URI']
684 self.assertNotIn('git://', src_uri, 'This test expects the %s recipe to NOT be a git recipe' % testrecipe) 688 self.assertNotIn('git://', src_uri, 'This test expects the %s recipe to NOT be a git recipe' % testrecipe)
685 self._check_repo_status(os.path.dirname(recipefile), []) 689 self._check_repo_status(os.path.dirname(recipefile), [])
686 # First, modify a recipe 690 # First, modify a recipe
@@ -711,8 +715,9 @@ class DevtoolTests(DevtoolBase):
711 def test_devtool_update_recipe_git(self): 715 def test_devtool_update_recipe_git(self):
712 # Check preconditions 716 # Check preconditions
713 testrecipe = 'mtd-utils' 717 testrecipe = 'mtd-utils'
714 recipefile = get_bb_var('FILE', testrecipe) 718 bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
715 src_uri = get_bb_var('SRC_URI', testrecipe) 719 recipefile = bb_vars['FILE']
720 src_uri = bb_vars['SRC_URI']
716 self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe) 721 self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
717 patches = [] 722 patches = []
718 for entry in src_uri.split(): 723 for entry in src_uri.split():
@@ -780,8 +785,9 @@ class DevtoolTests(DevtoolBase):
780 def test_devtool_update_recipe_append(self): 785 def test_devtool_update_recipe_append(self):
781 # Check preconditions 786 # Check preconditions
782 testrecipe = 'mdadm' 787 testrecipe = 'mdadm'
783 recipefile = get_bb_var('FILE', testrecipe) 788 bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
784 src_uri = get_bb_var('SRC_URI', testrecipe) 789 recipefile = bb_vars['FILE']
790 src_uri = bb_vars['SRC_URI']
785 self.assertNotIn('git://', src_uri, 'This test expects the %s recipe to NOT be a git recipe' % testrecipe) 791 self.assertNotIn('git://', src_uri, 'This test expects the %s recipe to NOT be a git recipe' % testrecipe)
786 self._check_repo_status(os.path.dirname(recipefile), []) 792 self._check_repo_status(os.path.dirname(recipefile), [])
787 # First, modify a recipe 793 # First, modify a recipe
@@ -848,8 +854,9 @@ class DevtoolTests(DevtoolBase):
848 def test_devtool_update_recipe_append_git(self): 854 def test_devtool_update_recipe_append_git(self):
849 # Check preconditions 855 # Check preconditions
850 testrecipe = 'mtd-utils' 856 testrecipe = 'mtd-utils'
851 recipefile = get_bb_var('FILE', testrecipe) 857 bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
852 src_uri = get_bb_var('SRC_URI', testrecipe) 858 recipefile = bb_vars['FILE']
859 src_uri = bb_vars['SRC_URI']
853 self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe) 860 self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
854 for entry in src_uri.split(): 861 for entry in src_uri.split():
855 if entry.startswith('git://'): 862 if entry.startswith('git://'):
@@ -1009,8 +1016,9 @@ class DevtoolTests(DevtoolBase):
1009 def test_devtool_update_recipe_local_files_3(self): 1016 def test_devtool_update_recipe_local_files_3(self):
1010 # First, modify the recipe 1017 # First, modify the recipe
1011 testrecipe = 'devtool-test-localonly' 1018 testrecipe = 'devtool-test-localonly'
1012 recipefile = get_bb_var('FILE', testrecipe) 1019 bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
1013 src_uri = get_bb_var('SRC_URI', testrecipe) 1020 recipefile = bb_vars['FILE']
1021 src_uri = bb_vars['SRC_URI']
1014 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 1022 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
1015 self.track_for_cleanup(tempdir) 1023 self.track_for_cleanup(tempdir)
1016 self.track_for_cleanup(self.workspacedir) 1024 self.track_for_cleanup(self.workspacedir)
@@ -1027,8 +1035,9 @@ class DevtoolTests(DevtoolBase):
1027 def test_devtool_update_recipe_local_patch_gz(self): 1035 def test_devtool_update_recipe_local_patch_gz(self):
1028 # First, modify the recipe 1036 # First, modify the recipe
1029 testrecipe = 'devtool-test-patch-gz' 1037 testrecipe = 'devtool-test-patch-gz'
1030 recipefile = get_bb_var('FILE', testrecipe) 1038 bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
1031 src_uri = get_bb_var('SRC_URI', testrecipe) 1039 recipefile = bb_vars['FILE']
1040 src_uri = bb_vars['SRC_URI']
1032 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 1041 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
1033 self.track_for_cleanup(tempdir) 1042 self.track_for_cleanup(tempdir)
1034 self.track_for_cleanup(self.workspacedir) 1043 self.track_for_cleanup(self.workspacedir)
@@ -1054,8 +1063,9 @@ class DevtoolTests(DevtoolBase):
1054 # was also in SRC_URI 1063 # was also in SRC_URI
1055 # First, modify the recipe 1064 # First, modify the recipe
1056 testrecipe = 'devtool-test-subdir' 1065 testrecipe = 'devtool-test-subdir'
1057 recipefile = get_bb_var('FILE', testrecipe) 1066 bb_vars = get_bb_vars(['FILE', 'SRC_URI'], testrecipe)
1058 src_uri = get_bb_var('SRC_URI', testrecipe) 1067 recipefile = bb_vars['FILE']
1068 src_uri = bb_vars['SRC_URI']
1059 tempdir = tempfile.mkdtemp(prefix='devtoolqa') 1069 tempdir = tempfile.mkdtemp(prefix='devtoolqa')
1060 self.track_for_cleanup(tempdir) 1070 self.track_for_cleanup(tempdir)
1061 self.track_for_cleanup(self.workspacedir) 1071 self.track_for_cleanup(self.workspacedir)
@@ -1184,9 +1194,10 @@ class DevtoolTests(DevtoolBase):
1184 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand)) 1194 result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
1185 # Check if it deployed all of the files with the right ownership/perms 1195 # Check if it deployed all of the files with the right ownership/perms
1186 # First look on the host - need to do this under pseudo to get the correct ownership/perms 1196 # First look on the host - need to do this under pseudo to get the correct ownership/perms
1187 installdir = get_bb_var('D', testrecipe) 1197 bb_vars = get_bb_vars(['D', 'FAKEROOTENV', 'FAKEROOTCMD'], testrecipe)
1188 fakerootenv = get_bb_var('FAKEROOTENV', testrecipe) 1198 installdir = bb_vars['D']
1189 fakerootcmd = get_bb_var('FAKEROOTCMD', testrecipe) 1199 fakerootenv = bb_vars['FAKEROOTENV']
1200 fakerootcmd = bb_vars['FAKEROOTCMD']
1190 result = runCmd('%s %s find . -type f -exec ls -l {} \;' % (fakerootenv, fakerootcmd), cwd=installdir) 1201 result = runCmd('%s %s find . -type f -exec ls -l {} \;' % (fakerootenv, fakerootcmd), cwd=installdir)
1191 filelist1 = self._process_ls_output(result.output) 1202 filelist1 = self._process_ls_output(result.output)
1192 1203