Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: server/autotest_unittest.py

Issue 5867003: Remount autodir after reboot. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« server/autotest.py ('K') | « server/autotest.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 __author__ = "raphtee@google.com (Travis Miller)" 3 __author__ = "raphtee@google.com (Travis Miller)"
4 4
5 import unittest, os, tempfile, logging 5 import unittest, os, tempfile, logging
6 6
7 import common 7 import common
8 from autotest_lib.server import autotest, utils, hosts, server_job, profilers 8 from autotest_lib.server import autotest, utils, hosts, server_job, profilers
9 from autotest_lib.client.bin import sysinfo 9 from autotest_lib.client.bin import sysinfo
10 from autotest_lib.client.common_lib import utils as client_utils, packages 10 from autotest_lib.client.common_lib import utils as client_utils, packages
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 os.getcwd.expect_call().and_return('cwd') 94 os.getcwd.expect_call().and_return('cwd')
95 os.chdir.expect_call(os.path.join(self.serverdir, '../client')) 95 os.chdir.expect_call(os.path.join(self.serverdir, '../client'))
96 utils.system.expect_call('tools/make_clean', ignore_status=True) 96 utils.system.expect_call('tools/make_clean', ignore_status=True)
97 os.chdir.expect_call('cwd') 97 os.chdir.expect_call('cwd')
98 utils.get.expect_call(os.path.join(self.serverdir, 98 utils.get.expect_call(os.path.join(self.serverdir,
99 '../client')).and_return('source_material') 99 '../client')).and_return('source_material')
100 100
101 self.host.wait_up.expect_call(timeout=30) 101 self.host.wait_up.expect_call(timeout=30)
102 self.host.setup.expect_call() 102 self.host.setup.expect_call()
103 self.host.get_autodir.expect_call().and_return("autodir") 103 self.host.get_autodir.expect_call().and_return("autodir")
104 result = client_utils.CmdResult()
105 result.exit_status = 0
106 self.host.run.expect_call('mount | grep -q autodir',
107 ignore_status=True).and_return(result)
104 self.host.set_autodir.expect_call("autodir") 108 self.host.set_autodir.expect_call("autodir")
105 self.host.run.expect_call('mkdir -p autodir') 109 self.host.run.expect_call('mkdir -p autodir')
106 self.host.run.expect_call('rm -rf autodir/results/*', 110 self.host.run.expect_call('rm -rf autodir/results/*',
107 ignore_status=True) 111 ignore_status=True)
108 112
109 113
110 def test_constructor(self): 114 def test_constructor(self):
111 self.construct() 115 self.construct()
112 116
113 # we should check the calls 117 # we should check the calls
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 368
365 369
366 def test_fails_with_exception(self): 370 def test_fails_with_exception(self):
367 self.assertEqual(False, self.mixin.run_test('sleeptest')) 371 self.assertEqual(False, self.mixin.run_test('sleeptest'))
368 self.assert_("job.run_test('sleeptest')\n" in self.control_file) 372 self.assert_("job.run_test('sleeptest')\n" in self.control_file)
369 self.assertEqual(self.mixin, self.host) 373 self.assertEqual(self.mixin, self.host)
370 374
371 375
372 if __name__ == "__main__": 376 if __name__ == "__main__":
373 unittest.main() 377 unittest.main()
OLDNEW
« server/autotest.py ('K') | « server/autotest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698