summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/liboe.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/liboe.py b/meta/lib/oeqa/selftest/liboe.py
index 5c93069b5d..35131eb240 100644
--- a/meta/lib/oeqa/selftest/liboe.py
+++ b/meta/lib/oeqa/selftest/liboe.py
@@ -62,3 +62,32 @@ class LibOE(oeSelfTest):
62 self.assertIn('user.oetest="testing liboe"', result.output, 'Extended attribute not sert in dst') 62 self.assertIn('user.oetest="testing liboe"', result.output, 'Extended attribute not sert in dst')
63 63
64 oe.path.remove(testloc) 64 oe.path.remove(testloc)
65
66 def test_copy_hardlink_tree_count(self):
67 """
68 Summary: oe.path.copyhardlinktree() shouldn't miss out files
69 Expected: src and dst should have the same number of files
70 Product: OE-Core
71 Author: Joshua Lock <joshua.g.lock@intel.com>
72 """
73 tmp_dir = get_bb_var('TMPDIR')
74 testloc = oe.path.join(tmp_dir, 'liboetests')
75 src = oe.path.join(testloc, 'src')
76 dst = oe.path.join(testloc, 'dst')
77 bb.utils.mkdirhier(testloc)
78 bb.utils.mkdirhier(src)
79 testfiles = ['foo', 'bar', '.baz', 'quux']
80
81 def touchfile(tf):
82 open(oe.path.join(src, tf), 'w+b').close()
83
84 for f in testfiles:
85 touchfile(f)
86
87 oe.path.copyhardlinktree(src, dst)
88
89 dstcnt = len(os.listdir(dst))
90 srccnt = len(os.listdir(src))
91 self.assertEquals(dstcnt, len(testfiles), "Number of files in dst (%s) differs from number of files in src(%s)." % (dstcnt, srccnt))
92
93 oe.path.remove(testloc)