1import os 2from autotest_lib.client.bin import test, utils 3from autotest_lib.client.common_lib import error 4 5class rtc(test.test): 6 version = 1 7 preserve_srcdir = True 8 9 def setup(self): 10 os.chdir(self.srcdir) 11 utils.make('clobber') 12 utils.make() 13 14 15 def initialize(self): 16 self.job.require_gcc() 17 18 19 def run_once(self, def_rtc="/dev/rtc0", maxfreq=64): 20 if not os.path.exists(def_rtc): 21 raise error.TestNAError("RTC device %s does not exist" % def_rtc) 22 os.chdir(self.srcdir) 23 utils.system('./rtctest %s %s' % (def_rtc, maxfreq)) 24