def tearDown(self):
     aws.done_test(self)
     if self.vm.is_created:
         if 'test_multi' in self.name.name or 'blktests' in self.name.name:
             self.log.info('Release disk if it is not available')
             try:
                 if self.params.get('outpostarn') is not None:
                     if self.disk1.is_attached():
                         self.disk1.detach_from_instance()
                 else:
                     [disk.detach_from_instance(force=True) for disk in [self.disk1, self.disk2, self.disk3, self.disk4] if disk.is_attached()]
             except AttributeError as err:
                 self.log.info('No disk release required!')
         self.session = self.session
         try:
             if self.session is not None and self.session.session.is_responsive() is not None and self.vm.is_started():
                 aws.gcov_get(self)
                 aws.get_memleaks(self)
                 self.session.close()
             if self.name.name.endswith("test_blktests_nvme"):
                 self.vm.reboot()
             self.log.info("Try to close session")
             self.session.close()
         except Exception as err:
             self.log.info("Exception hit when try to close session: {}".format(err))
Ejemplo n.º 2
0
 def tearDown(self):
     aws.done_test(self)
     if self.vm.is_created:
         if self.session.session.is_responsive(
         ) is not None and self.vm.is_started():
             aws.gcov_get(self)
             aws.get_memleaks(self)
             self.session.close()
 def tearDown(self):
     aws.done_test(self)
     if self.vm.is_created:
         if self.session.session.is_responsive(
         ) is not None and self.vm.is_started():
             aws.gcov_get(self)
             utils_lib.run_cmd(self,
                               'uname -r',
                               msg='Get instance kernel version')
             self.session.close()
Ejemplo n.º 4
0
 def tearDown(self):
     aws.done_test(self)
     if self.vm.is_created:
         if self.session.session.is_responsive(
         ) is not None and self.vm.is_started():
             utils_lib.run_cmd(self,
                         'rpm -q cloud-init',
                         msg='Get cloud-init version.')
             aws.gcov_get(self)
             aws.get_memleaks(self)
             self.session.close()
 def tearDown(self):
     aws.done_test(self)
     if self.vm.is_created:
         self.session = self.session1
         if self.session.session.is_responsive(
         ) is not None and self.vm1.is_started():
             if self.name.name.endswith("test_pci_reset"):
                 cmd = 'sudo dmesg --clear'
                 utils_lib.run_cmd(self, cmd, msg='Clear dmesg')
             aws.gcov_get(self)
             aws.get_memleaks(self)
             self.session.close()
         self.session1.close()
         if self.name.name.endswith("test_iperf_ipv4"):
             self.session2.close()
Ejemplo n.º 6
0
 def tearDown(self):
     aws.done_test(self)
     if self.vm.is_created:
         if "test_boot_mitigations" in self.name.name:
             cmd = 'sudo grubby --update-kernel=ALL  --remove-args="mitigations=auto,nosmt"'
             utils_lib.run_cmd(self, cmd, msg='Remove "mitigations=auto,nosmt"')
             self.log.info('Reboot system!')
             self.vm.reboot(wait=True)
             if 'metal' in self.vm.instance_type:
                 self.log.info("Wait {}".format(self.ssh_wait_timeout))
                 time.sleep(self.ssh_wait_timeout)
             else:
                 self.log.info("Wait 60s")
                 time.sleep(60)
 
         if "create_snapshot" in self.name.name:
             if self.snap.delete():
                 self.log.info("Delete snaphot after test!")
             else:
                 self.log.info("Delete snapshot failed after test!")
         if "test_boot_debugkernel" in self.name.name:
             aws.cleanup_stored(self.teststmpdir,
                                self.params,
                                resource_id=self.vm.res_id)
         if "test_boot_nr_cpus" in self.name.name:
             for cpu in range(1,3):
                 cmd = 'sudo grubby --update-kernel=ALL --remove-args="nr_cpus={}"'.format(cpu)
                 utils_lib.run_cmd(self, cmd, msg='remove nr_cpus={}'.format(cpu))
 
             self.log.info('Reboot system!')
             self.vm.reboot(wait=True)
             if 'metal' in self.vm.instance_type:
                 self.log.info("Wait {}".format(self.ssh_wait_timeout))
                 time.sleep(self.ssh_wait_timeout)
             else:
                 self.log.info("Wait 60s")
                 time.sleep(60)
         if "test_boot_usbcore_quirks" in self.name.name:
             option = 'usbcore.quirks=quirks=0781:5580:bk,0a5c:5834:gij'
             cmd = 'sudo grubby --update-kernel=ALL --args="{}"'.format(option)
             utils_lib.run_cmd(self, cmd, msg='Remove "{}"'.format(option))
             self.log.info('Reboot system!')
             self.vm.reboot(wait=True)
             if 'metal' in self.vm.instance_type:
                 self.log.info("Wait {}".format(self.ssh_wait_timeout))
                 time.sleep(self.ssh_wait_timeout)
             else:
                 self.log.info("Wait 60s")
                 time.sleep(60)
         if "test_boot_hpet_mmap_enabled" in self.name.name:
             cmd = 'sudo grubby --update-kernel=ALL  --remove-args="hpet_mmap=1"'
             utils_lib.run_cmd(self, cmd, msg='Remove "hpet_mmap=1"')
             self.log.info('Reboot system!')
             self.vm.reboot(wait=True)
             if 'metal' in self.vm.instance_type:
                 self.log.info("Wait {}".format(self.ssh_wait_timeout))
                 time.sleep(self.ssh_wait_timeout)
             else:
                 self.log.info("Wait 60s")
                 time.sleep(60)
         
         if self.session.session.is_responsive(
         ) is not None and self.vm.is_started():
             aws.gcov_get(self)
             aws.get_memleaks(self)
             self.session.close()