def setUp(self): utils_lib.init_case(self) if self.params['remote_node'] is None: self.skipTest("Only support to run in server-client mode!") if utils_lib.is_metal(self) or utils_lib.is_ahv(self): self.ssh_timeout = 1200 self.SSH.interval = 60 else: self.ssh_timeout = 180 self.log.info('set ssh connection timeout to {}'.format(self.ssh_timeout)) if 'kdump' in self.id(): timeout = 120 interval = 5 time_start = int(time.time()) while True: cmd = 'sudo systemctl is-active kdump' ret = utils_lib.run_cmd(self, cmd,ret_status=True, msg='check kdump is active') if ret == 0: break time_end = int(time.time()) if time_end - time_start > timeout: self.log.info('timeout ended: {}'.format(timeout)) break self.log.info('retry after {}s'.format(interval)) time.sleep(interval)
def setUp(self): utils_lib.init_case(self) if utils_lib.is_arch(self, arch='aarch64'): ltp_url = self.params.get('ltp_url_aarch64') else: ltp_url = self.params.get('ltp_url_x86_64') utils_lib.pkg_install(self, pkg_name='ltp', pkg_url=ltp_url) self.cursor = utils_lib.get_cmd_cursor(self, cmd='journalctl --since today', rmt_redirect_stdout=True)
def setUp(self): utils_lib.init_case(self) if utils_lib.is_arch(self, arch='aarch64'): blktests_url = self.params.get('blktests_url_aarch64') else: blktests_url = self.params.get('blktests_url_x86_64') utils_lib.pkg_install(self, pkg_name='blktests', pkg_url=blktests_url) self.cursor = utils_lib.get_cmd_cursor(self, cmd='journalctl --since today')
def setUp(self): if not self.vm: self.skipTest("Skip as no VM inited") if not self.vm.provider == 'nutanix': self.skipTest("Skip as not Nutanix AHV platform") if self.vm.is_stopped(): self.vm.start(wait=True) utils_lib.init_case(self) self.dmesg_cursor = utils_lib.get_cmd_cursor(self, cmd='dmesg -T')
def setUp(self): utils_lib.init_case(self) if not self.vm: self.skipTest("no vm found!") if self.params['remote_node'] is None: self.skipTest("Only support to run in server-client mode!") if utils_lib.is_metal(self): self.ssh_timeout = 1200 self.SSH.interval = 60 else: self.ssh_timeout = 180 self.log.info('set ssh connection timeout to {}'.format( self.ssh_timeout))
def setUp(self): utils_lib.init_case(self) self.dmesg_cursor = utils_lib.get_cmd_cursor(self, cmd='dmesg -T') cmd = "sudo ip link show|grep mtu|grep -v lo|awk -F':' '{print $2}'" output = utils_lib.run_cmd(self, cmd, expect_ret=0) self.nic = "eth0" self.log.info( "Test which nic connecting to public, if no found, use {} by default" .format(self.nic)) for net in output.split('\n'): cmd = "ping {} -c 2 -I {}".format(self.params.get('ping_server'), net) ret = utils_lib.run_cmd(self, cmd, ret_status=True) if ret == 0: self.nic = net break
def setUp(self): utils_lib.init_case(self) if utils_lib.is_arch(self, arch='aarch64'): ltp_rpm = self.utils_dir + '/ltp-master.aarch64.rpm' ltp_rpm_tmp = '/tmp/ltp-master.aarch64.rpm' else: ltp_rpm = self.utils_dir + '/ltp-master.x86_64.rpm' ltp_rpm_tmp = '/tmp/ltp-master.x86_64.rpm' cmd = 'ls -l /opt/ltp/runtest/smoketest' ret = utils_lib.run_cmd(self, cmd, ret_status=True, msg='Check if it is ltp version with smoketest') if not utils_lib.is_pkg_installed(self, pkg_name='ltp',is_install=False) or ret != 0: if self.params['remote_node'] is not None: self.log.info('Copy {} to remote'.format(ltp_rpm)) self.SSH.put_file(local_file=ltp_rpm, rmt_file=ltp_rpm_tmp) ltp_rpm = ltp_rpm_tmp if ret != 0: force = True else: force = False utils_lib.pkg_install(self, pkg_name='ltp', pkg_url=ltp_rpm, force=force) self.cursor = utils_lib.get_cmd_cursor(self, rmt_redirect_stdout=True)
def setUp(self): utils_lib.init_case(self)
def setUp(self): utils_lib.init_case(self) self.dmesg_cursor = utils_lib.get_cmd_cursor(self, cmd='dmesg -T')
def setUp(self): utils_lib.init_case(self) if self.params['remote_node'] is None: self.skipTest("Only support to run in server-client mode!")
def setUp(self): utils_lib.init_case(self) if not utils_lib.is_gcp(self): self.skipTest('Only run for gcp image checking.')
def setUp(self): utils_lib.init_case(self) cmd = "sudo systemctl is-enabled cloud-init-local" utils_lib.run_cmd(self, cmd, cancel_ret='0', msg = "check cloud-init-local is enabled")