[OE-core] [PATCH 2/4] qemurunner: Add support for slirp

Yeoh, Ee Peng ee.peng.yeoh at intel.com
Wed Nov 14 06:56:15 UTC 2018


Hi Richard,

Thank you for sharing on the error related to oeqa.targetcontrol.QemuTarget.
After some analysis, here are my findings:

1. OEQA had classes with very similar name as well as interface for carry out qemu and ssh operations.  Example: "QemuTarget vs OEQemuTarget", "SSHControl vs OESSHTarget".  Where OEQemuTarget & OESSHTarget were used mainly for runtime/testimage and QemuTarget & SSHControl were used for mainly for oe-selftest.  Not only the name and interface were similar, there are some duplicated codes between these two group of classes.  This had introduced additional complexity in both adding new features and testing (eg. now the "slirp" features need to be added to both group of classes and testing both). 

2. Coding design being used were different between these two group of classes. Where OEQemuTarget and OESSHTarget used inheritance design, QemuTarget and SSHControl used composite design.  This further adding more complexity into developing new feature.

Solutions:
1. Short term - I will enable slirp into both group of classes and test them
2. Long term - this require significant refactoring to remove duplication codes and simplify the code base for qemu and ssh operations. 

Please let me know you inputs and recommendation.

Best regards,
Yeoh Ee Peng  

-----Original Message-----
From: Richard Purdie [mailto:richard.purdie at linuxfoundation.org] 
Sent: Wednesday, November 14, 2018 7:34 AM
To: Yeoh, Ee Peng <ee.peng.yeoh at intel.com>; openembedded-core at lists.openembedded.org
Subject: Re: [OE-core] [PATCH 2/4] qemurunner: Add support for slirp

On Tue, 2018-11-13 at 17:32 +0800, Yeoh Ee Peng wrote:
> Enable qemurunner for slirp. Retrieved the port from localhost to 
> connect to qemu.
> 
> [YOCTO#10713]
> 
> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh at intel.com>
> ---
>  meta/lib/oeqa/utils/qemurunner.py | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)

  File "/media/build1/poky/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
    return func(*args, **kwargs)
  File "/media/build1/poky/meta/lib/oeqa/selftest/cases/devtool.py", line 1282, in test_devtool_deploy_target
    with runqemu(testimage) as qemu:
  File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "/media/build1/poky/meta/lib/oeqa/utils/commands.py", line 327, in runqemu
    qemu = oeqa.targetcontrol.QemuTarget(recipedata, targetlogger, image_fstype)
  File "/media/build1/poky/meta/lib/oeqa/targetcontrol.py", line 148, in __init__
    logger = logger)
TypeError: __init__() missing 1 required positional argument: 'use_slirp'

I'm therefore not sure how much testing this has had?

Cheers,

Richard




More information about the Openembedded-core mailing list