def __init__(self, config, hw_info, logger): TestMethods.__init__(self, 'Serial ports', config, hw_info, logger) self._rs232test = None self._rs485test_a = None self._rs485test_b = None model = self._hw_info.model() if model in ('1500', '2500'): self._rs232test = _RS232Tester(config, hw_info, logger, '/dev/ttyS8', '/dev/ttyS9') if model in ('1200', '2400'): ### # Don't get confused by this. On ZF's we have either the RS232 # ports *OR* the extra RS485 ports, but not both. It seems that # we mostly use the RS485 (have a peek in /etc/rc.mpx), so we # test those... *STM* os.system('/bin/rs485init >/dev/null') self._rs485test_a = _RS485Tester(config, hw_info, logger, '/dev/ttyS4', '/dev/ttyS5') else: self._rs485test_a = _RS485Tester(config, hw_info, logger, '/dev/ttySa', '/dev/ttySb') if model in ('2400', '2500'): if model in ('2400', ): self._rs485test_b = _RS485Tester(config, hw_info, logger, '/dev/ttyS6', '/dev/ttyS7') else: self._rs485test_b = _RS485Tester(config, hw_info, logger, '/dev/ttySc', '/dev/ttySd') return
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, 'Serial ports', config, hw_info, logger) self._rs232test = None self._rs485test_a = None self._rs485test_b = None model = self._hw_info.model() if model in ('1500', '2500'): self._rs232test = _RS232Tester(config, hw_info, logger, '/dev/ttyS8', '/dev/ttyS9') if model in ('1200', '2400'): ### # Don't get confused by this. On ZF's we have either the RS232 # ports *OR* the extra RS485 ports, but not both. It seems that # we mostly use the RS485 (have a peek in /etc/rc.mpx), so we # test those... *STM* os.system('/bin/rs485init >/dev/null') self._rs485test_a = _RS485Tester(config, hw_info, logger, '/dev/ttyS4', '/dev/ttyS5') else: self._rs485test_a = _RS485Tester(config, hw_info, logger, '/dev/ttySa', '/dev/ttySb') if model in ('2400', '2500'): if model in ('2400',): self._rs485test_b = _RS485Tester(config, hw_info, logger, '/dev/ttyS6', '/dev/ttyS7') else: self._rs485test_b = _RS485Tester(config, hw_info, logger, '/dev/ttySc', '/dev/ttySd') return
def __init__(self, config, hw_info, logger, stress=False): TestMethods.__init__(self, 'System RAM test', config, hw_info, logger) if not stress: self._testprog = config.memtester() else: self._testprog = config.stressmemtester() self._test_prog_logged = 0 return
def __init__(self, config, hw_info, logger, eth_port, netperf_server, netperf_server_port, ping_host, ping_count): TestMethods.__init__(self, 'Ethernet', config, hw_info, logger) self._eth_port = eth_port self._netperf_server = netperf_server self._netperf_server_port = netperf_server_port self._ping_host = ping_host self._ping_count = ping_count
def __init__(self, config, hw_info, logger, avr): TestMethods.__init__(self, 'Dallas temp sensors', config, hw_info, logger) self._num_dallas_busses = 2 if hw_info.model() in ('2400', '2500'): self._num_dallas_busses = 4 self._avr = avr return
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, "I2C RAM", config, hw_info, logger) self._detected = 0 ### # The i2c RAM lives at address 0x50 on bus 0; look for it. result, spewage = execute_command("/usr/bin/i2cdetect 0 | grep -q 50") if result: self._detected = 1 return
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, 'I2C RAM', config, hw_info, logger) self._detected = 0 ### # The i2c RAM lives at address 0x50 on bus 0; look for it. result, spewage = execute_command('/usr/bin/i2cdetect 0 | grep -q 50') if result: self._detected = 1 return
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, 'NetworkTester', config, hw_info, logger) # So we only show the netperf performance notice once during testing. self._netperf_notice = 0 self._eth0 = None self._eth1 = None self._eth0 = _EthernetPort(config, hw_info, logger, 0, self._config.netperf_eth0(), self._config.netperf_eth0_port(), self._config.ping_host_eth0(), self._config.ping_count_eth0()) if self._hw_info.model() in ('TSWS', '2400', '2500'): self._eth1 = _EthernetPort(config, hw_info, logger, 1, self._config.netperf_eth1(), self._config.netperf_eth1_port(), self._config.ping_host_eth1(), self._config.ping_count_eth1())
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, 'NetworkTester', config, hw_info, logger) # So we only show the netperf performance notice once during testing. self._netperf_notice = 0 self._eth0 = None self._eth1 = None self._eth0 = _EthernetPort(config, hw_info, logger, 0, self._config.netperf_eth0(), self._config.netperf_eth0_port(), self._config.ping_host_eth0(), self._config.ping_count_eth0()) if self._hw_info.model() in ('TSWS', '2400', '2500'): self._eth1 = _EthernetPort(config, hw_info, logger, 1, self._config.netperf_eth1(), self._config.netperf_eth1_port() , self._config.ping_host_eth1(), self._config.ping_count_eth1())
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, 'Modem', config, hw_info, logger) self._detect_done = 0 self._modem_present = 0 #### # This is a countdown variable, we only want to execute the modem # tests a certain number of times. self._test_iterations = config.modem_test_iterations() model = self._hw_info.model() if model in ('1200', '2400'): self._modemdev = '/dev/ttyS1' elif model in ('1500', '2500'): self._modemdev = '/dev/ttySe' else: # <-- Prevent execution on anything else (TSWS, S1, ...). self._detect_done = 1 self._modem_present = 0 self._modemdev = None return
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, "I2C RTC", config, hw_info, logger) self._detected = 0 self._rtc_regs = _I2CRtc_Registers() ### # I have seen during tests, the chip will occasionally look like it # has gone south (see _I2CRtc_Registers::is_dead), but then magically # resurrects itself. We'll allow this to happen a certain number of # *consecutive* times before pronouncing the chip fubar. self._rtc_death_watch = 0 self._rtc_death_toll = 0 self._rtc_num_lives = 5 ##### # This is currently not working, do not use. ##### # print 'Quick I2C RTC memory test...' # sys.stdout.flush() # self._rtc_regs.write_buf('Hello World!') # buff, nbytes = self._rtc_regs.read_buf(12) # print 'Read %d bytes from I2C RTC: \"%s\"' % (nbytes, buff) # time.sleep(10) ### # We have to be careful about this. I think the time.sleep() uses # the system clock, anything longer than this and we might see # too much drift in wall time. self._rtc_test_duration = 30 self._rtc_test_tolerance = 5 ### # The i2c RTC lives at address 0x68 on bus 0; look for it. result, spewage = execute_command("/usr/bin/i2cdetect 0 | grep -q 68") if result: self._detected = 1 #### # Benchmark the overhead of the system call so we can deduct this # overhead from the final RTC time tests. Ten iterations should be # sufficient, we're not controlling nuclear power. # # TBD: Measure this once and store, or each time we test the RTC? # # I would prefer to err on the side of caution and measure it each # iteration, but so far results have proven reliable measuring once # and storing the overhead. delta_t = 0.0 for iteration in range(0, 10): start_t = time.clock() sec, min, hrs = self._rtc_regs.get_time() end_t = time.clock() ### # The value we get back from 'clocks' is in processor units. On # x86 Linux, there are 100 processor units per second in # userspace (HZ in include/asm-i386/param.h). delta_t += (end_t - start_t) * 100 self.overhead = int(math.ceil(delta_t / 10.0)) return
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, 'I2CBus', config, hw_info, logger) #self._i2cmem = _I2CMemory(config, hw_info, logger) self._i2crtc = _I2CRtc(config, hw_info, logger)
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, 'I2C RTC', config, hw_info, logger) self._detected = 0 self._rtc_regs = _I2CRtc_Registers() ### # I have seen during tests, the chip will occasionally look like it # has gone south (see _I2CRtc_Registers::is_dead), but then magically # resurrects itself. We'll allow this to happen a certain number of # *consecutive* times before pronouncing the chip fubar. self._rtc_death_watch = 0 self._rtc_death_toll = 0 self._rtc_num_lives = 5 ##### # This is currently not working, do not use. ##### #print 'Quick I2C RTC memory test...' #sys.stdout.flush() #self._rtc_regs.write_buf('Hello World!') #buff, nbytes = self._rtc_regs.read_buf(12) #print 'Read %d bytes from I2C RTC: \"%s\"' % (nbytes, buff) #time.sleep(10) ### # We have to be careful about this. I think the time.sleep() uses # the system clock, anything longer than this and we might see # too much drift in wall time. self._rtc_test_duration = 30 self._rtc_test_tolerance = 5 ### # The i2c RTC lives at address 0x68 on bus 0; look for it. result, spewage = execute_command('/usr/bin/i2cdetect 0 | grep -q 68') if result: self._detected = 1 #### # Benchmark the overhead of the system call so we can deduct this # overhead from the final RTC time tests. Ten iterations should be # sufficient, we're not controlling nuclear power. # # TBD: Measure this once and store, or each time we test the RTC? # # I would prefer to err on the side of caution and measure it each # iteration, but so far results have proven reliable measuring once # and storing the overhead. delta_t = 0.0 for iteration in range(0, 10): start_t = time.clock() sec, min, hrs = self._rtc_regs.get_time() end_t = time.clock() ### # The value we get back from 'clocks' is in processor units. On # x86 Linux, there are 100 processor units per second in # userspace (HZ in include/asm-i386/param.h). delta_t += ((end_t - start_t) * 100) self.overhead = int(math.ceil(delta_t / 10.0)) return
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, 'Boot log', config, hw_info, logger) return
def __init__(self, config, hw_info, logger, ttydev1, ttydev2): TestMethods.__init__(self, 'RS232', config, hw_info, logger) self._ttydev1 = ttydev1 self._ttydev2 = ttydev2 return
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, 'USB', config, hw_info, logger)
def __init__(self, config, hw_info, logger): TestMethods.__init__(self, "I2CBus", config, hw_info, logger) # self._i2cmem = _I2CMemory(config, hw_info, logger) self._i2crtc = _I2CRtc(config, hw_info, logger)
def __init__(self, config, hw_info, logger, avr): TestMethods.__init__(self, 'Counters and Relays', config, hw_info, logger) self._avr = avr return