Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture
@ 2015-12-17 14:38 Daniel Istrate
  2015-12-17 14:38 ` [PATCHv3 2/2] selftest: Added MACHINE = "qemux86" to tests that use runqemu Daniel Istrate
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Istrate @ 2015-12-17 14:38 UTC (permalink / raw)
  To: openembedded-core

Add an option for random arch into oe-selftest:
--arch [random/all]
1. random: will set a random MACHINE for each test
2. all: will run tests for all architectures

Custom arch sets only weak default values (??=) for MACHINE in local.conf.
This let test cases that require a specific MACHINE to be able to
override it, using (?= or =).

e.g.:
oe-selftest --run-tests signing --arch random -->
will run all tests switching MACHINE randomly for each test

oe-selftest --run-tests signing --arch all -->
for each arch will run all tests

oe-selftest --run-all-tests --arch random

Also update oeqa/selftest/base.py to accomodate this feature.

Fix for [YOCTO #5880].

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
---
 meta/lib/oeqa/selftest/base.py | 49 ++++++++++++++++++++++++++++++++++++------
 scripts/oe-selftest            | 34 +++++++++++++++++++++++------
 2 files changed, 70 insertions(+), 13 deletions(-)

diff --git a/meta/lib/oeqa/selftest/base.py b/meta/lib/oeqa/selftest/base.py
index 9bddc23..d71bbbd 100644
--- a/meta/lib/oeqa/selftest/base.py
+++ b/meta/lib/oeqa/selftest/base.py
@@ -16,6 +16,7 @@ import errno
 import oeqa.utils.ftools as ftools
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
 from oeqa.utils.decorators import LogResults
+from random import choice
 
 @LogResults
 class oeSelfTest(unittest.TestCase):
@@ -29,9 +30,12 @@ class oeSelfTest(unittest.TestCase):
         self.testinc_path = os.path.join(self.builddir, "conf/selftest.inc")
         self.local_bblayers_path = os.path.join(self.builddir, "conf/bblayers.conf")
         self.testinc_bblayers_path = os.path.join(self.builddir, "conf/bblayers.inc")
+        self.archinc_path = os.path.join(self.builddir, "conf/arch.inc")
         self.testlayer_path = oeSelfTest.testlayer_path
         self._extra_tear_down_commands = []
-        self._track_for_cleanup = [self.testinc_path]
+        self._track_for_cleanup = [self.testinc_path, self.testinc_bblayers_path, self.archinc_path]
+        self.arch_list = ['qemuarm', 'qemuarm64', 'qemumips', 'qemuppc', 'qemux86', 'qemux86-64',
+                          'beaglebone', 'genericx86', 'genericx86-64', 'mpc8315e-rdb', 'edgerouter']
         super(oeSelfTest, self).__init__(methodName)
 
     def setUp(self):
@@ -47,11 +51,25 @@ class oeSelfTest(unittest.TestCase):
             for f in files:
                 if f == 'test_recipe.inc':
                     os.remove(os.path.join(root, f))
-        try:
-            os.remove(self.testinc_bblayers_path)
-        except OSError as e:
-            if e.errno != errno.ENOENT:
-                raise
+
+        for incl_file in [self.testinc_bblayers_path, self.archinc_path]:
+            try:
+                os.remove(incl_file)
+            except OSError as e:
+                if e.errno != errno.ENOENT:
+                    raise
+
+        # Get CUSTOMARCH from env (set by --arch argument to oe-selftest)
+        customarch = os.getenv('CUSTOMARCH')
+        if customarch:
+            if customarch == 'random':
+                machine = self.get_random_arch()
+            else:
+                machine = customarch
+            arch_conf = 'MACHINE ??= "%s"\n' % machine
+            self.set_arch_config(arch_conf)
+            print 'Arch: %s' % machine
+
         # tests might need their own setup
         # but if they overwrite this one they have to call
         # super each time, so let's give them an alternative
@@ -99,11 +117,21 @@ class oeSelfTest(unittest.TestCase):
         self.log.debug("Writing to: %s\n%s\n" % (self.testinc_path, data))
         ftools.write_file(self.testinc_path, data)
 
+        customarch = os.getenv('CUSTOMARCH')
+        if customarch and 'MACHINE' in data:
+            machine = get_bb_var('MACHINE')
+            self.log.warning('Arch overridden: %s' % machine)
+
     # append to <builddir>/conf/selftest.inc
     def append_config(self, data):
         self.log.debug("Appending to: %s\n%s\n" % (self.testinc_path, data))
         ftools.append_file(self.testinc_path, data)
 
+        customarch = os.getenv('CUSTOMARCH')
+        if customarch and 'MACHINE' in data:
+            machine = get_bb_var('MACHINE')
+            self.log.warning('Arch overridden: %s' % machine)
+
     # remove data from <builddir>/conf/selftest.inc
     def remove_config(self, data):
         self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_path, data))
@@ -151,3 +179,12 @@ class oeSelfTest(unittest.TestCase):
     def remove_bblayers_config(self, data):
         self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_bblayers_path, data))
         ftools.remove_from_file(self.testinc_bblayers_path, data)
+
+    def get_random_arch(self):
+        # Return a random arch from the arch_list
+        return choice(self.arch_list)
+
+    # write to <builddir>/conf/arch.inc
+    def set_arch_config(self, data):
+        self.log.debug("Writing to: %s\n%s\n" % (self.archinc_path, data))
+        ftools.write_file(self.archinc_path, data)
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index bc50b2a..8a3df19 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -78,6 +78,8 @@ def get_args_parser():
                        help='list-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>')
     group.add_argument('--list-tags', required=False, dest='list_tags', default=False, action="store_true",
                        help='List all tags that have been set to test cases.')
+    parser.add_argument('--arch', required=False, dest='arch', choices=['random', 'all'], default=None,
+                        help='Run tests on different architecture (random/all).')
     return parser
 
 
@@ -109,7 +111,7 @@ def add_include():
         not in ftools.read_file(os.path.join(builddir, "conf/local.conf")):
             log.info("Adding: \"include selftest.inc\" in local.conf")
             ftools.append_file(os.path.join(builddir, "conf/local.conf"), \
-                    "\n#include added by oe-selftest.py\ninclude selftest.inc")
+                    "\n#include added by oe-selftest.py\ninclude selftest.inc\ninclude arch.inc")
 
     if "#include added by oe-selftest.py" \
         not in ftools.read_file(os.path.join(builddir, "conf/bblayers.conf")):
@@ -125,7 +127,7 @@ def remove_include():
         in ftools.read_file(os.path.join(builddir, "conf/local.conf")):
             log.info("Removing the include from local.conf")
             ftools.remove_from_file(os.path.join(builddir, "conf/local.conf"), \
-                    "#include added by oe-selftest.py\ninclude selftest.inc")
+                    "#include added by oe-selftest.py\ninclude selftest.inc\ninclude arch.inc")
 
     if "#include added by oe-selftest.py" \
         in ftools.read_file(os.path.join(builddir, "conf/bblayers.conf")):
@@ -143,10 +145,11 @@ def remove_inc_files():
     except (AttributeError, OSError,) as e:    # AttributeError may happen if BUILDDIR is not set
         pass
 
-    try:
-        os.remove(os.path.join(os.environ.get("BUILDDIR"), "conf/bblayers.inc"))
-    except:
-        pass
+    for incl_file in ['conf/bblayers.inc', 'conf/arch.inc']:
+        try:
+            os.remove(os.path.join(os.environ.get("BUILDDIR"), incl_file))
+        except:
+            pass
 
 def get_tests(exclusive_modules=[], include_hidden=False):
     testslist = []
@@ -466,7 +469,24 @@ def main():
                 log.error(e)
                 return 1
         add_include()
-        result = runner.run(suite)
+
+        if args.arch:
+            # Custom arch sets only weak default values (??=) for MACHINE in local.conf
+            # This let test cases that require a specific MACHINE to be able to override it, using (?= or =)
+            log.info('Custom arch mode enabled. Arch set to %s' % args.arch)
+            if args.arch == 'random':
+                os.environ['CUSTOMARCH'] = 'random'
+                result = runner.run(suite)
+            else:  # all
+                arch_list = ['qemuarm', 'qemuarm64', 'qemumips', 'qemuppc', 'qemux86', 'qemux86-64',
+                             'beaglebone', 'genericx86', 'genericx86-64', 'mpc8315e-rdb', 'edgerouter']
+                for arch in arch_list:
+                    log.info('Run tests with custom arch set to: %s' % arch)
+                    os.environ['CUSTOMARCH'] = arch
+                    result = runner.run(suite)
+        else:
+            result = runner.run(suite)
+
         log.info("Finished")
 
         if args.coverage:
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCHv3 2/2] selftest: Added MACHINE = "qemux86" to tests that use runqemu
  2015-12-17 14:38 [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture Daniel Istrate
@ 2015-12-17 14:38 ` Daniel Istrate
  2015-12-17 14:42 ` [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture Istrate, Daniel AlexandruX
  2015-12-17 15:02 ` Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Istrate @ 2015-12-17 14:38 UTC (permalink / raw)
  To: openembedded-core

