Skip to content

Commit

Permalink
server.autotest_remote_unittest: Fix unittest broken with 2648c15
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
  • Loading branch information
lmr committed Jun 27, 2012
1 parent e9e62d5 commit fa47aba
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions server/autotest_remote_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ def test_full_client_install(self):
self.host.send_file.expect_call('source_material', 'autodir',
delete_dest=True)

tmpdir = 'autodir/tmp'
c.get_config_value.expect_call('COMMON',
'test_output_dir',
default=tmpdir).and_return(tmpdir)
self.host.run.expect_call('mkdir -p %s' % tmpdir)

# run and check
self.base_autotest.install_full_client()
self.god.check_playback()
Expand All @@ -141,6 +147,11 @@ def test_autoserv_install(self):
type=bool).and_return(True)
self.base_autotest._install_using_send_file.expect_call(self.host,
'autodir')
tmpdir = 'autodir/tmp'
c.get_config_value.expect_call('COMMON',
'test_output_dir',
default=tmpdir).and_return(tmpdir)
self.host.run.expect_call('mkdir -p %s' % tmpdir)
# run and check
self.base_autotest.install()
self.god.check_playback()
Expand All @@ -161,6 +172,17 @@ def test_packaging_install(self):
self.host.run.expect_call(cmd)
pkgmgr.install_pkg.expect_call('autotest', 'client', pkg_dir,
'autodir', preserve_install_dir=True)
tmpdir = 'autodir/tmp'
c.get_config_value.expect_call('COMMON',
'test_output_dir',
default=tmpdir).and_return(tmpdir)
self.host.run.expect_call('mkdir -p %s' % tmpdir)
c.get_config_value.expect_call('COMMON',
'test_output_dir',
default=tmpdir).and_return(tmpdir)
self.host.run.expect_call('mkdir -p %s' % tmpdir)



# run and check
self.base_autotest.install()
Expand All @@ -185,8 +207,15 @@ def test_run(self):
tag = None
run_obj.manual_control_file = os.path.join('autodir',
'control.%s' % tag)
run_obj.manual_control_state = os.path.join('autodir',
'control.%s.state' % tag)
run_obj.remote_control_file = os.path.join('autodir',
'control.%s.autoserv' % tag)
run_obj.remote_control_state = os.path.join('autodir',
'control.%s.autoserv.state' % tag)
run_obj.remote_control_init_state = os.path.join('autodir',
'control.%s.autoserv.init.state' % tag)

run_obj.tag = tag
run_obj.autodir = 'autodir'
run_obj.verify_machine.expect_call()
Expand All @@ -195,9 +224,9 @@ def test_run(self):
debug = os.path.join('.', 'debug')
os.makedirs.expect_call(debug)
delete_file_list = [run_obj.remote_control_file,
run_obj.remote_control_file + '.state',
run_obj.remote_control_state,
run_obj.manual_control_file,
run_obj.manual_control_file + '.state']
run_obj.manual_control_state]
cmd = ';'.join('rm -f ' + control for control in delete_file_list)
self.host.run.expect_call(cmd, ignore_status=True)

Expand Down

0 comments on commit fa47aba

Please sign in to comment.