Merge lp:~utah/utah/bug1039555 into lp:utah

Proposed by Javier Collado
Status: Merged
Approved by: Javier Collado
Approved revision: 666
Merged at revision: 675
Proposed branch: lp:~utah/utah/bug1039555
Merge into: lp:utah
Diff against target: 720 lines (+340/-71) (has conflicts)
20 files modified
Makefile (+6/-2)
client-Makefile (+6/-2)
client.py (+16/-14)
debian/control (+4/-0)
debian/rules (+3/-0)
debian/utah-client.manpages (+1/-0)
debian/utah.manpages (+4/-0)
docs/Makefile (+1/-0)
docs/source/conf.py (+100/-2)
docs/source/introduction.rst (+1/-1)
docs/source/man/run_install_test.py.rst (+26/-0)
docs/source/man/run_test_cobbler.py.rst (+26/-0)
docs/source/man/run_test_vm.py.rst (+26/-0)
docs/source/man/run_utah_tests.py.rst (+26/-0)
docs/source/man/utah.rst (+16/-0)
examples/run_install_test.py (+22/-14)
examples/run_test_cobbler.py (+15/-10)
examples/run_test_vm.py (+15/-10)
examples/run_utah_tests.py (+25/-15)
utah_howto.txt (+1/-1)
Text conflict in debian/control
Text conflict in docs/source/conf.py
To merge this branch: bzr merge lp:~utah/utah/bug1039555
Reviewer Review Type Date Requested Status
Gema Gomez (community) Approve
Max Brustkern (community) Approve
Review via email: mp+124172@code.launchpad.net

Description of the change

This branch adds manual pages for both the server and the client packages.

The packaging changes have been already reviewed when merging other branches to this one, so the final thing to be reviewed before merging to dev, should be just the text for the manual pages which is autogenerated from the parser objects in the code.

To review this, please follow these steps:
bzr branch lp:~utah/utah/bug1039555
make manpages
man ./docs/build/man/<script>.1

where <script> is any of the scripts in both the client and server packages.

To post a comment you must log in.
Revision history for this message
Max Brustkern (nuclearbob) wrote :

This looks good to me.

review: Approve
Revision history for this message
Gema Gomez (gema) wrote :

The run_utah_tests documentation could do with some explaining on how it uses the other scripts.

The utah document needs a bit more of description, explicitely saying that is only intended to be used for development purposes or when the machine targetted for the testing is the current development machine, that otherwise it'll be used by run_utah_tests after provisioning the test environment.

Other than that I like the documents a lot, please make sure to explain max and joe how to keep them up to date.

review: Approve
lp:~utah/utah/bug1039555 updated
664. By Javier Collado

Updated description to describe what the client actually does

665. By Javier Collado

Added note to make clear that run_utah_tests is a wrapper around the other scripts

666. By Javier Collado

Added note to describe when `utah` should be used

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2012-08-14 16:42:41 +0000
+++ Makefile 2012-09-14 11:09:20 +0000
@@ -1,5 +1,5 @@
1PYC_PATTERN?=*.pyc1PYC_PATTERN?=*.pyc
2all: client conf/utah/bootspeed-preseed.cfg conf/utah/bridged-network-vm.xml conf/utah/config2all: client conf/utah/bootspeed-preseed.cfg conf/utah/bridged-network-vm.xml conf/utah/config manpages
33
4client:4client:
5 [ -d "client" ] || mkdir client5 [ -d "client" ] || mkdir client
@@ -17,6 +17,9 @@
17conf/utah/config:17conf/utah/config:
18 ./utah/config.py > conf/utah/config18 ./utah/config.py > conf/utah/config
1919
20manpages:
21 cd docs && make man
22
20clean:23clean:
21 find . -name "$(PYC_PATTERN)" -delete24 find . -name "$(PYC_PATTERN)" -delete
22 rm -rf client25 rm -rf client
@@ -25,5 +28,6 @@
25 rm -f utah/config28 rm -f utah/config
26 rm -f utah_*29 rm -f utah_*
27 rm -f utah-*30 rm -f utah-*
31 cd docs && make clean
2832
29.PHONY: client clean33.PHONY: client clean manpages
3034
=== modified file 'client-Makefile'
--- client-Makefile 2012-05-21 14:05:50 +0000
+++ client-Makefile 2012-09-14 11:09:20 +0000
@@ -1,4 +1,4 @@
1all: utah-client_fake_all.deb utah/config1all: utah-client_fake_all.deb utah/config manpages
22
3utah-client_fake_all.deb:3utah-client_fake_all.deb:
4 touch utah-client_fake_all.deb4 touch utah-client_fake_all.deb
@@ -6,7 +6,11 @@
6utah/config:6utah/config:
7 touch utah/config7 touch utah/config
88
9manpages:
10 cd docs && make man
11
9clean:12clean:
10 rm utah/config13 rm utah/config
14 cd docs && make clean
1115
12.PHONY: clean16.PHONY: clean manpages
1317
=== modified file 'client.py'
--- client.py 2012-08-31 09:25:38 +0000
+++ client.py 2012-09-14 11:09:20 +0000
@@ -14,23 +14,28 @@
14from utah.client.exceptions import UTAHClientError14from utah.client.exceptions import UTAHClientError
1515
1616
17def process_cmdline_argparse():17def get_parser():
18 """18 """
19 Process the command line arguments.19 Process the command line arguments.
20 """20 """
21
22 # requires Python2.7+21 # requires Python2.7+
23 import argparse22 import argparse
2423
25 parser = argparse.ArgumentParser(24 parser = argparse.ArgumentParser(
26 description='Ubuntu Automation Testing Harness')25 description='''Run test cases locally and write results to a file.
26
27Note: This is expected to be used only for development purposes on a machine
28that has been provisioned using run_utah_tests.py''',
29 formatter_class=argparse.RawTextHelpFormatter)
27 parser.add_argument('--resume', action='store_true',30 parser.add_argument('--resume', action='store_true',
28 help='Continue a previous run. Used after a reboot')31 help='Continue a previous run. Used after a reboot')
29 parser.add_argument('-s', '--state-file',32 parser.add_argument('-s', '--state-file',
30 help=('File to use for storing state (default "%s"'33 help=('File to use for storing state (default "%s")'
31 % DEFAULT_STATE_FILE))34 % DEFAULT_STATE_FILE))
32 parser.add_argument('-f', '--format', choices=['text', 'yaml', 'json'],35 parser.add_argument('-f', '--format',
33 default='yaml', help='Output format (default "yaml")')36 choices=['text', 'yaml', 'json'],
37 default='yaml',
38 help='Output format (default "%(default)s")')
34 parser.add_argument('-t', '--testdir',39 parser.add_argument('-t', '--testdir',
35 default='/var/lib/utah', help='Main test directory')40 default='/var/lib/utah', help='Main test directory')
36 parser.add_argument('-i', '--install-type',41 parser.add_argument('-i', '--install-type',
@@ -49,13 +54,7 @@
49 parser.add_argument('-d', '--debug', action='store_true',54 parser.add_argument('-d', '--debug', action='store_true',
50 help='Print debugging output')55 help='Print debugging output')
5156
52 args = parser.parse_args()57 return parser
53
54 return args
55
56# TODO: write <2.7 optparse version and set based on version of python
57# being used.
58process_cmdline = process_cmdline_argparse
5958
6059
61def exit(returncode, msg):60def exit(returncode, msg):
@@ -77,7 +76,10 @@
77 """76 """
78 The main driver for the 'utah' application.77 The main driver for the 'utah' application.
79 """78 """
80 args = process_cmdline()79 # TODO: write <2.7 optparse version and set based on version of python
80 # being used.
81 parser = get_parser()
82 args = parser.parse_args()
8183
82 # When resuming, this script is invoked as root by rc.local84 # When resuming, this script is invoked as root by rc.local
83 # No group membership is assigned then, so root needs to be able to run85 # No group membership is assigned then, so root needs to be able to run
8486
=== modified file 'debian/control'
--- debian/control 2012-09-13 12:41:29 +0000
+++ debian/control 2012-09-14 11:09:20 +0000
@@ -3,7 +3,11 @@
3X-Python-Version: >= 2.53X-Python-Version: >= 2.5
4Priority: optional4Priority: optional
5Maintainer: Max Brustkern <max@canonical.com>5Maintainer: Max Brustkern <max@canonical.com>
6<<<<<<< TREE
6Build-Depends: debhelper (>= 7.0.50~), devscripts, python-all7Build-Depends: debhelper (>= 7.0.50~), devscripts, python-all
8=======
9Build-Depends: debhelper (>= 7.0.50~), devscripts, python-all, python-sphinx
10>>>>>>> MERGE-SOURCE
7Standards-Version: 3.9.311Standards-Version: 3.9.3
8Homepage: https://code.launchpad.net/utah12Homepage: https://code.launchpad.net/utah
9Vcs-Bzr: https://code.launchpad.net/utah13Vcs-Bzr: https://code.launchpad.net/utah
1014
=== modified file 'debian/rules'
--- debian/rules 2012-08-17 09:47:01 +0000
+++ debian/rules 2012-09-14 11:09:20 +0000
@@ -47,3 +47,6 @@
47 fi;\47 fi;\
48 done48 done
49 dh_auto_install49 dh_auto_install
50
51override_dh_installman:
52 dh_installman --language=C
5053
=== added file 'debian/utah-client.manpages'
--- debian/utah-client.manpages 1970-01-01 00:00:00 +0000
+++ debian/utah-client.manpages 2012-09-14 11:09:20 +0000
@@ -0,0 +1,1 @@
1docs/build/man/utah.1
02
=== added file 'debian/utah.manpages'
--- debian/utah.manpages 1970-01-01 00:00:00 +0000
+++ debian/utah.manpages 2012-09-14 11:09:20 +0000
@@ -0,0 +1,4 @@
1docs/build/man/run_install_test.py.1
2docs/build/man/run_test_cobbler.py.1
3docs/build/man/run_test_vm.py.1
4docs/build/man/run_utah_tests.py.1
05
=== modified file 'docs/Makefile'
--- docs/Makefile 2012-08-07 16:06:37 +0000
+++ docs/Makefile 2012-09-14 11:09:20 +0000
@@ -40,6 +40,7 @@
4040
41clean:41clean:
42 -rm -rf $(BUILDDIR)/*42 -rm -rf $(BUILDDIR)/*
43 -rm source/man/*.txt # Autogenerated content for man pages
4344
44html:45html:
45 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html46 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
4647
=== modified file 'docs/source/conf.py'
--- docs/source/conf.py 2012-09-06 15:44:36 +0000
+++ docs/source/conf.py 2012-09-14 11:09:20 +0000
@@ -12,13 +12,20 @@
12# All configuration values have a default; values that are commented out12# All configuration values have a default; values that are commented out
13# serve to show the default.13# serve to show the default.
1414
15<<<<<<< TREE
15import sys16import sys
16import os17import os
18=======
19import sys, os
20import itertools
21import re
22>>>>>>> MERGE-SOURCE
1723
18# If extensions (or modules to document with autodoc) are in another directory,24# If extensions (or modules to document with autodoc) are in another directory,
19# add these directories to sys.path here. If the directory is relative to the25# add these directories to sys.path here. If the directory is relative to the
20# documentation root, use os.path.abspath to make it absolute, like shown here.26# documentation root, use os.path.abspath to make it absolute, like shown here.
21sys.path.insert(0, os.path.abspath('../..'))27sys.path.insert(0, os.path.abspath('../..'))
28sys.path.insert(0, os.path.abspath('../../examples'))
2229
2330
24class ModuleMock(object):31class ModuleMock(object):
@@ -64,14 +71,96 @@
64 'apt', 'apt.cache'):71 'apt', 'apt.cache'):
65 sys.modules[mod_name] = ModuleMock(mod_name)72 sys.modules[mod_name] = ModuleMock(mod_name)
6673
74<<<<<<< TREE
67# -- General configuration ----------------------------------------------------75# -- General configuration ----------------------------------------------------
76=======
77
78# Autogenerate help contents for manual pages when building manual pages
79# Note: This assumes that sphinx-build is called as in the makefile like this:
80# /usr/bin/sphinx-build -b man <sphinx_opts>
81if sys.argv[2] == 'man':
82 def get_parser_strings(script_name, parser):
83 description = parser.description
84
85 help_lines = parser.format_help().splitlines()
86 options_lines = itertools.dropwhile(
87 lambda l: l != 'optional arguments:',
88 help_lines) # Drop usage
89 options_lines = itertools.takewhile(
90 lambda l: bool(l),
91 options_lines) # Drop epilog
92 options_lines.next() # Drop first line
93
94 def fix_line(line):
95 """
96 Remove indentation and replace curly braces with angle brackets
97 to match the expected format
98 """
99 line = line[2:]
100
101 # Apply changes only to option lines,
102 # not the ones with the help text
103 if line.startswith('-'):
104 line = line.replace('{', '<')
105 line = line.replace('}', '>')
106 return line
107
108 options_lines = [fix_line(line) for line in options_lines]
109 options = '\n'.join(options_lines)
110
111 if parser.epilog is None:
112 epilog = ''
113 else:
114 # Highlight program name and options
115 epilog = parser.epilog % {'prog': '**%s**' % script_name}
116 epilog = re.sub(r'(-\w)', r'**\1**', epilog)
117
118 # Duplicate backslashes to avoid dropping them
119 # because of the rst formatting
120 epilog = re.sub(r'\\', r'\\\\', epilog)
121
122 # Drop 'For example:'
123 epilog = '\n'.join(epilog.splitlines()[1:])
124
125 # Use line blocks to preserve line breaks
126 # Make sure that block is in a separate paragraph
127 epilog = re.sub(r'^\t', '\n| ', epilog, flags=re.M, count=1)
128 epilog = re.sub(r'^\t', '| ', epilog, flags=re.M)
129
130 return description, options, epilog
131
132 module_names = ('client', 'run_install_test', 'run_test_cobbler',
133 'run_test_vm', 'run_utah_tests')
134 for module_name in module_names:
135 module = __import__(module_name)
136 parser = module.get_parser()
137 if module_name == 'client':
138 script_name = 'utah'
139 else:
140 script_name = '{}.py'.format(module_name)
141 description, options, epilog = get_parser_strings(script_name, parser)
142
143 for section_name in ('description', 'options', 'epilog'):
144 section = locals()[section_name]
145 filename = 'man/{}_{}.txt'.format(module_name, section_name)
146 with open(filename, 'w') as f:
147 f.write(section)
148
149# -- General configuration -----------------------------------------------------
150>>>>>>> MERGE-SOURCE
68151
69# If your documentation needs a minimal Sphinx version, state it here.152# If your documentation needs a minimal Sphinx version, state it here.
70#needs_sphinx = '1.0'153#needs_sphinx = '1.0'
71154
155<<<<<<< TREE
72# Add any Sphinx extension module names here, as strings. They can be156# Add any Sphinx extension module names here, as strings. They can be
73# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.157# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
74extensions = ['sphinx.ext.autodoc']158extensions = ['sphinx.ext.autodoc']
159=======
160# Add any Sphinx extension module names here, as strings. They can be extensions
161# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
162extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
163>>>>>>> MERGE-SOURCE
75164
76# Add any paths that contain templates here, relative to this directory.165# Add any paths that contain templates here, relative to this directory.
77templates_path = ['_templates']166templates_path = ['_templates']
@@ -261,8 +350,17 @@
261# One entry per manual page. List of tuples350# One entry per manual page. List of tuples
262# (source start file, name, description, authors, manual section).351# (source start file, name, description, authors, manual section).
263man_pages = [352man_pages = [
264 ('index', 'utah', u'UTAH Documentation',353 ('man/utah', 'utah', u'UTAH client test runner',
265 [u'Canonical Ltd'], 1)354 [u'Canonical Ltd'], 1),
355 ('man/run_install_test.py', 'run_install_test.py',
356 u'UTAH server test runner (provisioning)', [u'Canonical Ltd'], 1),
357 ('man/run_test_cobbler.py', 'run_test_cobbler.py',
358 u'UTAH server test runner (physical hardware)', [u'Canonical Ltd'], 1),
359 ('man/run_test_vm.py', 'run_test_vm.py',
360 u'UTAH server test runner (virtual hardware)',
361 [u'Canonical Ltd'], 1),
362 ('man/run_utah_tests.py', 'run_utah_tests.py',
363 u'UTAH server test runner (any hardware)', [u'Canonical Ltd'], 1),
266]364]
267365
268# If true, show URL addresses after external links.366# If true, show URL addresses after external links.
269367
=== modified file 'docs/source/introduction.rst'
--- docs/source/introduction.rst 2012-08-20 14:54:00 +0000
+++ docs/source/introduction.rst 2012-09-14 11:09:20 +0000
@@ -124,7 +124,7 @@
124 Variant of architecture, i.e., armel, armhf124 Variant of architecture, i.e., armel, armhf
125 -n, --no-destroy Preserve machine after tests have run125 -n, --no-destroy Preserve machine after tests have run
126 -d, --debug Enable debug logging126 -d, --debug Enable debug logging
127 -j, --json Enable json logging (Default is YAML)127 -j, --json Enable json logging (default is YAML)
128128
129For example::129For example::
130130
131131
=== added directory 'docs/source/man'
=== added file 'docs/source/man/run_install_test.py.rst'
--- docs/source/man/run_install_test.py.rst 1970-01-01 00:00:00 +0000
+++ docs/source/man/run_install_test.py.rst 2012-09-14 11:09:20 +0000
@@ -0,0 +1,26 @@
1:orphan:
2
3run_install_test.py manual page
4===============================
5
6Synopsis
7--------
8**run_install_test.py** [options] [runlist ...]
9
10Description
11-----------
12.. include:: run_install_test_description.txt
13
14Options
15-------
16.. include:: run_install_test_options.txt
17
18Examples
19--------
20.. include:: run_install_test_epilog.txt
21
22See also
23--------
24:manpage:`run_test_cobbler.py(1)`
25:manpage:`run_test_vm.py(1)`
26:manpage:`run_utah_tests.py(1)`
027
=== added file 'docs/source/man/run_test_cobbler.py.rst'
--- docs/source/man/run_test_cobbler.py.rst 1970-01-01 00:00:00 +0000
+++ docs/source/man/run_test_cobbler.py.rst 2012-09-14 11:09:20 +0000
@@ -0,0 +1,26 @@
1:orphan:
2
3run_test_cobbler.py manual page
4===============================
5
6Synopsis
7--------
8**run_test_cobbler.py** [options] [runlist ...]
9
10Description
11-----------
12.. include:: run_test_cobbler_description.txt
13
14Options
15-------
16.. include:: run_test_cobbler_options.txt
17
18Examples
19--------
20.. include:: run_test_cobbler_epilog.txt
21
22See also
23--------
24:manpage:`run_install_test.py(1)`
25:manpage:`run_test_vm.py(1)`
26:manpage:`run_utah_tests.py(1)`
027
=== added file 'docs/source/man/run_test_vm.py.rst'
--- docs/source/man/run_test_vm.py.rst 1970-01-01 00:00:00 +0000
+++ docs/source/man/run_test_vm.py.rst 2012-09-14 11:09:20 +0000
@@ -0,0 +1,26 @@
1:orphan:
2
3run_test_vm.py manual page
4==========================
5
6Synopsis
7--------
8**run_test_vm.py** [options] [runlist ...]
9
10Description
11-----------
12.. include:: run_test_vm_description.txt
13
14Options
15-------
16.. include:: run_test_vm_options.txt
17
18Examples
19--------
20.. include:: run_test_vm_epilog.txt
21
22See also
23--------
24:manpage:`run_install_test.py(1)`
25:manpage:`run_test_cobbler.py(1)`
26:manpage:`run_utah_tests.py(1)`
027
=== added file 'docs/source/man/run_utah_tests.py.rst'
--- docs/source/man/run_utah_tests.py.rst 1970-01-01 00:00:00 +0000
+++ docs/source/man/run_utah_tests.py.rst 2012-09-14 11:09:20 +0000
@@ -0,0 +1,26 @@
1:orphan:
2
3run_utah_tests.py manual page
4==============================
5
6Synopsis
7--------
8**run_utah_tests.py** [options] [runlist ...]
9
10Description
11-----------
12.. include:: run_utah_tests_description.txt
13
14Options
15-------
16.. include:: run_utah_tests_options.txt
17
18Examples
19--------
20.. include:: run_utah_tests_epilog.txt
21
22See also
23--------
24:manpage:`run_install_test.py(1)`
25:manpage:`run_test_cobbler.py(1)`
26:manpage:`run_test_vm.py(1)`
027
=== added file 'docs/source/man/utah.rst'
--- docs/source/man/utah.rst 1970-01-01 00:00:00 +0000
+++ docs/source/man/utah.rst 2012-09-14 11:09:20 +0000
@@ -0,0 +1,16 @@
1:orphan:
2
3utah manual page
4================
5
6Synopsis
7--------
8**utah** [options]
9
10Description
11-----------
12.. include:: client_description.txt
13
14Options
15-------
16.. include:: client_options.txt
017
=== modified file 'examples/run_install_test.py'
--- examples/run_install_test.py 2012-08-20 20:56:16 +0000
+++ examples/run_install_test.py 2012-09-14 11:09:20 +0000
@@ -16,14 +16,17 @@
16 description=('Provision a machine '16 description=('Provision a machine '
17 'and run one or more UTAH runlists there.'),17 'and run one or more UTAH runlists there.'),
18 epilog=("For example:\n"18 epilog=("For example:\n"
19 "\t%(prog)s -s precise -t server -a i386 "19 "Provision a VM using a precise server image "
20 "/usr/share/utah/client/examples/master.run "20 "with i386 architecture and run the two given runlists\n"
21 "'http://people.canonical.com/~max/max_test.run'"),21 "\t%(prog)s -s precise -t server -a i386 \\\n"
22 "\t\t/usr/share/utah/client/examples/master.run \\\n"
23 "\t\t'http://people.canonical.com/~max/max_test.run'"),
22 formatter_class=argparse.RawDescriptionHelpFormatter)24 formatter_class=argparse.RawDescriptionHelpFormatter)
23 parser.add_argument('runlists', metavar='runlist', nargs='+',25 parser.add_argument('runlists', metavar='runlist', nargs='+',
24 type=url_argument, help='URLs of runlist files to run')26 type=url_argument, help='URLs of runlist files to run')
25 parser.add_argument('-m', '--machinetype', choices=('physical', 'virtual'),27 parser.add_argument('-m', '--machinetype', metavar='MACHINETYPE',
26 default='virtual', help='Type of machine to provision')28 choices=('physical', 'virtual'), default='virtual',
29 help='Type of machine to provision (%(choices)s)')
27 parser.add_argument('-e', '--emulator',30 parser.add_argument('-e', '--emulator',
28 help=('Emulator to use (kvm and qemu are supported, '31 help=('Emulator to use (kvm and qemu are supported, '
29 'kvm will be favored if available)'))32 'kvm will be favored if available)'))
@@ -42,15 +45,18 @@
42 parser.add_argument('-g', '--gigabytes', action='append',45 parser.add_argument('-g', '--gigabytes', action='append',
43 help=('Size in gigabytes of virtual disk, '46 help=('Size in gigabytes of virtual disk, '
44 'specify more than once for multiple disks'))47 'specify more than once for multiple disks'))
45 parser.add_argument('-s', '--series',48 parser.add_argument('-s', '--series', metavar='SERIES',
46 choices=('hardy', 'lucid', 'natty',49 choices=('hardy', 'lucid', 'natty',
47 'oneiric', 'precise', 'quantal'),50 'oneiric', 'precise', 'quantal'),
48 help='Series to use for installation')51 help='Series to use for installation (%(choices)s)')
49 parser.add_argument('-t', '--type',52 parser.add_argument('-t', '--type', metavar='TYPE',
50 choices=('desktop', 'server', 'mini', 'alternate'),53 choices=('desktop', 'server', 'mini', 'alternate'),
51 help='Install type to use for installation')54 help=('Install type to use for installation '
52 parser.add_argument('-a', '--arch', choices=('i386', 'amd64', 'arm'),55 '(%(choices)s)'))
53 help='Architecture to use for installation')56 parser.add_argument('-a', '--arch', metavar='ARCH',
57 choices=('i386', 'amd64', 'arm'),
58 help=('Architecture to use for installation '
59 '(%(choices)s)'))
54 parser.add_argument('-v', '--variant',60 parser.add_argument('-v', '--variant',
55 help='Variant of architecture, i.e., armel, armhf')61 help='Variant of architecture, i.e., armel, armhf')
56 parser.add_argument('-n', '--no-destroy', action='store_true',62 parser.add_argument('-n', '--no-destroy', action='store_true',
@@ -58,9 +64,11 @@
58 parser.add_argument('-d', '--debug', action='store_true',64 parser.add_argument('-d', '--debug', action='store_true',
59 help='Enable debug logging')65 help='Enable debug logging')
60 parser.add_argument('-j', '--json', action='store_true',66 parser.add_argument('-j', '--json', action='store_true',
61 help='Enable json logging (Default is YAML)')67 help='Enable json logging (default is YAML)')
62 parser.add_argument('--diskbus', choices=('virtio', 'sata', 'ide'),68 parser.add_argument('--diskbus', metavar='DISKBUS',
63 help='Disk bus to use for customvm installation')69 choices=('virtio', 'sata', 'ide'),
70 help=('Disk bus to use for customvm installation '
71 '(%(choices)s)'))
64 return parser72 return parser
6573
6674
6775
=== modified file 'examples/run_test_cobbler.py'
--- examples/run_test_cobbler.py 2012-08-30 08:34:34 +0000
+++ examples/run_test_cobbler.py 2012-09-14 11:09:20 +0000
@@ -15,9 +15,11 @@
15 description=('Provision a machine using cobbler '15 description=('Provision a machine using cobbler '
16 'and run one or more UTAH runlists there.'),16 'and run one or more UTAH runlists there.'),
17 epilog=("For example:\n"17 epilog=("For example:\n"
18 "\t%(prog)s -s precise -t server -a i386 "18 "Provision a machine using a precise server image "
19 "/usr/share/utah/client/examples/master.run "19 "with i386 architecture and run the two given runlists\n"
20 "'http://people.canonical.com/~max/max_test.run'"),20 "\t%(prog)s -s precise -t server -a i386 \\\n"
21 "\t\t/usr/share/utah/client/examples/master.run \\\n"
22 "\t\t'http://people.canonical.com/~max/max_test.run'"),
21 formatter_class=argparse.RawDescriptionHelpFormatter)23 formatter_class=argparse.RawDescriptionHelpFormatter)
22 parser.add_argument('runlists', metavar='runlist', nargs='+',24 parser.add_argument('runlists', metavar='runlist', nargs='+',
23 help='URLs of runlist files to run')25 help='URLs of runlist files to run')
@@ -26,19 +28,22 @@
26 help='Image/ISO file to use for installation')28 help='Image/ISO file to use for installation')
27 parser.add_argument('-p', '--preseed', type=url_argument,29 parser.add_argument('-p', '--preseed', type=url_argument,
28 help='Preseed file to use for installation')30 help='Preseed file to use for installation')
29 parser.add_argument('-s', '--series',31 parser.add_argument('-s', '--series', metavar='SERIES',
30 choices=('hardy', 'lucid', 'natty',32 choices=('hardy', 'lucid', 'natty',
31 'oneiric', 'precise', 'quantal'),33 'oneiric', 'precise', 'quantal'),
32 help='Series to use for VM creation')34 help='Series to use for VM creation (%(choices)s)')
33 parser.add_argument('-t', '--type',35 parser.add_argument('-t', '--type', metavar='TYPE',
34 choices=('desktop', 'server', 'mini', 'alternate'),36 choices=('desktop', 'server', 'mini', 'alternate'),
35 help='Install type to use for VM creation')37 help=('Install type to use for VM creation '
36 parser.add_argument('-a', '--arch', choices=('i386', 'amd64'),38 '(%(choices)s)'))
37 help='Architecture to use for VM creation')39 parser.add_argument('-a', '--arch', metavar='ARCH',
40 choices=('i386', 'amd64'),
41 help=('Architecture to use for VM creation '
42 '(%(choices)s)'))
38 parser.add_argument('-d', '--debug', action='store_true',43 parser.add_argument('-d', '--debug', action='store_true',
39 help='Enable debug logging')44 help='Enable debug logging')
40 parser.add_argument('-j', '--json', action='store_true',45 parser.add_argument('-j', '--json', action='store_true',
41 help='Enable json logging (Default is YAML)')46 help='Enable json logging (default is YAML)')
42 return parser47 return parser
4348
4449
4550
=== modified file 'examples/run_test_vm.py'
--- examples/run_test_vm.py 2012-08-20 21:00:06 +0000
+++ examples/run_test_vm.py 2012-09-14 11:09:20 +0000
@@ -14,27 +14,32 @@
14 description=('Create a virtual machine '14 description=('Create a virtual machine '
15 'and run a UTAH runlist there.'),15 'and run a UTAH runlist there.'),
16 epilog=("For example:\n"16 epilog=("For example:\n"
17 "\t%(prog)s -s precise -t server -a i386 "17 "Provision a VM using a precise server image "
18 "/usr/share/utah/client/examples/master.run "18 "with i386 architecture and run the two given runlists\n"
19 "'http://people.canonical.com/~max/max_test.run'"),19 "\t%(prog)s -s precise -t server -a i386 \\\n"
20 "\t\t/usr/share/utah/client/examples/master.run \\\n"
21 "\t\t'http://people.canonical.com/~max/max_test.run'"),
20 formatter_class=argparse.RawDescriptionHelpFormatter)22 formatter_class=argparse.RawDescriptionHelpFormatter)
21 parser.add_argument('runlists', metavar='runlist', nargs='+',23 parser.add_argument('runlists', metavar='runlist', nargs='+',
22 help='URLs of runlist files to run')24 help='URLs of runlist files to run')
23 parser.add_argument('-s', '--series',25 parser.add_argument('-s', '--series', metavar='SERIES',
24 choices=('hardy', 'lucid', 'natty',26 choices=('hardy', 'lucid', 'natty',
25 'oneiric', 'precise', 'quantal'),27 'oneiric', 'precise', 'quantal'),
26 help='Series to use for VM creation')28 help='Series to use for VM creation (%(choices)s)')
27 parser.add_argument('-t', '--type',29 parser.add_argument('-t', '--type', metavar='TYPE',
28 choices=('desktop', 'server', 'mini', 'alternate'),30 choices=('desktop', 'server', 'mini', 'alternate'),
29 help='Install type to use for VM creation')31 help=('Install type to use for VM creation '
30 parser.add_argument('-a', '--arch', choices=('i386', 'amd64'),32 '(%(choices)s)'))
31 help='Architecture to use for VM creation')33 parser.add_argument('-a', '--arch', metavar='ARCH',
34 choices=('i386', 'amd64'),
35 help=('Architecture to use for VM creation '
36 '(%(choices)s)'))
32 parser.add_argument('-n', '--no-destroy', action='store_true',37 parser.add_argument('-n', '--no-destroy', action='store_true',
33 help='Preserve VM after tests have run')38 help='Preserve VM after tests have run')
34 parser.add_argument('-d', '--debug', action='store_true',39 parser.add_argument('-d', '--debug', action='store_true',
35 help='Enable debug logging')40 help='Enable debug logging')
36 parser.add_argument('-j', '--json', action='store_true',41 parser.add_argument('-j', '--json', action='store_true',
37 help='Enable json logging (Default is YAML)')42 help='Enable json logging (default is YAML)')
38 return parser43 return parser
3944
4045
4146
=== modified file 'examples/run_utah_tests.py'
--- examples/run_utah_tests.py 2012-08-30 08:35:45 +0000
+++ examples/run_utah_tests.py 2012-09-14 11:09:20 +0000
@@ -13,16 +13,21 @@
13def get_parser():13def get_parser():
14 parser = argparse.ArgumentParser(14 parser = argparse.ArgumentParser(
15 description=('Provision a machine '15 description=('Provision a machine '
16 'and run one or more UTAH runlists there.'),16 'and run one or more UTAH runlists there.\n\n'
17 'The appropriate run_*.py script will be called, '
18 'depending on the parameters passed.'),
17 epilog=("For example:\n"19 epilog=("For example:\n"
18 "\t%(prog)s -s precise -t server -a i386 "20 "Provision a VM using a precise server image "
19 "/usr/share/utah/client/examples/master.run "21 "with i386 architecture and run the two given runlists\n"
20 "'http://people.canonical.com/~max/max_test.run'"),22 "\t%(prog)s -s precise -t server -a i386 \\\n"
23 "\t\t/usr/share/utah/client/examples/master.run \\\n"
24 "\t\t'http://people.canonical.com/~max/max_test.run'"),
21 formatter_class=argparse.RawDescriptionHelpFormatter)25 formatter_class=argparse.RawDescriptionHelpFormatter)
22 parser.add_argument('runlists', metavar='runlist', nargs='+',26 parser.add_argument('runlists', metavar='runlist', nargs='+',
23 type=url_argument, help='URLs of runlist files to run')27 type=url_argument, help='URLs of runlist files to run')
24 parser.add_argument('-m', '--machinetype', choices=('physical', 'virtual'),28 parser.add_argument('-m', '--machinetype', metavar='MACHINETYPE',
25 default='virtual', help='Type of machine to provision')29 choices=('physical', 'virtual'), default='virtual',
30 help='Type of machine to provision (%(choices)s)')
26 parser.add_argument('-e', '--emulator',31 parser.add_argument('-e', '--emulator',
27 help=('Emulator to use (kvm and qemu are supported, '32 help=('Emulator to use (kvm and qemu are supported, '
28 'kvm will be favored if available)'))33 'kvm will be favored if available)'))
@@ -41,15 +46,18 @@
41 parser.add_argument('-g', '--gigabytes', action='append',46 parser.add_argument('-g', '--gigabytes', action='append',
42 help=('Size in gigabytes of virtual disk, '47 help=('Size in gigabytes of virtual disk, '
43 'specify more than once for multiple disks'))48 'specify more than once for multiple disks'))
44 parser.add_argument('-s', '--series',49 parser.add_argument('-s', '--series', metavar='SERIES',
45 choices=('hardy', 'lucid', 'natty',50 choices=('hardy', 'lucid', 'natty',
46 'oneiric', 'precise', 'quantal'),51 'oneiric', 'precise', 'quantal'),
47 help='Series to use for installation')52 help='Series to use for installation (%(choices)s)')
48 parser.add_argument('-t', '--type',53 parser.add_argument('-t', '--type', metavar='TYPE',
49 choices=('desktop', 'server', 'mini', 'alternate'),54 choices=('desktop', 'server', 'mini', 'alternate'),
50 help='Install type to use for installation')55 help=('Install type to use for installation '
51 parser.add_argument('-a', '--arch', choices=('i386', 'amd64', 'arm'),56 '(%(choices)s)'))
52 help='Architecture to use for installation')57 parser.add_argument('-a', '--arch', metavar='ARCH',
58 choices=('i386', 'amd64', 'arm'),
59 help=('Architecture to use for installation '
60 '(%(choices)s)'))
53 parser.add_argument('-v', '--variant',61 parser.add_argument('-v', '--variant',
54 help='Variant of architecture, i.e., armel, armhf')62 help='Variant of architecture, i.e., armel, armhf')
55 parser.add_argument('-n', '--no-destroy', action='store_true',63 parser.add_argument('-n', '--no-destroy', action='store_true',
@@ -57,9 +65,11 @@
57 parser.add_argument('-d', '--debug', action='store_true',65 parser.add_argument('-d', '--debug', action='store_true',
58 help='Enable debug logging')66 help='Enable debug logging')
59 parser.add_argument('-j', '--json', action='store_true',67 parser.add_argument('-j', '--json', action='store_true',
60 help='Enable json logging (Default is YAML)')68 help='Enable json logging (default is YAML)')
61 parser.add_argument('--diskbus', choices=('virtio', 'sata', 'ide'),69 parser.add_argument('--diskbus', metavar='DISKBUS',
62 help='Disk bus to use for customvm installation')70 choices=('virtio', 'sata', 'ide'),
71 help=('Disk bus to use for customvm installation '
72 '(%(choices)s)'))
63 parser.add_argument('--name', help='Name of machine to provision'73 parser.add_argument('--name', help='Name of machine to provision'
64 + ' (currently only supported for physical machine'74 + ' (currently only supported for physical machine'
65 + ' provisioning)')75 + ' provisioning)')
6676
=== modified file 'utah_howto.txt'
--- utah_howto.txt 2012-08-02 14:18:50 +0000
+++ utah_howto.txt 2012-09-14 11:09:20 +0000
@@ -60,7 +60,7 @@
60usage: utah [-h] [--resume] [-s STATE_FILE] [-f {text,yaml}] [-t TESTDIR]60usage: utah [-h] [--resume] [-s STATE_FILE] [-f {text,yaml}] [-t TESTDIR]
61 [-r RUNLIST] [-o OUTPUT] [-a] [-d]61 [-r RUNLIST] [-o OUTPUT] [-a] [-d]
6262
63Ubuntu Automation Testing Harness63Ubuntu Testing Automation Harness
6464
65optional arguments:65optional arguments:
66 -h, --help show this help message and exit66 -h, --help show this help message and exit

Subscribers

People subscribed via source and target branches

to all changes: