add hwclock test

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@4333 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/hwclock/hwclock.py b/client/tests/hwclock/hwclock.py
new file mode 100644
index 0000000..12f8c54
--- /dev/null
+++ b/client/tests/hwclock/hwclock.py
@@ -0,0 +1,16 @@
+from autotest_lib.client.bin import test, utils
+from autotest_lib.client.common_lib import error
+import re
+
+class hwclock(test.test):
+    version = 1
+
+    def run_once(self, seconds=1):
+        utils.system('/sbin/hwclock --set --date "2/2/80 03:04:00"')
+        date = utils.system_output('/sbin/hwclock')
+        if not re.match('Sat *Feb *2 *03:04:.. 1980', date):
+            raise error.TestFail('Failed to set hwclock back to the eighties')
+
+
+    def cleanup(self):
+        utils.system('/sbin/hwclock --systohc --noadjfile --utc')