summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/pkgdata.py
diff options
context:
space:
mode:
authorDaniel Istrate <daniel.alexandrux.istrate@intel.com>2015-06-29 15:18:41 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-08 00:01:19 +0100
commitffa54b94b636a24aa5264916d2b1abfcf029f7ae (patch)
tree1d8ec88873ceaf27a0c6bb1045c6d0ee8f7887ea /meta/lib/oeqa/selftest/pkgdata.py
parent9f91aa697fb2cf5314aa4a99b2abbf0229cb1ea2 (diff)
downloadpoky-ffa54b94b636a24aa5264916d2b1abfcf029f7ae.tar.gz
oeqa/selftest: Added @testcase decorators to oeselftest testcases.
Added decorator to some testcases missing this feature. (From OE-Core rev: 2a9009583fd498df94a55f21a149e302180f19cc) Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@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/oeqa/selftest/pkgdata.py')
-rw-r--r--meta/lib/oeqa/selftest/pkgdata.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/pkgdata.py b/meta/lib/oeqa/selftest/pkgdata.py
index 34eea468e8..c4d34bd590 100644
--- a/meta/lib/oeqa/selftest/pkgdata.py
+++ b/meta/lib/oeqa/selftest/pkgdata.py
@@ -18,6 +18,7 @@ class OePkgdataUtilTests(oeSelfTest):
18 logger.info('Running bitbake to generate pkgdata') 18 logger.info('Running bitbake to generate pkgdata')
19 bitbake('glibc busybox zlib bash') 19 bitbake('glibc busybox zlib bash')
20 20
21 @testcase(1203)
21 def test_lookup_pkg(self): 22 def test_lookup_pkg(self):
22 # Forward tests 23 # Forward tests
23 result = runCmd('oe-pkgdata-util lookup-pkg "glibc busybox"') 24 result = runCmd('oe-pkgdata-util lookup-pkg "glibc busybox"')
@@ -36,6 +37,7 @@ class OePkgdataUtilTests(oeSelfTest):
36 self.assertEqual(result.status, 1) 37 self.assertEqual(result.status, 1)
37 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg') 38 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
38 39
40 @testcase(1205)
39 def test_read_value(self): 41 def test_read_value(self):
40 result = runCmd('oe-pkgdata-util read-value PN libz1') 42 result = runCmd('oe-pkgdata-util read-value PN libz1')
41 self.assertEqual(result.output, 'zlib') 43 self.assertEqual(result.output, 'zlib')
@@ -43,6 +45,7 @@ class OePkgdataUtilTests(oeSelfTest):
43 pkgsize = int(result.output.strip()) 45 pkgsize = int(result.output.strip())
44 self.assertGreater(pkgsize, 1) 46 self.assertGreater(pkgsize, 1)
45 47
48 @testcase(1198)
46 def test_find_path(self): 49 def test_find_path(self):
47 result = runCmd('oe-pkgdata-util find-path /lib/libc.so.6') 50 result = runCmd('oe-pkgdata-util find-path /lib/libc.so.6')
48 self.assertEqual(result.output, 'glibc: /lib/libc.so.6') 51 self.assertEqual(result.output, 'glibc: /lib/libc.so.6')
@@ -52,6 +55,7 @@ class OePkgdataUtilTests(oeSelfTest):
52 self.assertEqual(result.status, 1) 55 self.assertEqual(result.status, 1)
53 self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist') 56 self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist')
54 57
58 @testcase(1204)
55 def test_lookup_recipe(self): 59 def test_lookup_recipe(self):
56 result = runCmd('oe-pkgdata-util lookup-recipe "libc6-staticdev busybox"') 60 result = runCmd('oe-pkgdata-util lookup-recipe "libc6-staticdev busybox"')
57 self.assertEqual(result.output, 'glibc\nbusybox') 61 self.assertEqual(result.output, 'glibc\nbusybox')
@@ -61,6 +65,7 @@ class OePkgdataUtilTests(oeSelfTest):
61 self.assertEqual(result.status, 1) 65 self.assertEqual(result.status, 1)
62 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg') 66 self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
63 67
68 @testcase(1202)
64 def test_list_pkgs(self): 69 def test_list_pkgs(self):
65 # No arguments 70 # No arguments
66 result = runCmd('oe-pkgdata-util list-pkgs') 71 result = runCmd('oe-pkgdata-util list-pkgs')
@@ -105,6 +110,7 @@ class OePkgdataUtilTests(oeSelfTest):
105 pkglist = sorted(result.output.split()) 110 pkglist = sorted(result.output.split())
106 self.assertEqual(pkglist, ['libz-dbg', 'libz-dev', 'libz-doc']) 111 self.assertEqual(pkglist, ['libz-dbg', 'libz-dev', 'libz-doc'])
107 112
113 @testcase(1201)
108 def test_list_pkg_files(self): 114 def test_list_pkg_files(self):
109 def splitoutput(output): 115 def splitoutput(output):
110 files = {} 116 files = {}
@@ -193,6 +199,7 @@ class OePkgdataUtilTests(oeSelfTest):
193 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc']) 199 self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc'])
194 self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev']) 200 self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev'])
195 201
202 @testcase(1200)
196 def test_glob(self): 203 def test_glob(self):
197 tempdir = tempfile.mkdtemp(prefix='pkgdataqa') 204 tempdir = tempfile.mkdtemp(prefix='pkgdataqa')
198 self.track_for_cleanup(tempdir) 205 self.track_for_cleanup(tempdir)
@@ -213,6 +220,7 @@ class OePkgdataUtilTests(oeSelfTest):
213 self.assertNotIn('libz-dev', resultlist) 220 self.assertNotIn('libz-dev', resultlist)
214 self.assertNotIn('libz-dbg', resultlist) 221 self.assertNotIn('libz-dbg', resultlist)
215 222
223 @testcase(1206)
216 def test_specify_pkgdatadir(self): 224 def test_specify_pkgdatadir(self):
217 result = runCmd('oe-pkgdata-util -p %s lookup-pkg glibc' % get_bb_var('PKGDATA_DIR')) 225 result = runCmd('oe-pkgdata-util -p %s lookup-pkg glibc' % get_bb_var('PKGDATA_DIR'))
218 self.assertEqual(result.output, 'libc6') 226 self.assertEqual(result.output, 'libc6')