It makes sense for tests that use runqemu to have MACHINE set as qemu.
This also avoid issues when running oe-selftest with --arch random/all
option.

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
---
 meta/lib/oeqa/selftest/devtool.py       | 7 ++++---
 meta/lib/oeqa/selftest/imagefeatures.py | 9 ++++++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 0a44ae7..84665e4 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -875,10 +875,11 @@ class DevtoolTests(DevtoolBase):
         # Additionally we are testing build-time functionality as well, so
         # really this has to be done as an oe-selftest test.
         #
+
+        features = 'MACHINE = "qemux86"\n'
+        self.write_config(features)
+
         # Check preconditions
-        machine = get_bb_var('MACHINE')
-        if not machine.startswith('qemu'):
-            self.skipTest('This test only works with qemu machines')
         if not os.path.exists('/etc/runqemu-nosudo'):
             self.skipTest('You must set up tap devices with scripts/runqemu-gen-tapdevs before running this test')
         result = runCmd('PATH="$PATH:/sbin:/usr/sbin" ip tuntap show', ignore_status=True)
diff --git a/meta/lib/oeqa/selftest/imagefeatures.py b/meta/lib/oeqa/selftest/imagefeatures.py
index 4efb0d9..62ddc52 100644
--- a/meta/lib/oeqa/selftest/imagefeatures.py
+++ b/meta/lib/oeqa/selftest/imagefeatures.py
@@ -22,7 +22,8 @@ class ImageFeatures(oeSelfTest):
         AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
         """
 
-        features = 'EXTRA_IMAGE_FEATURES = "ssh-server-openssh empty-root-password allow-empty-password"\n'
+        features = 'MACHINE = "qemux86"\n'
+        features += 'EXTRA_IMAGE_FEATURES = "ssh-server-openssh empty-root-password allow-empty-password"\n'
         features += 'INHERIT += "extrausers"\n'
         features += 'EXTRA_USERS_PARAMS = "useradd -p \'\' {}; usermod -s /bin/sh {};"'.format(self.test_user, self.test_user)
         self.write_config(features)
@@ -48,7 +49,8 @@ class ImageFeatures(oeSelfTest):
         AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
         """
 
