[yocto] [[AUH] 4/6] testimage/ptest: Add require of ptest-pkgs in EXTRA_IMAGE_FEATURES.

Paul Eggleton paul.eggleton at linux.intel.com
Thu Dec 10 17:31:46 PST 2015


On Tue, 01 Dec 2015 16:03:39 Aníbal Limón wrote:
> Instead of add manually the ptest packages use IMAGE_FEATURE to
> install ptest packages this save time validating if ptest pkg
> exist.
> 
> Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
> ---
>  README               | 3 ++-
>  modules/testimage.py | 5 ++---
>  upgradehelper.py     | 5 +++++
>  3 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/README b/README
> index 1c8eba1..63c3b39 100644
> --- a/README
> +++ b/README
> @@ -108,7 +108,8 @@ file:
>  --------------- snip ---------------
>  INHERIT += "testimage"
> 
> -EXTRA_IMAGE_FEATURES = "debug-tweaks package-management"
> +DISTRO_FEATURES_append = " ptest"
> +EXTRA_IMAGE_FEATURES = "debug-tweaks package-management ptest-pkgs"
>  # testimage/ptest only work with rpm
>  PACKAGE_CLASSES = "package_rpm"
>  --------------- snip ---------------
> diff --git a/modules/testimage.py b/modules/testimage.py
> index e410111..52e2592 100644
> --- a/modules/testimage.py
> +++ b/modules/testimage.py
> @@ -60,11 +60,10 @@ class TestImage():
>          # for provide access to the target
>          if ptest:
>              pkgs_out.append("dropbear")
> +            pkgs_out.append("ptest-runner")
> 
>          for c in pkgs:
>              pkgs_out.append(c['PN'])
> -            if ptest:
> -                pkgs_out.append("%s-ptest" % c['PN'])
> 
>          return ' '.join(pkgs_out)
> 
> @@ -122,7 +121,7 @@ class TestImage():
>          ptest_pkgs = self._get_ptest_pkgs()
> 
>          os.environ['CORE_IMAGE_EXTRA_INSTALL'] = \
> -            self._get_pkgs_to_install(ptest_pkgs, True)
> +            self._get_pkgs_to_install(ptest_pkgs, ptest=True)
>          I( "   building core-image-minimal for %s ..." % machine)
>          self.bb.complete("core-image-minimal", machine)
> 
> diff --git a/upgradehelper.py b/upgradehelper.py
> index db39601..5a2b844 100755
> --- a/upgradehelper.py
> +++ b/upgradehelper.py
> @@ -242,6 +242,11 @@ class Updater(object):
>                        " please add to conf/local.conf.")
>                      exit(1)
> 
> +                if not "ptest-pkgs" in
> self.base_env['EXTRA_IMAGE_FEATURES']: 
> +                    E("
> testimage/ptest requires ptest-pkgs in EXTRA_IMAGE_FEATURES"\ 
> +            
>          " please add to conf/local.conf.")
> +                    exit(1)
> +

Strictly speaking this isn't really the proper test - the proper test is that 
ptest-pkgs is in IMAGE_FEATURES *for the image being built and tested* (not 
necessarily the global configuration). We can deal with this at some point in 
the future though.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre



More information about the yocto mailing list