Exemplo n.º 1
0
    def finalizer():
        """
            Delete the resources created during the test
            """
        failed_to_delete = []
        for resource_type in pods, pvcs, storageclasses:
            for resource in resource_type:
                resource.delete()
                try:
                    resource.ocp.wait_for_delete(resource.name)
                except TimeoutError:
                    failed_to_delete.append(resource)

        if failed_to_delete:
            raise ResourceLeftoversException(
                f"Failed to delete resources: {failed_to_delete}")
Exemplo n.º 2
0
 def finalizer():
     """
         Delete the resources created during the test
         """
     failed_to_delete = []
     for resource_type in pod, pvc, storageclass:
         for resource in resource_type:
             resource.delete()
             try:
                 resource.ocp.wait_for_delete(resource.name)
             except TimeoutError:
                 failed_to_delete.append(resource)
             if resource.kind == constants.PVC:
                 log.info("Checking whether PV is deleted")
                 assert helpers.validate_pv_delete(resource.backed_pv)
     if failed_to_delete:
         raise ResourceLeftoversException(
             f"Failed to delete resources: {failed_to_delete}")
Exemplo n.º 3
0
    def finalizer():
        """
        Delete the resources created during the test
        """
        failed_to_delete = []
        pvs = [pvc.backed_pv_obj for pvc in pvcs]
        for resource_type in pods, pvcs, storageclasses:
            for resource in resource_type:
                resource.delete()
                try:
                    resource.ocp.wait_for_delete(resource.name)
                except TimeoutError:
                    failed_to_delete.append(resource)
            if resource.kind == constants.PVC:
                helpers.wait_for_pv_delete(pvs)

        if failed_to_delete:
            raise ResourceLeftoversException(
                f"Failed to delete resources: {failed_to_delete}")