mbligh | fa15d4e | 2010-03-24 21:50:59 +0000 | [diff] [blame^] | 1 | from autotest_lib.client.bin import test, utils |
| 2 | from autotest_lib.client.common_lib import error |
| 3 | import re |
| 4 | |
| 5 | class hwclock(test.test): |
| 6 | version = 1 |
| 7 | |
| 8 | def run_once(self, seconds=1): |
| 9 | utils.system('/sbin/hwclock --set --date "2/2/80 03:04:00"') |
| 10 | date = utils.system_output('/sbin/hwclock') |
| 11 | if not re.match('Sat *Feb *2 *03:04:.. 1980', date): |
| 12 | raise error.TestFail('Failed to set hwclock back to the eighties') |
| 13 | |
| 14 | |
| 15 | def cleanup(self): |
| 16 | utils.system('/sbin/hwclock --systohc --noadjfile --utc') |