diff options
author | Vyacheslav Yurkov <uvv.mail@gmail.com> | 2021-10-17 10:08:56 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-30 22:31:49 +0100 |
commit | 66de5de793f3c86502d193f7e3abc8fa17642369 (patch) | |
tree | 96d82b2494f79a2ced502d48c47c66cf67893b56 | |
parent | b38e194db0c6825f28c56123cf88af94d3f52beb (diff) | |
download | openembedded-core-contrib-66de5de793f3c86502d193f7e3abc8fa17642369.tar.gz |
oeqa/selftest: refactor common functions
Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/selftest/cases/overlayfs.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/meta/lib/oeqa/selftest/cases/overlayfs.py b/meta/lib/oeqa/selftest/cases/overlayfs.py index 0184d52494..f0c9860b48 100644 --- a/meta/lib/oeqa/selftest/cases/overlayfs.py +++ b/meta/lib/oeqa/selftest/cases/overlayfs.py @@ -8,11 +8,14 @@ from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu class OverlayFSTests(OESelftestTestCase): """Overlayfs class usage tests""" - def getline(self, res, line): - for l in res.output.split('\n'): + def getline_qemu(self, out, line): + for l in out.split('\n'): if line in l: return l + def getline(self, res, line): + return self.getline_qemu(res.output, line) + def add_overlay_conf_to_machine(self): machine_inc = """ OVERLAYFS_MOUNT_POINT[mnt-overlay] = "/mnt/overlay" @@ -154,18 +157,13 @@ EOT bitbake('core-image-minimal') - def getline_qemu(out, line): - for l in out.split('\n'): - if line in l: - return l - with runqemu('core-image-minimal') as qemu: # Check that we have /mnt/overlay fs mounted as tmpfs and # /usr/share/my-application as an overlay (see overlayfs-user recipe) status, output = qemu.run_serial("/bin/mount -t tmpfs,overlay") - line = getline_qemu(output, "on /mnt/overlay") + line = self.getline_qemu(output, "on /mnt/overlay") self.assertTrue(line and line.startswith("tmpfs"), msg=output) - line = getline_qemu(output, "upperdir=/mnt/overlay/upper/usr/share/my-application") + line = self.getline_qemu(output, "upperdir=/mnt/overlay/upper/usr/share/my-application") self.assertTrue(line and line.startswith("overlay"), msg=output) |