OLD | NEW |
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 Loading... |
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 Loading... |
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() |
OLD | NEW |