Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Lucian Musat <georgex.l.musat@intel.com>
Cc: Stefan Stanacar <stefanx.stanacar@intel.com>,
	openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 3/3] oeqa/runtime: Automatic test for ptest
Date: Fri, 29 Aug 2014 16:37:22 +0100	[thread overview]
Message-ID: <1409326642.29296.190.camel@ted> (raw)
In-Reply-To: <1409320266-29059-3-git-send-email-georgex.l.musat@intel.com>

On Fri, 2014-08-29 at 16:51 +0300, Lucian Musat wrote:
> For images without ptest the packages are automatically installed alongside ptest-runner. Log results are saved in ./results folder.
> No cleanup is done for packages after the test is finished.
> 
> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
> Signed-off-by: Lucian Musat <georgex.l.musat@intel.com>
> ---

[...]

> +    def get_ptest_packages(self):
> +        pkgs = set()
> +        image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE', True)
> +        pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS', True).replace("-","_").split()
> +        for arch in pkgarchs:
> +            folder = self.repo_server.root_dir+"/"+image_pkgtype+'/'+arch
> +            if (os.path.isdir(folder)):
> +                for fil in os.listdir(folder):
> +                    if ("ptest" in str(fil) and "ptest-runner" not in str(fil)):
> +                        #get all the packages with -ptest in the name and remove ptest from them for future comparisons 
> +                        filez = "".join(str(fil).split("-ptest"))
> +                        rootfilez = ".".join(filez.split(".")[:-2])
> +                        filex = str(fil).split("-ptest")[0]
> +                        #compare with all the packages installed on the board and get a list of potential matches
> +                        if filex in self.packagelist:
> +                            i = 0
> +                            matches = []
> +                            while i<len(self.pkglist):
> +                                if filex in self.pkglist[i]:
> +                                    matches.append(self.pkglist[i])
> +                                i +=1
> +                            for i in matches:
> +                                #sometimes package names differ from corresponding ptest package names (ex. libacl1 != acl-ptest) so we use the Source field from smart info to compare
> +                                (status, result) = self.target.run("smart info "+i,0)
> +                                rootpkg = re.search("(.*Source:.*)", result).group(1).split(":")[1][1:]
> +                                #even source package names mai differ a little so we do a fuzzy string match (ex. libz-1.2.8-r0 -> zlib-1.2.8-r0)
> +                                m = SequenceMatcher(None, rootpkg, rootfilez)
> +                                if (m.ratio > 0.9):
> +                                    filey = "".join(str(fil).split("-ptest")[0])+"-ptest"
> +                                    pkgs.add(filey)
> +        if str(pkgs) == "set([])":
> +            raise AssertionError("Cannot get ptest packages to install!")
> +        pkgs.add("ptest-runner")
> +        return pkgs

At a quick glance, I wondered if it would be possible to use oe-pkg-util
here so we have one code path for finding the list of ptest packages
available? You can see example usage at  lib/oe/package_manager.py, the
install_complementary function.

I did hear a comment that there may be some issues with that function,
if there are we need to figure out what they are and fix them.

I'm pleased to see progress on this btw!

Cheers,

Richard



  reply	other threads:[~2014-08-29 15:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 13:51 [PATCH 1/3] oeqa: Added package installer to oetest to aid in future automatic install of packages Lucian Musat
2014-08-29 13:51 ` [PATCH 2/3] oeqa/utils/logparser.py: results based log parser utility Lucian Musat
2014-08-29 13:51 ` [PATCH 3/3] oeqa/runtime: Automatic test for ptest Lucian Musat
2014-08-29 15:37   ` Richard Purdie [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-09-04 11:27 [PATCH 1/3] oeqa: Added package installer to oetest to aid in future automatic install of packages Lucian Musat
2014-09-04 11:27 ` [PATCH 3/3] oeqa/runtime: Automatic test for ptest Lucian Musat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409326642.29296.190.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=georgex.l.musat@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=stefanx.stanacar@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox