Merge lp:~joetalbott/utah/install_type into lp:utah

Proposed by Joe Talbott
Status: Merged
Approved by: Javier Collado
Approved revision: 665
Merged at revision: 668
Proposed branch: lp:~joetalbott/utah/install_type
Merge into: lp:utah
Diff against target: 175 lines (+24/-9)
6 files modified
client.py (+8/-2)
utah/client/result.py (+3/-1)
utah/client/runner.py (+3/-1)
utah/client/tests/test_runner.py (+5/-3)
utah/client/tests/test_state_agent.py (+2/-2)
utah/run.py (+3/-0)
To merge this branch: bzr merge lp:~joetalbott/utah/install_type
Reviewer Review Type Date Requested Status
Javier Collado (community) Approve
Max Brustkern (community) Approve
Joe Talbott Pending
Review via email: mp+121934@code.launchpad.net

This proposal supersedes a proposal from 2012-08-29.

Description of the change

This adds a --install-type option to the client to indicate the OS variant (i.e. desktop, server, mini, etc.)

Updated to use the machine's idea of installtype.

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

Args may not include a type, but we'll still get a type when we install the machine. I'd recommend we setup the extraopts after machine.installclient() and use machine.installtype. Is there some way for me to attach a branch or a diff that reflects that?

Revision history for this message
Joe Talbott (joetalbott) wrote : Posted in a previous version of this proposal

I've updated my submission to match what I think Max was referring to.

review: Needs Resubmitting
Revision history for this message
Max Brustkern (nuclearbob) wrote :

Looks good to me.

review: Approve
Revision history for this message
Javier Collado (javier.collado) wrote :

Looks good to me too. With regard to the server, as long as `utah.iso.getinstalltype` does a good job, then the client should get the right type.

In addition to this, I ran a test with a quantal desktop iso and I saw the expected output with the right type in the console log:
INFO: Running command through SSH: utah --install-type desktop -r /tmp/default.run

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'client.py'
--- client.py 2012-08-28 11:22:41 +0000
+++ client.py 2012-08-29 19:35:34 +0000
@@ -33,6 +33,10 @@
33 default='yaml', help='Output format (default "yaml")')33 default='yaml', help='Output format (default "yaml")')
34 parser.add_argument('-t', '--testdir',34 parser.add_argument('-t', '--testdir',
35 default='/var/lib/utah', help='Main test directory')35 default='/var/lib/utah', help='Main test directory')
36 parser.add_argument('-i', '--install-type',
37 choices=['desktop', 'server', 'mini', 'alternate'],
38 default='desktop',
39 help='Installation Variant (i.e. server, desktop, etc.)')
36 parser.add_argument('-r', '--runlist', type=url_argument,40 parser.add_argument('-r', '--runlist', type=url_argument,
37 # Having a default here means that if a resume happens41 # Having a default here means that if a resume happens
38 # post-reboot without a runlist specified, it will42 # post-reboot without a runlist specified, it will
@@ -97,6 +101,7 @@
97 testdir = args.testdir101 testdir = args.testdir
98 runlist = args.runlist102 runlist = args.runlist
99 output = args.output103 output = args.output
104 install_type = args.install_type
100105
101 if args.append:106 if args.append:
102 open_flags = 'a'107 open_flags = 'a'
@@ -119,8 +124,9 @@
119124
120 try:125 try:
121 state_agent = StateAgentYAML(state_file=state_file)126 state_agent = StateAgentYAML(state_file=state_file)
122 runner = Runner(state_agent=state_agent, result_class=result_class,127 runner = Runner(install_type=install_type, state_agent=state_agent,
123 runlist=runlist, resume=resume, testdir=testdir)128 result_class=result_class, runlist=runlist,
129 resume=resume, testdir=testdir)
124 if resume:130 if resume:
125 runner.load_state()131 runner.load_state()
126132
127133
=== modified file 'utah/client/result.py'
--- utah/client/result.py 2012-08-28 04:08:53 +0000
+++ utah/client/result.py 2012-08-29 19:35:34 +0000
@@ -40,7 +40,7 @@
40 Result collection class.40 Result collection class.
41 """41 """
42 def __init__(self, name=None, testsuite=None, testcase=None,42 def __init__(self, name=None, testsuite=None, testcase=None,
43 runlist=None, publish_type=None):43 runlist=None, publish_type=None, install_type=None):
44 self.results = []44 self.results = []
45 self.status = 'PASS'45 self.status = 'PASS'
46 self.name = name46 self.name = name
@@ -49,6 +49,7 @@
49 self.runlist = runlist49 self.runlist = runlist
50 self.publish_type = publish_type50 self.publish_type = publish_type
51 self.publish = None51 self.publish = None
52 self.install_type = install_type
5253
53 self.errors = 054 self.errors = 0
54 self.fetch_errors = 055 self.fetch_errors = 0
@@ -166,6 +167,7 @@
166 'passes': self.passes,167 'passes': self.passes,
167 'uname': list(host_info['uname']),168 'uname': list(host_info['uname']),
168 'media-info': host_info['media-info'],169 'media-info': host_info['media-info'],
170 'install_type': self.install_type,
169 }171 }
170172
171 if self.publish is not None:173 if self.publish is not None:
172174
=== modified file 'utah/client/runner.py'
--- utah/client/runner.py 2012-08-28 11:22:41 +0000
+++ utah/client/runner.py 2012-08-29 19:35:34 +0000
@@ -110,7 +110,7 @@
110 'required': True,110 'required': True,
111 }111 }
112112
113 def __init__(self, runlist=None, result_class=Result,113 def __init__(self, install_type, runlist=None, result_class=Result,
114 testdir=UTAH_DIR, state_agent=None, resume=False):114 testdir=UTAH_DIR, state_agent=None, resume=False):
115115
116 # Runlist URL passed through the command line116 # Runlist URL passed through the command line
@@ -138,6 +138,7 @@
138 self.state_file = DEFAULT_STATE_FILE138 self.state_file = DEFAULT_STATE_FILE
139 self.fetched_suites = {}139 self.fetched_suites = {}
140 self.timeout = None140 self.timeout = None
141 self.install_type = install_type
141142
142 self.errors = 0143 self.errors = 0
143 self.passes = 0144 self.passes = 0
@@ -164,6 +165,7 @@
164165
165 self.process_master_runlist(resume=resume)166 self.process_master_runlist(resume=resume)
166 self.result.runlist = self.master_runlist167 self.result.runlist = self.master_runlist
168 self.result.install_type = self.install_type
167169
168 def backup_rc_local(self):170 def backup_rc_local(self):
169 """171 """
170172
=== modified file 'utah/client/tests/test_runner.py'
--- utah/client/tests/test_runner.py 2012-08-08 16:17:12 +0000
+++ utah/client/tests/test_runner.py 2012-08-29 19:35:34 +0000
@@ -20,7 +20,7 @@
20 self.result_class = ResultYAML20 self.result_class = ResultYAML
21 self.state_file = '/tmp/state.yaml'21 self.state_file = '/tmp/state.yaml'
22 self.state_agent = StateAgentYAML(state_file=self.state_file)22 self.state_agent = StateAgentYAML(state_file=self.state_file)
23 self.runner = Runner(result_class=self.result_class,23 self.runner = Runner(install_type='desktop', result_class=self.result_class,
24 state_agent=self.state_agent)24 state_agent=self.state_agent)
25 self.bad_dir = "/tmp/does_not_exist"25 self.bad_dir = "/tmp/does_not_exist"
2626
@@ -53,7 +53,7 @@
53 fp.write(bad_runlist_content)53 fp.write(bad_runlist_content)
54 fp.close()54 fp.close()
5555
56 runner = Runner(result_class=self.result_class,56 runner = Runner(install_type='desktop', result_class=self.result_class,
57 state_agent=self.state_agent, runlist=runlist)57 state_agent=self.state_agent, runlist=runlist)
5858
59 # remove the runlist as early as possible to avoid leaving it59 # remove the runlist as early as possible to avoid leaving it
@@ -88,6 +88,7 @@
88 """88 """
89 self.assertRaises(exceptions.BadDir,89 self.assertRaises(exceptions.BadDir,
90 Runner,90 Runner,
91 install_type="desktop",
91 result_class=self.result_class,92 result_class=self.result_class,
92 testdir=self.bad_dir)93 testdir=self.bad_dir)
9394
@@ -107,6 +108,7 @@
107108
108 self.assertRaises(exceptions.MissingFile,109 self.assertRaises(exceptions.MissingFile,
109 Runner,110 Runner,
111 install_type="desktop",
110 result_class=self.result_class,112 result_class=self.result_class,
111 runlist=tmp_master_runlist,113 runlist=tmp_master_runlist,
112 testdir=self.bad_dir)114 testdir=self.bad_dir)
@@ -121,7 +123,7 @@
121 fp.write(master_runlist_content)123 fp.write(master_runlist_content)
122 fp.close()124 fp.close()
123125
124 runner = Runner(result_class=self.result_class, runlist=runlist)126 runner = Runner(install_type='desktop', result_class=self.result_class, runlist=runlist)
125 runner.save_state()127 runner.save_state()
126128
127 print("tests: {}".format(runner.count_tests()))129 print("tests: {}".format(runner.count_tests()))
128130
=== modified file 'utah/client/tests/test_state_agent.py'
--- utah/client/tests/test_state_agent.py 2012-08-08 16:17:12 +0000
+++ utah/client/tests/test_state_agent.py 2012-08-29 19:35:34 +0000
@@ -80,7 +80,7 @@
80 "state file (%s) already exists" % self.state_file)80 "state file (%s) already exists" % self.state_file)
8181
82 self.state_agent = StateAgentYAML(state_file=self.state_file)82 self.state_agent = StateAgentYAML(state_file=self.state_file)
83 self.runner = Runner(result_class=ResultYAML,83 self.runner = Runner(install_type="desktop", result_class=ResultYAML,
84 state_agent=self.state_agent)84 state_agent=self.state_agent)
85 self.partial_state_file_content = partial_state_file_content85 self.partial_state_file_content = partial_state_file_content
8686
@@ -158,7 +158,7 @@
158 shutil.copytree(test_src, test_dir)158 shutil.copytree(test_src, test_dir)
159159
160 state_agent = StateAgentYAML(state_file=self.state_file)160 state_agent = StateAgentYAML(state_file=self.state_file)
161 runner = Runner(state_agent=state_agent, resume=True)161 runner = Runner(install_type="desktop", state_agent=state_agent, resume=True)
162 runner.load_state()162 runner.load_state()
163163
164 self.assertEqual(runner.status, 'RUN')164 self.assertEqual(runner.status, 'RUN')
165165
=== modified file 'utah/run.py'
--- utah/run.py 2012-08-28 15:35:55 +0000
+++ utah/run.py 2012-08-29 19:35:34 +0000
@@ -30,6 +30,9 @@
30 exitstatus = 030 exitstatus = 0
3131
32 machine.installclient()32 machine.installclient()
33
34 extraopts += " --install-type " + machine.installtype
35
33 for runlist in args.runlists:36 for runlist in args.runlists:
34 locallist = urllib.urlretrieve(runlist)[0]37 locallist = urllib.urlretrieve(runlist)[0]
35 machine.uploadfiles([locallist], os.path.normpath('/tmp'))38 machine.uploadfiles([locallist], os.path.normpath('/tmp'))

Subscribers

People subscribed via source and target branches