[OE-core] [PATCH 2/2] oeqa/runtime: Automatic test for ptest

Richard Purdie richard.purdie at linuxfoundation.org
Wed Sep 3 22:10:48 UTC 2014


On Wed, 2014-09-03 at 16:14 +0100, Burton, Ross wrote:
> On 2 September 2014 14:10, Lucian Musat <georgex.l.musat at intel.com> wrote:
> > +    @classmethod
> > +    def tearDownClass(self):
> > +        self.repo_server.stop()
> > +        #remove created channels to be able to repeat the tests on same image
> > +        (status, result) = oeRuntimeTest.tc.target.run('smart channel --show | grep "\["', 0)
> > +        for x in result.split("\n"):
> > +            if x not in self.existingchannels:
> > +                oeRuntimeTest.tc.target.run('smart channel --remove '+x[1:-1]+' -y', 0)
> 
> If we're not removing the packages we've installed, why do we bother
> removing the smart channels?
> 
> > +    @skipUnlessPassed('test_ssh')
> > +    def test_ptestrunner(self):
> > +        self.add_smart_channel()
> > +        self.install_packages(self.install_complementary("*-ptest"))
> > +        self.install_packages(['ptest-runner'])
> 
> Can't you check if the ptest IMAGE_FEATURE is enabled and if so, skip this?

Also, this is smart specific so we probably need an "isRPM?" type check
somewhere in this test (or use librbary functions and have support for
other package backends but that is something for another patch series
sometime).

Cheers,

Richard

> > +        log_results_to_location = os.path.join('./results')
> 
> Joining a single item doesn't do anything.
> 
> > +        if not os.path.exists(log_results_to_location):
> > +            os.makedirs(log_results_to_location)
> > +
> > +        # clear the results directory each time
> > +        for path in os.listdir(log_results_to_location):
> > +            os.remove(os.path.join(log_results_to_location, path))
> 
> I'd do something more like as it's a lot less lines and clear that
> you're deleting the old tree and then creating a fresh one:
> 
> if os.path.exists(logdir):
>   shutil.rmtree(logdir)
> os.makedirs(logdir)
> 
> 
> Ross





More information about the Openembedded-core mailing list