mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 00:20:08 +00:00
oe-selftest: devtool: improve test_devtool_modify slightly
* Check that man .in file actually gets modified, since sed -i doesn't fail if it it doesn't * Use a variable for man file path (From OE-Core rev: 9ad36e945fa5b03726f78ba99e823eade8daa710) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
229091babb
commit
0cba3cbcb4
@@ -439,7 +439,15 @@ class DevtoolTests(DevtoolBase):
|
|||||||
# Try building
|
# Try building
|
||||||
bitbake('mdadm')
|
bitbake('mdadm')
|
||||||
# Try making (minor) modifications to the source
|
# Try making (minor) modifications to the source
|
||||||
result = runCmd("sed -i 's!^\.TH.*!.TH MDADM 8 \"\" v9.999-custom!' %s" % os.path.join(tempdir, 'mdadm.8.in'))
|
modfile = os.path.join(tempdir, 'mdadm.8.in')
|
||||||
|
result = runCmd("sed -i 's!^\.TH.*!.TH MDADM 8 \"\" v9.999-custom!' %s" % modfile)
|
||||||
|
sedline = ''
|
||||||
|
with open(modfile, 'r') as f:
|
||||||
|
for line in f:
|
||||||
|
if line.startswith('.TH'):
|
||||||
|
sedline = line.rstrip()
|
||||||
|
break
|
||||||
|
self.assertEqual(sedline, '.TH MDADM 8 "" v9.999-custom', 'man .in file not modified (sed failed)')
|
||||||
bitbake('mdadm -c package')
|
bitbake('mdadm -c package')
|
||||||
pkgd = get_bb_var('PKGD', 'mdadm')
|
pkgd = get_bb_var('PKGD', 'mdadm')
|
||||||
self.assertTrue(pkgd, 'Could not query PKGD variable')
|
self.assertTrue(pkgd, 'Could not query PKGD variable')
|
||||||
@@ -447,10 +455,11 @@ class DevtoolTests(DevtoolBase):
|
|||||||
self.assertTrue(mandir, 'Could not query mandir variable')
|
self.assertTrue(mandir, 'Could not query mandir variable')
|
||||||
if mandir[0] == '/':
|
if mandir[0] == '/':
|
||||||
mandir = mandir[1:]
|
mandir = mandir[1:]
|
||||||
with open(os.path.join(pkgd, mandir, 'man8', 'mdadm.8'), 'r') as f:
|
manfile = os.path.join(pkgd, mandir, 'man8', 'mdadm.8')
|
||||||
|
with open(manfile, 'r') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
if line.startswith('.TH'):
|
if line.startswith('.TH'):
|
||||||
self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified. man searched file path: %s' % os.path.join(pkgd, mandir, 'man8', 'mdadm.8'))
|
self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified. man searched file path: %s' % manfile)
|
||||||
# Test devtool reset
|
# Test devtool reset
|
||||||
stampprefix = get_bb_var('STAMP', 'mdadm')
|
stampprefix = get_bb_var('STAMP', 'mdadm')
|
||||||
result = runCmd('devtool reset mdadm')
|
result = runCmd('devtool reset mdadm')
|
||||||
|
|||||||
Reference in New Issue
Block a user