← Back to team overview

ubuntu-server-iso-testing-dev team mailing list archive

[Merge] lp:~jibel/ubuntu-server-iso-testing/media_info into lp:ubuntu-server-iso-testing

 

Jean-Baptiste Lallement has proposed merging lp:~jibel/ubuntu-server-iso-testing/media_info into lp:ubuntu-server-iso-testing.

Requested reviews:
  Ubuntu Server Iso Testing Developers (ubuntu-server-iso-testing-dev)
Related bugs:
  Bug #824486 in ubuntu-server-iso-testing: "Add disk info to the build artefacts"
  https://bugs.launchpad.net/ubuntu-server-iso-testing/+bug/824486
  Bug #824489 in ubuntu-server-iso-testing: "Change keyboard layout from en_CA to en_US in preseeds"
  https://bugs.launchpad.net/ubuntu-server-iso-testing/+bug/824489

For more details, see:
https://code.launchpad.net/~jibel/ubuntu-server-iso-testing/media_info/+merge/71207

.disk/info contains the definition of the build like:
Ubuntu-Server 11.10 "Oneiric Ocelot" - Alpha amd64 (20110811)

Since it includes the build version, there is no ambiguity about what is being tested.
-- 
https://code.launchpad.net/~jibel/ubuntu-server-iso-testing/media_info/+merge/71207
Your team Ubuntu Server Iso Testing Developers is requested to review the proposed merge of lp:~jibel/ubuntu-server-iso-testing/media_info into lp:ubuntu-server-iso-testing.
=== modified file 'run-test.py'
--- run-test.py	2011-08-09 16:37:30 +0000
+++ run-test.py	2011-08-11 13:48:41 +0000
@@ -81,11 +81,27 @@
         logging.info("Option doesn't exists: '%s/%s'", section, option)
         return ''
 
+def add_media_info(isopath, destdb, doc):
+    """Extract .disk/info from iso and add it as attachment to couchdb"""
+    logging.debug('Extracting media info from ISO')
+
+    cmd = ['bsdtar', '-xf', isopath, '-O', '.disk/info' ]
+    logging.debug("Cmd: %s", (cmd))
+    media_info = ''
+    try:
+        media_info = subprocess.check_output(cmd)
+        logging.debug('Media Info: %s', media_info)
+        destdb.put_attachment(doc, media_info, "media_info")
+    except:
+        return False
+
+    return True
+
 # Defaults
 DEFAULT_VARIANT = 'server'
 DEFAULT_RELEASE = 'oneiric'
 DEFAULT_ARCH = 'i386'
-DEFAULT_FLAVOR= 'ubuntu-server'
+DEFAULT_FLAVOR = 'ubuntu-server'
 DEFAULT_ISOROOT = os.path.expanduser('~/isos')
 DEFAULT_TMPL_DIR = "/usr/share/ubuntu-server-iso-testing/templates"
 DEFAULT_TEST_TIMEOUT = 1200
@@ -101,7 +117,7 @@
 INITRD = "initrd.gz"
 KERNEL = "vmlinuz"
 
-usage="usage: %prog [options] preseed1"
+usage = "usage: %prog [options] preseed1"
 parser = optparse.OptionParser(usage=usage)
 parser.add_option("-d", "--debug", dest="debug", action="store_true",  default=False,
                   help="enable debugging")
@@ -157,12 +173,12 @@
 # configurable using environment variable.
 SLEEP_TIME = 30
 try:
-    TEST_TIMEOUT = int(os.environ.get("TEST_TIMEOUT",DEFAULT_TEST_TIMEOUT))
+    TEST_TIMEOUT = int(os.environ.get("TEST_TIMEOUT", DEFAULT_TEST_TIMEOUT))
 except ValueError:
     TEST_TIMEOUT = DEFAULT_TEST_TIMEOUT
 
 logging.info("Preseed: %s" % (args[0]))
-preseed= os.path.join(TEST_CASE_DIR,args[0])
+preseed = os.path.join(TEST_CASE_DIR,args[0])
 
 # See http://kennethreitz.com/blog/generate-a-random-mac-address-in-python/
 def random_mac_address():
@@ -218,6 +234,7 @@
 old_wd = os.getcwd()
 mac_address = random_mac_address()
 test_uuid = str(uuid.uuid4())
+logging.debug("Couch Document UUID: '%s'", test_uuid)
 db[test_uuid] = { "test_case": t_preseed,
                   "states": {
                       'creating': datetime.datetime.utcnow().isoformat()
@@ -251,12 +268,15 @@
 test_case_doc = db[test_uuid]
 db.put_attachment(test_case_doc, open(preseed_file), "preseed")
 
+# Adding media info
+add_media_info( iso_location, db, test_case_doc)
+
 # Create location for TFTP setup 
 # test_tftp_dir = os.path.join(TFTP_DIR,test_uuid)
 # os.makedirs(test_tftp_dir)
 
 logging.debug("Copying preseed to tftp root")
-shutil.copy(preseed_file,os.path.join(TFTP_DIR,'preseed.%s' % test_uuid))
+shutil.copy(preseed_file, os.path.join(TFTP_DIR, 'preseed.%s' % test_uuid))
 
 logging.info("Copying %s -> %s", RUN_TEST, initrd_tmp_dir)
 # Put run_test in the initrd so that the installer can copy it

=== modified file 'templates.kernel/preseeds-common/base'
--- templates.kernel/preseeds-common/base	2011-07-13 04:42:32 +0000
+++ templates.kernel/preseeds-common/base	2011-08-11 13:48:41 +0000
@@ -20,13 +20,13 @@
 
 ### Localization
 # Locale sets language and country.
-d-i debian-installer/locale string en_CA.UTF-8
+d-i debian-installer/locale string en_US.UTF-8
 
 # Keyboard selection.
 # Disable automatic (interactive) keymap detection.
 d-i console-setup/ask_detect boolean false
 #d-i console-setup/modelcode string pc105
-d-i console-setup/layoutcode string ca
+d-i console-setup/layoutcode string us
 # To select a variant of the selected layout (if you leave this out, the
 # basic form of the layout will be used):
 #d-i console-setup/variantcode string dvorak

=== modified file 'templates.kernel/test_cases/akt-dbench/preseed'
--- templates.kernel/test_cases/akt-dbench/preseed	2011-06-14 10:00:59 +0000
+++ templates.kernel/test_cases/akt-dbench/preseed	2011-08-11 13:48:41 +0000
@@ -1,12 +1,12 @@
 ### Localization
 # Locale sets language and country.
-d-i debian-installer/locale string en_CA.UTF-8
+d-i debian-installer/locale string en_US.UTF-8
 
 # Keyboard selection.
 # Disable automatic (interactive) keymap detection.
 d-i console-setup/ask_detect boolean false
 #d-i console-setup/modelcode string pc105
-d-i console-setup/layoutcode string ca
+d-i console-setup/layoutcode string us
 # To select a variant of the selected layout (if you leave this out, the
 # basic form of the layout will be used):
 #d-i console-setup/variantcode string dvorak

=== modified file 'templates.kernel/test_cases/akt-tbench/preseed'
--- templates.kernel/test_cases/akt-tbench/preseed	2011-06-14 10:00:59 +0000
+++ templates.kernel/test_cases/akt-tbench/preseed	2011-08-11 13:48:41 +0000
@@ -1,12 +1,12 @@
 ### Localization
 # Locale sets language and country.
-d-i debian-installer/locale string en_CA.UTF-8
+d-i debian-installer/locale string en_US.UTF-8
 
 # Keyboard selection.
 # Disable automatic (interactive) keymap detection.
 d-i console-setup/ask_detect boolean false
 #d-i console-setup/modelcode string pc105
-d-i console-setup/layoutcode string ca
+d-i console-setup/layoutcode string us
 # To select a variant of the selected layout (if you leave this out, the
 # basic form of the layout will be used):
 #d-i console-setup/variantcode string dvorak

=== modified file 'templates/preseeds-common/base'
--- templates/preseeds-common/base	2011-01-31 14:55:01 +0000
+++ templates/preseeds-common/base	2011-08-11 13:48:41 +0000
@@ -20,13 +20,13 @@
 
 ### Localization
 # Locale sets language and country.
-d-i debian-installer/locale string en_CA.UTF-8
+d-i debian-installer/locale string en_US.UTF-8
 
 # Keyboard selection.
 # Disable automatic (interactive) keymap detection.
 d-i console-setup/ask_detect boolean false
 #d-i console-setup/modelcode string pc105
-d-i console-setup/layoutcode string ca
+d-i console-setup/layoutcode string us
 # To select a variant of the selected layout (if you leave this out, the
 # basic form of the layout will be used):
 #d-i console-setup/variantcode string dvorak

=== modified file 'templates/test_cases/akt-dbench/preseed'
--- templates/test_cases/akt-dbench/preseed	2011-01-14 23:42:59 +0000
+++ templates/test_cases/akt-dbench/preseed	2011-08-11 13:48:41 +0000
@@ -1,12 +1,12 @@
 ### Localization
 # Locale sets language and country.
-d-i debian-installer/locale string en_CA.UTF-8
+d-i debian-installer/locale string en_US.UTF-8
 
 # Keyboard selection.
 # Disable automatic (interactive) keymap detection.
 d-i console-setup/ask_detect boolean false
 #d-i console-setup/modelcode string pc105
-d-i console-setup/layoutcode string ca
+d-i console-setup/layoutcode string us
 # To select a variant of the selected layout (if you leave this out, the
 # basic form of the layout will be used):
 #d-i console-setup/variantcode string dvorak

=== modified file 'templates/test_cases/akt-tbench/preseed'
--- templates/test_cases/akt-tbench/preseed	2011-01-14 23:42:59 +0000
+++ templates/test_cases/akt-tbench/preseed	2011-08-11 13:48:41 +0000
@@ -1,12 +1,12 @@
 ### Localization
 # Locale sets language and country.
-d-i debian-installer/locale string en_CA.UTF-8
+d-i debian-installer/locale string en_US.UTF-8
 
 # Keyboard selection.
 # Disable automatic (interactive) keymap detection.
 d-i console-setup/ask_detect boolean false
 #d-i console-setup/modelcode string pc105
-d-i console-setup/layoutcode string ca
+d-i console-setup/layoutcode string us
 # To select a variant of the selected layout (if you leave this out, the
 # basic form of the layout will be used):
 #d-i console-setup/variantcode string dvorak


Follow ups