Patchwork [2/2] oeqa/runtime: Added skipModule import for test modules that use it.

login
register
mail settings
Submitter Lucian Musat
Date July 24, 2014, 12:41 p.m.
Message ID <1406205685-7685-2-git-send-email-georgex.l.musat@intel.com>
Download mbox | patch
Permalink /patch/76589/
State Accepted
Commit 984f03457adced77482f9c3f0b95349c9b17c7e5
Headers show

Comments

Lucian Musat - July 24, 2014, 12:41 p.m.
The modules that use skipModule should import it themselves and not rely on somebody else to import it.

Signed-off-by: Lucian Musat <georgex.l.musat@intel.com>
---
 meta/lib/oeqa/runtime/buildcvs.py      | 2 +-
 meta/lib/oeqa/runtime/buildiptables.py | 2 +-
 meta/lib/oeqa/runtime/buildsudoku.py   | 2 +-
 meta/lib/oeqa/runtime/ldd.py           | 2 +-
 meta/lib/oeqa/runtime/pam.py           | 8 ++++----
 meta/lib/oeqa/runtime/skeletoninit.py  | 2 +-
 meta/lib/oeqa/runtime/smart.py         | 2 +-
 meta/lib/oeqa/runtime/vnc.py           | 2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)
Paul Eggleton - July 25, 2014, 4:16 p.m.
On Thursday 24 July 2014 15:41:25 Lucian Musat wrote:
> The modules that use skipModule should import it themselves and not rely on
> somebody else to import it.
> 
> Signed-off-by: Lucian Musat <georgex.l.musat@intel.com>
> ---
>  meta/lib/oeqa/runtime/buildcvs.py      | 2 +-
>  meta/lib/oeqa/runtime/buildiptables.py | 2 +-
>  meta/lib/oeqa/runtime/buildsudoku.py   | 2 +-
>  meta/lib/oeqa/runtime/ldd.py           | 2 +-
>  meta/lib/oeqa/runtime/pam.py           | 8 ++++----
>  meta/lib/oeqa/runtime/skeletoninit.py  | 2 +-
>  meta/lib/oeqa/runtime/smart.py         | 2 +-
>  meta/lib/oeqa/runtime/vnc.py           | 2 +-
>  8 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/meta/lib/oeqa/runtime/buildcvs.py
> b/meta/lib/oeqa/runtime/buildcvs.py index f1fbf19..6201ed1 100644
> --- a/meta/lib/oeqa/runtime/buildcvs.py
> +++ b/meta/lib/oeqa/runtime/buildcvs.py
> @@ -1,4 +1,4 @@
> -from oeqa.oetest import oeRuntimeTest
> +from oeqa.oetest import oeRuntimeTest, skipModule
>  from oeqa.utils.decorators import *
>  from oeqa.utils.targetbuild import TargetBuildProject
> 
> diff --git a/meta/lib/oeqa/runtime/buildiptables.py
> b/meta/lib/oeqa/runtime/buildiptables.py index f6061a7..c77b114 100644
> --- a/meta/lib/oeqa/runtime/buildiptables.py
> +++ b/meta/lib/oeqa/runtime/buildiptables.py
> @@ -1,4 +1,4 @@
> -from oeqa.oetest import oeRuntimeTest
> +from oeqa.oetest import oeRuntimeTest, skipModule
>  from oeqa.utils.decorators import *
>  from oeqa.utils.targetbuild import TargetBuildProject
> 
> diff --git a/meta/lib/oeqa/runtime/buildsudoku.py
> b/meta/lib/oeqa/runtime/buildsudoku.py index a754f1d..f51af92 100644
> --- a/meta/lib/oeqa/runtime/buildsudoku.py
> +++ b/meta/lib/oeqa/runtime/buildsudoku.py
> @@ -1,4 +1,4 @@
> -from oeqa.oetest import oeRuntimeTest
> +from oeqa.oetest import oeRuntimeTest, skipModule
>  from oeqa.utils.decorators import *
>  from oeqa.utils.targetbuild import TargetBuildProject
> 
> diff --git a/meta/lib/oeqa/runtime/ldd.py b/meta/lib/oeqa/runtime/ldd.py
> index 4374530..079130f 100644
> --- a/meta/lib/oeqa/runtime/ldd.py
> +++ b/meta/lib/oeqa/runtime/ldd.py
> @@ -1,5 +1,5 @@
>  import unittest
> -from oeqa.oetest import oeRuntimeTest
> +from oeqa.oetest import oeRuntimeTest, skipModule
>  from oeqa.utils.decorators import *
> 
>  def setUpModule():
> diff --git a/meta/lib/oeqa/runtime/pam.py b/meta/lib/oeqa/runtime/pam.py
> index cc5c1bd..c26e6ea 100644
> --- a/meta/lib/oeqa/runtime/pam.py
> +++ b/meta/lib/oeqa/runtime/pam.py
> @@ -2,7 +2,7 @@
>  # Note that the image under test must have "pam" in DISTRO_FEATURES
> 
>  import unittest
> -from oeqa.oetest import oeRuntimeTest
> +from oeqa.oetest import oeRuntimeTest, skipModule
>  from oeqa.utils.decorators import *
> 
>  def setUpModule():
> @@ -17,8 +17,8 @@ class PamBasicTest(oeRuntimeTest):
>          (status, output) = self.target.run('login --help')
>          self.assertEqual(status, 1, msg = "login command does not work as
> expected. Status and output:%s and %s" %(status, output)) (status, output)
> = self.target.run('passwd --help')
> -        self.assertEqual(status, 0, msg = "passwd command does not work as
> expected. Status and output:%s and %s" %(status, output)) +       
> self.assertEqual(status, 6, msg = "passwd command does not work as
> expected. Status and output:%s and %s" %(status, output)) (status, output)
> = self.target.run('su --help')
> -        self.assertEqual(status, 0, msg = "su command does not work as
> expected. Status and output:%s and %s" %(status, output)) +       
> self.assertEqual(status, 2, msg = "su command does not work as expected.
> Status and output:%s and %s" %(status, output)) (status, output) =
> self.target.run('useradd --help')
> -        self.assertEqual(status, 0, msg = "useradd command does not work as
> expected. Status and output:%s and %s" %(status, output)) +       
> self.assertEqual(status, 2, msg = "useradd command does not work as
> expected. Status and output:%s and %s" %(status, output))

Stefan pointed out to me that this contains a seemingly unintentional revert 
of the following earlier change:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/lib/oeqa/runtime/pam.py?id=14735be703de1b1e173d444b51df7aad902428d5

Cheers,
Paul
Richard Purdie - July 25, 2014, 4:29 p.m.
On Fri, 2014-07-25 at 17:16 +0100, Paul Eggleton wrote:
> Stefan pointed out to me that this contains a seemingly unintentional revert 
> of the following earlier change:
> 
> http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/lib/oeqa/runtime/pam.py?id=14735be703de1b1e173d444b51df7aad902428d5

Thanks, I've fixed that.

Cheers,

Richard
Corneliu Stoicescu - July 28, 2014, 6:56 a.m.
Yes, thank you! This slipped through our fingers.

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf
> Of Paul Eggleton
> Sent: Friday, July 25, 2014 7:16 PM
> To: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 2/2] oeqa/runtime: Added skipModule import
> for test modules that use it.
> 
> On Thursday 24 July 2014 15:41:25 Lucian Musat wrote:
> > The modules that use skipModule should import it themselves and not
> > rely on somebody else to import it.
> >
> > Signed-off-by: Lucian Musat <georgex.l.musat@intel.com>
> > ---
> >  meta/lib/oeqa/runtime/buildcvs.py      | 2 +-
> >  meta/lib/oeqa/runtime/buildiptables.py | 2 +-
> >  meta/lib/oeqa/runtime/buildsudoku.py   | 2 +-
> >  meta/lib/oeqa/runtime/ldd.py           | 2 +-
> >  meta/lib/oeqa/runtime/pam.py           | 8 ++++----
> >  meta/lib/oeqa/runtime/skeletoninit.py  | 2 +-
> >  meta/lib/oeqa/runtime/smart.py         | 2 +-
> >  meta/lib/oeqa/runtime/vnc.py           | 2 +-
> >  8 files changed, 11 insertions(+), 11 deletions(-)
> >
> > diff --git a/meta/lib/oeqa/runtime/buildcvs.py
> > b/meta/lib/oeqa/runtime/buildcvs.py index f1fbf19..6201ed1 100644
> > --- a/meta/lib/oeqa/runtime/buildcvs.py
> > +++ b/meta/lib/oeqa/runtime/buildcvs.py
> > @@ -1,4 +1,4 @@
> > -from oeqa.oetest import oeRuntimeTest
> > +from oeqa.oetest import oeRuntimeTest, skipModule
> >  from oeqa.utils.decorators import *
> >  from oeqa.utils.targetbuild import TargetBuildProject
> >
> > diff --git a/meta/lib/oeqa/runtime/buildiptables.py
> > b/meta/lib/oeqa/runtime/buildiptables.py index f6061a7..c77b114 100644
> > --- a/meta/lib/oeqa/runtime/buildiptables.py
> > +++ b/meta/lib/oeqa/runtime/buildiptables.py
> > @@ -1,4 +1,4 @@
> > -from oeqa.oetest import oeRuntimeTest
> > +from oeqa.oetest import oeRuntimeTest, skipModule
> >  from oeqa.utils.decorators import *
> >  from oeqa.utils.targetbuild import TargetBuildProject
> >
> > diff --git a/meta/lib/oeqa/runtime/buildsudoku.py
> > b/meta/lib/oeqa/runtime/buildsudoku.py index a754f1d..f51af92 100644
> > --- a/meta/lib/oeqa/runtime/buildsudoku.py
> > +++ b/meta/lib/oeqa/runtime/buildsudoku.py
> > @@ -1,4 +1,4 @@
> > -from oeqa.oetest import oeRuntimeTest
> > +from oeqa.oetest import oeRuntimeTest, skipModule
> >  from oeqa.utils.decorators import *
> >  from oeqa.utils.targetbuild import TargetBuildProject
> >
> > diff --git a/meta/lib/oeqa/runtime/ldd.py
> > b/meta/lib/oeqa/runtime/ldd.py index 4374530..079130f 100644
> > --- a/meta/lib/oeqa/runtime/ldd.py
> > +++ b/meta/lib/oeqa/runtime/ldd.py
> > @@ -1,5 +1,5 @@
> >  import unittest
> > -from oeqa.oetest import oeRuntimeTest
> > +from oeqa.oetest import oeRuntimeTest, skipModule
> >  from oeqa.utils.decorators import *
> >
> >  def setUpModule():
> > diff --git a/meta/lib/oeqa/runtime/pam.py
> > b/meta/lib/oeqa/runtime/pam.py index cc5c1bd..c26e6ea 100644
> > --- a/meta/lib/oeqa/runtime/pam.py
> > +++ b/meta/lib/oeqa/runtime/pam.py
> > @@ -2,7 +2,7 @@
> >  # Note that the image under test must have "pam" in DISTRO_FEATURES
> >
> >  import unittest
> > -from oeqa.oetest import oeRuntimeTest
> > +from oeqa.oetest import oeRuntimeTest, skipModule
> >  from oeqa.utils.decorators import *
> >
> >  def setUpModule():
> > @@ -17,8 +17,8 @@ class PamBasicTest(oeRuntimeTest):
> >          (status, output) = self.target.run('login --help')
> >          self.assertEqual(status, 1, msg = "login command does not
> > work as expected. Status and output:%s and %s" %(status, output))
> > (status, output) = self.target.run('passwd --help')
> > -        self.assertEqual(status, 0, msg = "passwd command does not work as
> > expected. Status and output:%s and %s" %(status, output)) +
> > self.assertEqual(status, 6, msg = "passwd command does not work as
> > expected. Status and output:%s and %s" %(status, output)) (status,
> > output) = self.target.run('su --help')
> > -        self.assertEqual(status, 0, msg = "su command does not work as
> > expected. Status and output:%s and %s" %(status, output)) +
> > self.assertEqual(status, 2, msg = "su command does not work as expected.
> > Status and output:%s and %s" %(status, output)) (status, output) =
> > self.target.run('useradd --help')
> > -        self.assertEqual(status, 0, msg = "useradd command does not work as
> > expected. Status and output:%s and %s" %(status, output)) +
> > self.assertEqual(status, 2, msg = "useradd command does not work as
> > expected. Status and output:%s and %s" %(status, output))
> 
> Stefan pointed out to me that this contains a seemingly unintentional revert
> of the following earlier change:
> 
> http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/meta/lib/oeqa/runti
> me/pam.py?id=14735be703de1b1e173d444b51df7aad902428d5
> 
> Cheers,
> Paul
> 
> --
> 
> Paul Eggleton
> Intel Open Source Technology Centre
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

Patch

diff --git a/meta/lib/oeqa/runtime/buildcvs.py b/meta/lib/oeqa/runtime/buildcvs.py
index f1fbf19..6201ed1 100644
--- a/meta/lib/oeqa/runtime/buildcvs.py
+++ b/meta/lib/oeqa/runtime/buildcvs.py
@@ -1,4 +1,4 @@ 
-from oeqa.oetest import oeRuntimeTest
+from oeqa.oetest import oeRuntimeTest, skipModule
 from oeqa.utils.decorators import *
 from oeqa.utils.targetbuild import TargetBuildProject
 
diff --git a/meta/lib/oeqa/runtime/buildiptables.py b/meta/lib/oeqa/runtime/buildiptables.py
index f6061a7..c77b114 100644
--- a/meta/lib/oeqa/runtime/buildiptables.py
+++ b/meta/lib/oeqa/runtime/buildiptables.py
@@ -1,4 +1,4 @@ 
-from oeqa.oetest import oeRuntimeTest
+from oeqa.oetest import oeRuntimeTest, skipModule
 from oeqa.utils.decorators import *
 from oeqa.utils.targetbuild import TargetBuildProject
 
diff --git a/meta/lib/oeqa/runtime/buildsudoku.py b/meta/lib/oeqa/runtime/buildsudoku.py
index a754f1d..f51af92 100644
--- a/meta/lib/oeqa/runtime/buildsudoku.py
+++ b/meta/lib/oeqa/runtime/buildsudoku.py
@@ -1,4 +1,4 @@ 
-from oeqa.oetest import oeRuntimeTest
+from oeqa.oetest import oeRuntimeTest, skipModule
 from oeqa.utils.decorators import *
 from oeqa.utils.targetbuild import TargetBuildProject
 
diff --git a/meta/lib/oeqa/runtime/ldd.py b/meta/lib/oeqa/runtime/ldd.py
index 4374530..079130f 100644
--- a/meta/lib/oeqa/runtime/ldd.py
+++ b/meta/lib/oeqa/runtime/ldd.py
@@ -1,5 +1,5 @@ 
 import unittest
-from oeqa.oetest import oeRuntimeTest
+from oeqa.oetest import oeRuntimeTest, skipModule
 from oeqa.utils.decorators import *
 
 def setUpModule():
diff --git a/meta/lib/oeqa/runtime/pam.py b/meta/lib/oeqa/runtime/pam.py
index cc5c1bd..c26e6ea 100644
--- a/meta/lib/oeqa/runtime/pam.py
+++ b/meta/lib/oeqa/runtime/pam.py
@@ -2,7 +2,7 @@ 
 # Note that the image under test must have "pam" in DISTRO_FEATURES
 
 import unittest
-from oeqa.oetest import oeRuntimeTest
+from oeqa.oetest import oeRuntimeTest, skipModule
 from oeqa.utils.decorators import *
 
 def setUpModule():
@@ -17,8 +17,8 @@  class PamBasicTest(oeRuntimeTest):
         (status, output) = self.target.run('login --help')
         self.assertEqual(status, 1, msg = "login command does not work as expected. Status and output:%s and %s" %(status, output))
         (status, output) = self.target.run('passwd --help')
-        self.assertEqual(status, 0, msg = "passwd command does not work as expected. Status and output:%s and %s" %(status, output))
+        self.assertEqual(status, 6, msg = "passwd command does not work as expected. Status and output:%s and %s" %(status, output))
         (status, output) = self.target.run('su --help')
-        self.assertEqual(status, 0, msg = "su command does not work as expected. Status and output:%s and %s" %(status, output))
+        self.assertEqual(status, 2, msg = "su command does not work as expected. Status and output:%s and %s" %(status, output))
         (status, output) = self.target.run('useradd --help')
-        self.assertEqual(status, 0, msg = "useradd command does not work as expected. Status and output:%s and %s" %(status, output))
+        self.assertEqual(status, 2, msg = "useradd command does not work as expected. Status and output:%s and %s" %(status, output))
diff --git a/meta/lib/oeqa/runtime/skeletoninit.py b/meta/lib/oeqa/runtime/skeletoninit.py
index 557e715..ddcad20 100644
--- a/meta/lib/oeqa/runtime/skeletoninit.py
+++ b/meta/lib/oeqa/runtime/skeletoninit.py
@@ -2,7 +2,7 @@ 
 # Note that the image under test must have meta-skeleton layer in bblayers and IMAGE_INSTALL_append = " service" in local.conf
 
 import unittest
-from oeqa.oetest import oeRuntimeTest
+from oeqa.oetest import oeRuntimeTest, skipModule
 from oeqa.utils.decorators import *
 
 def setUpModule():
diff --git a/meta/lib/oeqa/runtime/smart.py b/meta/lib/oeqa/runtime/smart.py
index 195f117..3130373 100644
--- a/meta/lib/oeqa/runtime/smart.py
+++ b/meta/lib/oeqa/runtime/smart.py
@@ -1,6 +1,6 @@ 
 import unittest
 import re
-from oeqa.oetest import oeRuntimeTest
+from oeqa.oetest import oeRuntimeTest, skipModule
 from oeqa.utils.decorators import *
 from oeqa.utils.httpserver import HTTPService
 
diff --git a/meta/lib/oeqa/runtime/vnc.py b/meta/lib/oeqa/runtime/vnc.py
index 5ed1072..1b4652b 100644
--- a/meta/lib/oeqa/runtime/vnc.py
+++ b/meta/lib/oeqa/runtime/vnc.py
@@ -1,4 +1,4 @@ 
-from oeqa.oetest import oeRuntimeTest
+from oeqa.oetest import oeRuntimeTest, skipModuleUnless
 from oeqa.utils.decorators import *
 import re