-        features = 'EXTRA_IMAGE_FEATURES = "ssh-server-openssh allow-empty-password"\n'
+        features = 'MACHINE = "qemux86"\n'
+        features += 'EXTRA_IMAGE_FEATURES = "ssh-server-openssh allow-empty-password"\n'
         features += 'INHERIT += "extrausers"\n'
         features += 'EXTRA_USERS_PARAMS = "useradd -p \'\' {}; usermod -s /bin/sh {};"'.format(self.test_user, self.test_user)
         self.write_config(features)
@@ -77,7 +79,8 @@ class ImageFeatures(oeSelfTest):
         AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
         """
 
-        features = 'PREFERRED_VERSION_rpm = "4.%"\n'
+        features = 'MACHINE = "qemux86"\n'
+        features += 'PREFERRED_VERSION_rpm = "4.%"\n'
         features += 'PREFERRED_VERSION_rpm-native = "4.%"\n'
         # Use openssh in IMAGE_INSTALL instead of ssh-server-openssh in EXTRA_IMAGE_FEATURES as a workaround for bug 8047
         features += 'IMAGE_INSTALL_append = " openssh"\n'
-- 
2.1.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture
  2015-12-17 14:38 [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture Daniel Istrate
  2015-12-17 14:38 ` [PATCHv3 2/2] selftest: Added MACHINE = "qemux86" to tests that use runqemu Daniel Istrate
@ 2015-12-17 14:42 ` Istrate, Daniel AlexandruX
  2015-12-17 15:02 ` Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Istrate, Daniel AlexandruX @ 2015-12-17 14:42 UTC (permalink / raw)
  To: openembedded-core@lists.openembedded.org

Added warning message for tests that override MACHINE previously set by --arch option.

16:40:46 [daniel@fedora-ws poky-build]$ oe-selftest --run-tests-by name test_all_users_can_connect_via_ssh_without_password --arch random
2015-12-17 16:40:55,256 - selftest - INFO - Running bitbake -e to get BBPATH
2015-12-17 16:40:58,074 - selftest - INFO - Checking that everything is in order before running the tests
2015-12-17 16:41:00,852 - selftest - INFO - Running bitbake -p
2015-12-17 16:41:07,591 - selftest - INFO - Loading tests from: oeqa.selftest.imagefeatures.ImageFeatures.test_all_users_can_connect_via_ssh_without_password
2015-12-17 16:41:07,592 - selftest - INFO - Adding: "include selftest.inc" in local.conf
2015-12-17 16:41:07,592 - selftest - INFO - Adding: "include bblayers.inc" in bblayers.conf
2015-12-17 16:41:07,592 - selftest - INFO - Custom arch mode enabled. Arch set to random
2015-12-17 16:41:07 - test_all_users_can_connect_via_ssh_without_password (oeqa.selftest.imagefeatures.ImageFeatures) ... Arch: qemuarm64
2015-12-17 16:41:10,334 - selftest.base - WARNING - Arch overridden: qemux86
Parsing recipes..done.
ok

----------------------------------------------------------------------
Ran 1 test in 153.521s

OK
2015-12-17 16:43:41,114 - selftest - INFO - Finished
2015-12-17 16:43:41,114 - selftest - INFO - Removing the include from local.conf
2015-12-17 16:43:41,115 - selftest - INFO - Removing the include from bblayers.conf

-----Original Message-----
From: Istrate, Daniel AlexandruX 
Sent: Thursday, December 17, 2015 16:38
To: openembedded-core@lists.openembedded.org
Cc: Istrate, Daniel AlexandruX <daniel.alexandrux.istrate@intel.com>
Subject: [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture

Add an option for random arch into oe-selftest:
--arch [random/all]
1. random: will set a random MACHINE for each test 2. all: will run tests for all architectures

Custom arch sets only weak default values (??=) for MACHINE in local.conf.
This let test cases that require a specific MACHINE to be able to override it, using (?= or =).

e.g.:
oe-selftest --run-tests signing --arch random --> will run all tests switching MACHINE randomly for each test

oe-selftest --run-tests signing --arch all --> for each arch will run all tests

oe-selftest --run-all-tests --arch random

Also update oeqa/selftest/base.py to accomodate this feature.

Fix for [YOCTO #5880].

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
---
 meta/lib/oeqa/selftest/base.py | 49 ++++++++++++++++++++++++++++++++++++------
 scripts/oe-selftest            | 34 +++++++++++++++++++++++------
 2 files changed, 70 insertions(+), 13 deletions(-)

diff --git a/meta/lib/oeqa/selftest/base.py b/meta/lib/oeqa/selftest/base.py index 9bddc23..d71bbbd 100644
--- a/meta/lib/oeqa/selftest/base.py
+++ b/meta/lib/oeqa/selftest/base.py
@@ -16,6 +16,7 @@ import errno
 import oeqa.utils.ftools as ftools
 from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer  from oeqa.utils.decorators import LogResults
+from random import choice
 
 @LogResults
 class oeSelfTest(unittest.TestCase):
@@ -29,9 +30,12 @@ class oeSelfTest(unittest.TestCase):
         self.testinc_path = os.path.join(self.builddir, "conf/selftest.inc")
         self.local_bblayers_path = os.path.join(self.builddir, "conf/bblayers.conf")
         self.testinc_bblayers_path = os.path.join(self.builddir, "conf/bblayers.inc")
+        self.archinc_path = os.path.join(self.builddir, 
+ "conf/arch.inc")
         self.testlayer_path = oeSelfTest.testlayer_path
         self._extra_tear_down_commands = []
-        self._track_for_cleanup = [self.testinc_path]
+        self._track_for_cleanup = [self.testinc_path, self.testinc_bblayers_path, self.archinc_path]
+        self.arch_list = ['qemuarm', 'qemuarm64', 'qemumips', 'qemuppc', 'qemux86', 'qemux86-64',
+                          'beaglebone', 'genericx86', 'genericx86-64', 
+ 'mpc8315e-rdb', 'edgerouter']
         super(oeSelfTest, self).__init__(methodName)
 
     def setUp(self):
@@ -47,11 +51,25 @@ class oeSelfTest(unittest.TestCase):
             for f in files:
                 if f == 'test_recipe.inc':
                     os.remove(os.path.join(root, f))
-        try:
-            os.remove(self.testinc_bblayers_path)
-        except OSError as e:
-            if e.errno != errno.ENOENT:
-                raise
+
+        for incl_file in [self.testinc_bblayers_path, self.archinc_path]:
+            try:
+                os.remove(incl_file)
+            except OSError as e:
+                if e.errno != errno.ENOENT:
+                    raise
+
+        # Get CUSTOMARCH from env (set by --arch argument to oe-selftest)
+        customarch = os.getenv('CUSTOMARCH')
+        if customarch:
+            if customarch == 'random':
+                machine = self.get_random_arch()
+            else:
+                machine = customarch
+            arch_conf = 'MACHINE ??= "%s"\n' % machine
+            self.set_arch_config(arch_conf)
+            print 'Arch: %s' % machine
+
         # tests might need their own setup
         # but if they overwrite this one they have to call
         # super each time, so let's give them an alternative @@ -99,11 +117,21 @@ class oeSelfTest(unittest.TestCase):
         self.log.debug("Writing to: %s\n%s\n" % (self.testinc_path, data))
         ftools.write_file(self.testinc_path, data)
 
+        customarch = os.getenv('CUSTOMARCH')
+        if customarch and 'MACHINE' in data:
+            machine = get_bb_var('MACHINE')
+            self.log.warning('Arch overridden: %s' % machine)
+
     # append to <builddir>/conf/selftest.inc
     def append_config(self, data):
         self.log.debug("Appending to: %s\n%s\n" % (self.testinc_path, data))
         ftools.append_file(self.testinc_path, data)
 
+        customarch = os.getenv('CUSTOMARCH')
+        if customarch and 'MACHINE' in data:
+            machine = get_bb_var('MACHINE')
+            self.log.warning('Arch overridden: %s' % machine)
+
     # remove data from <builddir>/conf/selftest.inc
     def remove_config(self, data):
         self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_path, data)) @@ -151,3 +179,12 @@ class oeSelfTest(unittest.TestCase):
     def remove_bblayers_config(self, data):
         self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_bblayers_path, data))
         ftools.remove_from_file(self.testinc_bblayers_path, data)
+
+    def get_random_arch(self):
+        # Return a random arch from the arch_list
+        return choice(self.arch_list)
+
+    # write to <builddir>/conf/arch.inc
+    def set_arch_config(self, data):
+        self.log.debug("Writing to: %s\n%s\n" % (self.archinc_path, data))
+        ftools.write_file(self.archinc_path, data)
diff --git a/scripts/oe-selftest b/scripts/oe-selftest index bc50b2a..8a3df19 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -78,6 +78,8 @@ def get_args_parser():
                        help='list-tests-by <name|class|module|id|tag> <list of tests|classes|modules|ids|tags>')
     group.add_argument('--list-tags', required=False, dest='list_tags', default=False, action="store_true",
                        help='List all tags that have been set to test cases.')
+    parser.add_argument('--arch', required=False, dest='arch', choices=['random', 'all'], default=None,
+                        help='Run tests on different architecture 
+ (random/all).')
     return parser
 
 
@@ -109,7 +111,7 @@ def add_include():
         not in ftools.read_file(os.path.join(builddir, "conf/local.conf")):
             log.info("Adding: \"include selftest.inc\" in local.conf")
             ftools.append_file(os.path.join(builddir, "conf/local.conf"), \
-                    "\n#include added by oe-selftest.py\ninclude selftest.inc")
+                    "\n#include added by oe-selftest.py\ninclude 
+ selftest.inc\ninclude arch.inc")
 
     if "#include added by oe-selftest.py" \
         not in ftools.read_file(os.path.join(builddir, "conf/bblayers.conf")):
@@ -125,7 +127,7 @@ def remove_include():
         in ftools.read_file(os.path.join(builddir, "conf/local.conf")):
             log.info("Removing the include from local.conf")
             ftools.remove_from_file(os.path.join(builddir, "conf/local.conf"), \
-                    "#include added by oe-selftest.py\ninclude selftest.inc")
+                    "#include added by oe-selftest.py\ninclude 
+ selftest.inc\ninclude arch.inc")
 
     if "#include added by oe-selftest.py" \
         in ftools.read_file(os.path.join(builddir, "conf/bblayers.conf")):
@@ -143,10 +145,11 @@ def remove_inc_files():
     except (AttributeError, OSError,) as e:    # AttributeError may happen if BUILDDIR is not set
         pass
 
-    try:
-        os.remove(os.path.join(os.environ.get("BUILDDIR"), "conf/bblayers.inc"))
-    except:
-        pass
+    for incl_file in ['conf/bblayers.inc', 'conf/arch.inc']:
+        try:
+            os.remove(os.path.join(os.environ.get("BUILDDIR"), incl_file))
+        except:
+            pass
 
 def get_tests(exclusive_modules=[], include_hidden=False):
     testslist = []
@@ -466,7 +469,24 @@ def main():
                 log.error(e)
                 return 1
         add_include()
-        result = runner.run(suite)
+
+        if args.arch:
+            # Custom arch sets only weak default values (??=) for MACHINE in local.conf
+            # This let test cases that require a specific MACHINE to be able to override it, using (?= or =)
+            log.info('Custom arch mode enabled. Arch set to %s' % args.arch)
+            if args.arch == 'random':
+                os.environ['CUSTOMARCH'] = 'random'
+                result = runner.run(suite)
+            else:  # all
+                arch_list = ['qemuarm', 'qemuarm64', 'qemumips', 'qemuppc', 'qemux86', 'qemux86-64',
+                             'beaglebone', 'genericx86', 'genericx86-64', 'mpc8315e-rdb', 'edgerouter']
+                for arch in arch_list:
+                    log.info('Run tests with custom arch set to: %s' % arch)
+                    os.environ['CUSTOMARCH'] = arch
+                    result = runner.run(suite)
+        else:
+            result = runner.run(suite)
+
         log.info("Finished")
 
         if args.coverage:
--
2.1.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture
  2015-12-17 14:38 [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture Daniel Istrate
  2015-12-17 14:38 ` [PATCHv3 2/2] selftest: Added MACHINE = "qemux86" to tests that use runqemu Daniel Istrate
  2015-12-17 14:42 ` [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture Istrate, Daniel AlexandruX
@ 2015-12-17 15:02 ` Richard Purdie
  2 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2015-12-17 15:02 UTC (permalink / raw)
  To: Daniel Istrate, openembedded-core

On Thu, 2015-12-17 at 16:38 +0200, Daniel Istrate wrote:
> Add an option for random arch into oe-selftest:
> --arch [random/all]
> 1. random: will set a random MACHINE for each test
> 2. all: will run tests for all architectures
> 
> Custom arch sets only weak default values (??=) for MACHINE in
> local.conf.
> This let test cases that require a specific MACHINE to be able to
> override it, using (?= or =).
> 
> e.g.:
> oe-selftest --run-tests signing --arch random -->
> will run all tests switching MACHINE randomly for each test
> 
> oe-selftest --run-tests signing --arch all -->
> for each arch will run all tests
> 
> oe-selftest --run-all-tests --arch random
> 
> Also update oeqa/selftest/base.py to accomodate this feature.
> 
> Fix for [YOCTO #5880].

This is actually incredibly confusing since "arch" means something
quite different in the OE sense and this is really "machine". I
therefore have concerns about this option name.

I also strongly dislike hardcoded lists of machines. That *cannot* go
in as it stands I'm afraid.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-17 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-17 14:38 [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture Daniel Istrate
2015-12-17 14:38 ` [PATCHv3 2/2] selftest: Added MACHINE = "qemux86" to tests that use runqemu Daniel Istrate
2015-12-17 14:42 ` [PATCHv3 1/2] scripts/oe-selftest: Allow to run tests on random/all architecture Istrate, Daniel AlexandruX
2015-12-17 15:02 ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox