Automated testing of Ubuntu ISO images

Merge lp:~james-page/ubuntu-server-iso-testing/disk-configuration-features into lp:ubuntu-server-iso-testing

Proposed by James Page on 2011-12-16
Status: Merged
Merged at revision: 255
Proposed branch: lp:~james-page/ubuntu-server-iso-testing/disk-configuration-features
Merge into: lp:ubuntu-server-iso-testing
Diff against target: 62 lines (+17/-4) 2 files modified
To merge this branch: bzr merge lp:~james-page/ubuntu-server-iso-testing/disk-configuration-features
Reviewer Review Type Date Requested Status
Jean-Baptiste Lallement 2011-12-16 Approve on 2011-12-16
Review via email: mp+86010@code.launchpad.net

Description of the Change

Features:

Support configuration on a per test case basis of

a) disk size

[vm]
disk_size=4G

b) disk number (for RAID testing)

[vm]
disk_number=2

Also tidied up version number in changelog and fixed minor issue with relative
paths for test templates.

To post a comment you must log in.
Jean-Baptiste Lallement (jibel) wrote :

looks good. thanks!

review: Approve

Preview Diff

1=== modified file 'debian/changelog'
2--- debian/changelog 2011-11-16 17:00:07 +0000
3+++ debian/changelog 2011-12-16 09:23:30 +0000
4@@ -1,3 +1,12 @@
5+ubuntu-iso-testing (1.3) oneiric; urgency=low
6+
7+ * Allow test_cases to override default disk size of 2G using
8+ config file in test_case directory (section - vm - option disk_size).
9+ * Support multiple disks for RAID testing using
10+ config file in test_case directory (section - vm - option disk_number).
11+
12+ -- James Page <james.page@ubuntu.com> Fri, 16 Dec 2011 09:12:38 +0000
13+
14 ubuntu-iso-testing (1.2ubuntu1) precise; urgency=low
15
16 * debian/control: added python-apt as a build depends
17
18=== modified file 'run-test.py'
19--- run-test.py 2011-11-15 17:00:14 +0000
20+++ run-test.py 2011-12-16 09:23:30 +0000
21@@ -76,7 +76,7 @@
22
23 return config
24
25-def get_config_value(config, section, option):
26+def get_config_value(config, section, option, default=''):
27 """Return the value for a section/option in a preloaded config file"""
28 logging.debug("Loading configuration option: '%s/%s'", section, option)
29 try:
30@@ -84,10 +84,10 @@
31 return value
32 except ConfigParser.NoSectionError:
33 logging.info("Section doesn't exists: '%s'", section)
34- return ''
35+ return default
36 except ConfigParser.NoOptionError:
37 logging.info("Option doesn't exists: '%s/%s'", section, option)
38- return ''
39+ return default
40
41 def add_media_info(isopath, destdb, doc):
42 """Extract .disk/info from iso and add it as attachment to couchdb"""
43@@ -179,7 +179,7 @@
44 # Get all environment variable for general test configuration
45 global TMPL_DIR
46 if options.test_dir:
47- TMPL_DIR = options.test_dir
48+ TMPL_DIR = os.path.abspath(options.test_dir)
49 else:
50 TMPL_DIR = DEFAULT_TMPL_DIR
51
52@@ -426,6 +426,10 @@
53 db.put_attachment(test_case_doc, open(t_script),
54 filename="tests/%s" % (t_preseed))
55
56+# Allow tests to override the default disk size
57+DISK_SIZE = get_config_value(test_config, 'vm', 'disk_size', DISK_SIZE)
58+DISK_NUMBER = int(get_config_value(test_config, 'vm', 'disk_number', DISK_NUMBER))
59+
60 logging.debug("Generating libvirt information for %s" % (preseed))
61 logging.debug("Generating disk information")
62 disks = []

Subscribers

People subscribed via source and target branches