All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Aníbal Limón" <anibal.limon@linux.intel.com>
To: yocto@yoctoproject.org
Cc: paul.eggleton@linux.intel.com
Subject: [[AUH] 3/6] upgradehelper.py: Add support for specify what image test.
Date: Tue,  1 Dec 2015 16:03:38 -0600	[thread overview]
Message-ID: <1449007421-26206-4-git-send-email-anibal.limon@linux.intel.com> (raw)
In-Reply-To: <1449007421-26206-1-git-send-email-anibal.limon@linux.intel.com>

Before this commit core-image-sato was hardcoded for image
to test with this commit image name can be specified in
the upgrade-helper.conf.

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
 README               |  1 +
 modules/testimage.py | 10 +++++-----
 upgradehelper.py     | 13 ++++++++-----
 3 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/README b/README
index 0756fdc..1c8eba1 100644
--- a/README
+++ b/README
@@ -68,6 +68,7 @@ machines=qemux86 qemux86-64 qemuarm qemumips qemuppc
 # optional features
 buildhistory=no
 testimage=no
+testimage_name=image-custom # defaults to core-image-sato
 
 --------------- snip ---------------
 
diff --git a/modules/testimage.py b/modules/testimage.py
index 3fbbc19..e410111 100644
--- a/modules/testimage.py
+++ b/modules/testimage.py
@@ -153,18 +153,18 @@ class TestImage():
                         f.write(line)
                     f.write("END: PTEST for %s\n" % machine)
 
-    def sato(self, machine):
+    def testimage(self, machine, image):
         os.environ['CORE_IMAGE_EXTRA_INSTALL'] = \
             self._get_pkgs_to_install(self.pkgs_ctx)
 
         if 'TEST_SUITES' in os.environ:
             del os.environ['TEST_SUITES']
 
-        I( "   building core-image-sato for %s ..." % machine)
-        self.bb.complete("core-image-sato", machine)
+        I( "   building %s for %s ..." % (image, machine))
+        self.bb.complete(image, machine)
 
-        I( "   running core-image-sato/testimage for %s ..." % machine)
-        self.bb.complete("core-image-sato -c testimage", machine)
+        I( "   running %s/testimage for %s ..." % (image, machine))
+        self.bb.complete("%s -c testimage" % image, machine)
 
         log_file = self._find_log("log.do_testimage", machine)
         shutil.copyfile(log_file,
diff --git a/upgradehelper.py b/upgradehelper.py
index 7dbfbeb..db39601 100755
--- a/upgradehelper.py
+++ b/upgradehelper.py
@@ -68,6 +68,7 @@ help_text = """Usage examples:
     $ upgrade-helper.py all
 """
 
+DEFAULT_TESTIMAGE = 'core-image-sato'
 
 def parse_cmdline():
     parser = argparse.ArgumentParser(description='Package Upgrade Helper',
@@ -314,8 +315,8 @@ class Updater(object):
             "The recipe has ptest enabled and has been tested with core-image-minimal/ptest \n" \
             "with the next machines %s. Attached is the log file.\n\n"
 
-        testimage_sato_info = \
-            "The recipe has been tested using core-image-sato testimage and succeeded with \n" \
+        testimage_info = \
+            "The recipe has been tested using %s testimage and succeeded with \n" \
             "the next machines %s. Attached is the log file.\n\n" \
 
         mail_footer = \
@@ -353,7 +354,8 @@ class Updater(object):
                 msg_body += testimage_ptest_info % machines
             if 'testimage' in pkg_ctx:
                 machines = pkg_ctx['testimage'].keys()
-                msg_body += testimage_sato_info % machines
+                msg_body += testimage_info % (settings.get('testimage_name', \
+                    DEFAULT_TESTIMAGE), machines)
 
         msg_body += mail_footer
 
@@ -602,10 +604,11 @@ class Updater(object):
                             import traceback
                             traceback.print_exc(file=sys.stdout)
 
+                    image = settings.get('testimage_name', DEFAULT_TESTIMAGE)
                     try:
-                        tim.sato(machine)
+                        tim.testimage(machine, image)
                     except Exception as e:
-                        E(" core-image-sato/testimage on machine %s failed" % machine)
+                        E(" %s/testimage on machine %s failed" % (image, machine))
                         if isinstance(e, Error):
                             E(" %s" % e.stdout)
                         else:
-- 
2.1.4



  parent reply	other threads:[~2015-12-01 22:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 22:03 [[AUH] 0/6] Integration error handling and enhacements Aníbal Limón
2015-12-01 22:03 ` [[AUH] 1/6] recipe/git.py: Add missing import of re module Aníbal Limón
2015-12-01 22:03 ` [[AUH] 2/6] upgradehelper.py: Add support for preserve logs in workdir Aníbal Limón
2015-12-01 22:03 ` Aníbal Limón [this message]
2015-12-01 22:03 ` [[AUH] 4/6] testimage/ptest: Add require of ptest-pkgs in EXTRA_IMAGE_FEATURES Aníbal Limón
2015-12-11  1:31   ` Paul Eggleton
2015-12-01 22:03 ` [[AUH] 5/6] testimage: Add handling of IntegrationError Aníbal Limón
2015-12-01 22:03 ` [[AUH] 6/6] upgradehelper: Remove deprecated setting drop_previous_commits Aníbal Limón

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=1449007421-26206-4-git-send-email-anibal.limon@linux.intel.com \
    --to=anibal.limon@linux.intel.com \
    --cc=paul.eggleton@linux.intel.com \
    --cc=yocto@yoctoproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.