def print_prerun_summary(self): if self._enabled_tests <= 1: return self._logger.msg('Mediator hardware test program revision %s.\n', hwtest_version()) self._logger.msg('Copyright (C) 2009 Cisco Systems, Inc. All rights reserved.\n\n') self._logger.msg('Test executed on %s\n' % os.popen('date').readline()) self._logger.msg('Model number: %s\n' % self._hw_info.model()) self._logger.msg('Framework version: %s\n' % properties.COMPOUND_VERSION) self._logger.msg('MOE version: %s\n' % properties.MOE_VERSION) self._logger.msg('Serial number: %s\n' % self._hw_info.serialno()) self._logger.msg('eth0 MAC address: %s\n' % self._hw_info.mac_addr(0)) if self._hw_info.model() in ('TSWS', '2400', '2500'): self._logger.msg('eth1 MAC address: %s\n' % self._hw_info.mac_addr(1)) ### # Having a list of loaded modules will be extremely helpful in the # event a test should fail (because the module might not have loaded). self._logger.msg('Loaded kernel modules:\n') result, spewage = execute_command('/sbin/lsmod') if not result: raise Exception('Cannot get module info, aborting test.') for line in spewage: self._logger.msg(line) self._logger.msg('\n') return
def print_prerun_summary(self): if self._enabled_tests <= 1: return self._logger.msg('Mediator hardware test program revision %s.\n', hwtest_version()) self._logger.msg( 'Copyright (C) 2009 Cisco Systems, Inc. All rights reserved.\n\n') self._logger.msg('Test executed on %s\n' % os.popen('date').readline()) self._logger.msg('Model number: %s\n' % self._hw_info.model()) self._logger.msg('Framework version: %s\n' % properties.COMPOUND_VERSION) self._logger.msg('MOE version: %s\n' % properties.MOE_VERSION) self._logger.msg('Serial number: %s\n' % self._hw_info.serialno()) self._logger.msg('eth0 MAC address: %s\n' % self._hw_info.mac_addr(0)) if self._hw_info.model() in ('TSWS', '2400', '2500'): self._logger.msg('eth1 MAC address: %s\n' % self._hw_info.mac_addr(1)) ### # Having a list of loaded modules will be extremely helpful in the # event a test should fail (because the module might not have loaded). self._logger.msg('Loaded kernel modules:\n') result, spewage = execute_command('/sbin/lsmod') if not result: raise Exception('Cannot get module info, aborting test.') for line in spewage: self._logger.msg(line) self._logger.msg('\n') return
continue if opt in ('-s', '--serial'): _set_attr(attrs, 'serial') continue if opt in ('-u', '--usb'): _set_attr(attrs, 'usb') continue if opt in ('-q', '--quiet'): quiet_mode = True continue if opt in ('-v', '--version'): print 'Mediator hw_test version %s\nCopyright (c) 2009 by Cisco Systems, Inc.' % (hwtest_version()) return 1 hw_info = HardwareInfo() if arg: arg = arg.strip() if opt in ('-A', '--assembly'): if arg: try: hw_info.set_assembly(arg) return 1 except: print 'Error writing Assembly ID.' return -1 if opt in ('-M', '--manufacturing'):