summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-03-30 21:11:39 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-04-01 08:14:58 +0100
commit63a30810065fa7563e7c068a315afb66b5da476f (patch)
tree2669043ac2be2b1edd89589e774b48e41c7bdb51 /meta/lib
parentf57a53d5ab36f78f8393d4283503b6107d730195 (diff)
downloadpoky-63a30810065fa7563e7c068a315afb66b5da476f.tar.gz
selftest/pkgdata: replace the glibc recipe allowing execution on non-poky distros
Replace the glibc recipe for zlib on unit tests, otherwise tests are restricted to glibc distros (poky). [YOCTO #10890] (From OE-Core rev: b77cf437e89a2ec21de6a69d5e34736925f1eeba) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/pkgdata.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/meta/lib/oeqa/selftest/pkgdata.py b/meta/lib/oeqa/selftest/pkgdata.py
index 36d8b346d0..d69c3c800a 100644
--- a/meta/lib/oeqa/selftest/pkgdata.py
+++ b/meta/lib/oeqa/selftest/pkgdata.py
@@ -16,21 +16,21 @@ class OePkgdataUtilTests(oeSelfTest):
16 # Ensure we have the right data in pkgdata 16 # Ensure we have the right data in pkgdata
17 logger = logging.getLogger("selftest") 17 logger = logging.getLogger("selftest")
18 logger.info('Running bitbake to generate pkgdata') 18 logger.info('Running bitbake to generate pkgdata')
19 bitbake('glibc busybox zlib m4') 19 bitbake('busybox zlib m4')
20 20
21 @testcase(1203) 21 @testcase(1203)
22 def test_lookup_pkg(self): 22 def test_lookup_pkg(self):
23 # Forward tests 23 # Forward tests
24 result = runCmd('oe-pkgdata-util lookup-pkg "glibc busybox"') 24 result = runCmd('oe-pkgdata-util lookup-pkg "zlib busybox"')
25 self.assertEqual(result.output, 'libc6\nbusybox') 25 self.assertEqual(result.output, 'libz1\nbusybox')
26 result = runCmd('oe-pkgdata-util lookup-pkg zlib-dev') 26 result = runCmd('oe-pkgdata-util lookup-pkg zlib-dev')
27 self.assertEqual(result.output, 'libz-dev') 27 self.assertEqual(result.output, 'libz-dev')
28 result = runCmd('oe-pkgdata-util lookup-pkg nonexistentpkg', ignore_status=True) 28 result = runCmd('oe-pkgdata-util lookup-pkg nonexistentpkg', ignore_status=True)
29 self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output) 29 self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
30 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg') 30 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
31 # Reverse tests 31 # Reverse tests
32 result = runCmd('oe-pkgdata-util lookup-pkg -r "libc6 busybox"') 32 result = runCmd('oe-pkgdata-util lookup-pkg -r "libz1 busybox"')
33 self.assertEqual(result.output, 'glibc\nbusybox') 33 self.assertEqual(result.output, 'zlib\nbusybox')
34 result = runCmd('oe-pkgdata-util lookup-pkg -r libz-dev') 34 result = runCmd('oe-pkgdata-util lookup-pkg -r libz-dev')
35 self.assertEqual(result.output, 'zlib-dev') 35 self.assertEqual(result.output, 'zlib-dev')
36 result = runCmd('oe-pkgdata-util lookup-pkg -r nonexistentpkg', ignore_status=True) 36 result = runCmd('oe-pkgdata-util lookup-pkg -r nonexistentpkg', ignore_status=True)
@@ -49,8 +49,8 @@ class OePkgdataUtilTests(oeSelfTest):
49 49
50 @testcase(1198) 50 @testcase(1198)
51 def test_find_path(self): 51 def test_find_path(self):
52 result = runCmd('oe-pkgdata-util find-path /lib/libc.so.6') 52 result = runCmd('oe-pkgdata-util find-path /lib/libz.so.1')
53 self.assertEqual(result.output, 'glibc: /lib/libc.so.6') 53 self.assertEqual(result.output, 'zlib: /lib/libz.so.1')
54 result = runCmd('oe-pkgdata-util find-path /usr/bin/m4') 54 result = runCmd('oe-pkgdata-util find-path /usr/bin/m4')
55 self.assertEqual(result.output, 'm4: /usr/bin/m4') 55 self.assertEqual(result.output, 'm4: /usr/bin/m4')
56 result = runCmd('oe-pkgdata-util find-path /not/exist', ignore_status=True) 56 result = runCmd('oe-pkgdata-util find-path /not/exist', ignore_status=True)
@@ -59,8 +59,8 @@ class OePkgdataUtilTests(oeSelfTest):
59 59
60 @testcase(1204) 60 @testcase(1204)
61 def test_lookup_recipe(self): 61 def test_lookup_recipe(self):
62 result = runCmd('oe-pkgdata-util lookup-recipe "libc6-staticdev busybox"') 62 result = runCmd('oe-pkgdata-util lookup-recipe "libz-staticdev busybox"')
63 self.assertEqual(result.output, 'glibc\nbusybox') 63 self.assertEqual(result.output, 'zlib\nbusybox')
64 result = runCmd('oe-pkgdata-util lookup-recipe libz-dbg') 64 result = runCmd('oe-pkgdata-util lookup-recipe libz-dbg')
65 self.assertEqual(result.output, 'zlib') 65 self.assertEqual(result.output, 'zlib')
66 result = runCmd('oe-pkgdata-util lookup-recipe nonexistentpkg', ignore_status=True) 66 result = runCmd('oe-pkgdata-util lookup-recipe nonexistentpkg', ignore_status=True)
@@ -72,12 +72,11 @@ class OePkgdataUtilTests(oeSelfTest):
72 # No arguments 72 # No arguments
73 result = runCmd('oe-pkgdata-util list-pkgs') 73 result = runCmd('oe-pkgdata-util list-pkgs')
74 pkglist = result.output.split() 74 pkglist = result.output.split()
75 self.assertIn('glibc-utils', pkglist, "Listed packages: %s" % result.output) 75 self.assertIn('zlib', pkglist, "Listed packages: %s" % result.output)
76 self.assertIn('zlib-dev', pkglist, "Listed packages: %s" % result.output) 76 self.assertIn('zlib-dev', pkglist, "Listed packages: %s" % result.output)
77 # No pkgspec, runtime 77 # No pkgspec, runtime
78 result = runCmd('oe-pkgdata-util list-pkgs -r') 78 result = runCmd('oe-pkgdata-util list-pkgs -r')
79 pkglist = result.output.split() 79 pkglist = result.output.split()
80 self.assertIn('libc6-utils', pkglist, "Listed packages: %s" % result.output)
81 self.assertIn('libz-dev', pkglist, "Listed packages: %s" % result.output) 80 self.assertIn('libz-dev', pkglist, "Listed packages: %s" % result.output)
82 # With recipe specified 81 # With recipe specified
83 result = runCmd('oe-pkgdata-util list-pkgs -p zlib') 82 result = runCmd('oe-pkgdata-util list-pkgs -p zlib')
@@ -208,11 +207,10 @@ class OePkgdataUtilTests(oeSelfTest):
208 self.track_for_cleanup(tempdir) 207 self.track_for_cleanup(tempdir)
209 pkglistfile = os.path.join(tempdir, 'pkglist') 208 pkglistfile = os.path.join(tempdir, 'pkglist')
210 with open(pkglistfile, 'w') as f: 209 with open(pkglistfile, 'w') as f:
211 f.write('libc6\n')
212 f.write('libz1\n') 210 f.write('libz1\n')
213 f.write('busybox\n') 211 f.write('busybox\n')
214 result = runCmd('oe-pkgdata-util glob %s "*-dev"' % pkglistfile) 212 result = runCmd('oe-pkgdata-util glob %s "*-dev"' % pkglistfile)
215 desiredresult = ['libc6-dev', 'libz-dev', 'busybox-dev'] 213 desiredresult = ['libz-dev', 'busybox-dev']
216 self.assertEqual(sorted(result.output.split()), sorted(desiredresult)) 214 self.assertEqual(sorted(result.output.split()), sorted(desiredresult))
217 # The following should not error (because when we use this during rootfs construction, sometimes the complementary package won't exist) 215 # The following should not error (because when we use this during rootfs construction, sometimes the complementary package won't exist)
218 result = runCmd('oe-pkgdata-util glob %s "*-nonexistent"' % pkglistfile) 216 result = runCmd('oe-pkgdata-util glob %s "*-nonexistent"' % pkglistfile)
@@ -225,5 +223,5 @@ class OePkgdataUtilTests(oeSelfTest):
225 223
226 @testcase(1206) 224 @testcase(1206)
227 def test_specify_pkgdatadir(self): 225 def test_specify_pkgdatadir(self):
228 result = runCmd('oe-pkgdata-util -p %s lookup-pkg glibc' % get_bb_var('PKGDATA_DIR')) 226 result = runCmd('oe-pkgdata-util -p %s lookup-pkg zlib' % get_bb_var('PKGDATA_DIR'))
229 self.assertEqual(result.output, 'libc6') 227 self.assertEqual(result.output, 'libz1')