• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python test_util.test_warn函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中zstackwoodpecker.test_util.test_warn函数的典型用法代码示例。如果您正苦于以下问题:Python test_warn函数的具体用法?Python test_warn怎么用?Python test_warn使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了test_warn函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: add_root_volume_template

def add_root_volume_template(image_creation_option):
    '''
    Add root volume template
    '''
    action = api_actions.AddImageAction()
    action.name = image_creation_option.get_name()
    action.guest_os_type = image_creation_option.get_guest_os_type()
    action.mediaType = 'RootVolumeTemplate'
    if image_creation_option.get_mediaType() and \
            action.mediaType != image_creation_option.get_mediaType():
        test_util.test_warn('image type %s was not %s' % \
                (image_creation_option.get_mediaType(), action.mediaType))

    action.backupStorageUuids = \
            image_creation_option.get_backup_storage_uuid_list()
    action.bits = image_creation_option.get_bits()
    action.description = image_creation_option.get_description()
    action.format = image_creation_option.get_format()
    if image_creation_option.get_system_tags() != None:
        action.systemTags = image_creation_option.get_system_tags().split(',')
    action.url = image_creation_option.get_url()
    action.timeout = image_creation_option.get_timeout()
    test_util.action_logger('Add Root Volume Template from url: %s in [backup Storage:] %s' % (action.url, action.backupStorageUuids))
    evt = account_operations.execute_action_with_session(action, \
            image_creation_option.get_session_uuid())
    return evt.inventory
开发者ID:mrwangxc,项目名称:zstack-woodpecker,代码行数:26,代码来源:image_operations.py


示例2: check

    def check(self):
        super(zstack_share_volume_attach_db_checker, self).check()
        volume = self.test_obj.volume

        try:
            sv_cond = res_ops.gen_query_conditions("volumeUuid", '=', volume.uuid)
            share_volume_vm_uuids = res_ops.query_resource_fields(res_ops.SHARE_VOLUME, sv_cond, None, fields=['vmInstanceUuid'])
        except Exception as e:
            traceback.print_exc(file=sys.stdout)
            test_util.test_logger('Check result: [volumeInventory uuid:] %s does not exist in database.' % self.test_obj.volume.uuid)
            return self.judge(False)

        if not share_volume_vm_uuids:
            #update self.test_obj, due to vm destroyed. 
            if self.test_obj.target_vm.state == vm_header.DESTROYED or \
                    self.test_obj.target_vm.state == vm_header.EXPUNGED:
                test_util.test_warn('Update test [volume:] %s state, since attached VM was destroyed.' % volume.uuid)
                self.test_obj.update()
            else:
                test_util.test_warn('Check warn: [volume:] %s state is not aligned with DB. DB did not record any attached VM, but test volume has attached vm record: %s.' % (volume.uuid, volume.vmInstanceUuid))
            test_util.test_logger('Check result: [volume:] %s does NOT have vmInstanceUuid in Database. It is not attached to any vm.' % volume.uuid)
            return self.judge(False)

        if not self.test_obj.target_vm:
            test_util.test_logger('Check result: test [volume:] %s does NOT have vmInstance record in test structure. Can not do furture checking.' % volume.uuid)
            return self.judge(False)

        vm = self.test_obj.target_vm.vm

        if vm.uuid not in share_volume_vm_uuids:
            test_util.test_logger('Check result: [volume:] %s is attached to [vm:] %s in zstack database.' % (volume.uuid, vm.uuid))
            return self.judge(True)
        else:
            test_util.test_logger('Check result: [volume:] %s is NOT attached to [vm:] %s in zstack database.' % (volume.uuid, vm.uuid))
            return self.judge(False)
开发者ID:mrwangxc,项目名称:zstack-woodpecker,代码行数:35,代码来源:zstack_db_checker.py


示例3: test

def test():
    global vm
    global schd
    vm = test_stub.create_vlan_vm(os.environ.get('l3VlanNetworkName1'))
    start_date = int(time.time())
    test_util.test_logger('Setup stop and start VM scheduler')
    schd = vm_ops.start_vm_scheduler(vm.get_vm().uuid, 'simple', 'simple_start_vm_scheduler', 0, 1)
    actual_startDate = time.mktime(time.strptime(schd.startTime, '%b %d, %Y %H:%M:%S %p'))
    if actual_startDate != start_date and actual_startDate != start_date + 1:
        test_util.test_fail('startDate is expectd to set to now, which should be around %s' % (start_date))
    test_stub.sleep_util(start_date+58)

    start_msg_mismatch = 0
    for i in range(1, 58):
        if not test_lib.lib_find_in_local_management_server_log(start_date+i, '[msg send]: {"org.zstack.header.vm.StartVmInstanceMsg', vm.get_vm().uuid):
            start_msg_mismatch += 1
            test_util.test_warn('StopVmInstanceMsg is expected to execute at %s' % (start_date+i))

    if start_msg_mismatch > 5:
        test_util.test_fail('%s of 58 StartVmInstanceMsg not executed at expected timestamp' % (start_msg_mismatch))

    schd_ops.delete_scheduler(schd.uuid)
    try:
        vm.destroy()
    except:
	test_util.test_logger('expected exception when destroy VM since too many queued task')
    test_util.test_pass('Create Simple VM Start Scheduler Success')
开发者ID:mrwangxc,项目名称:zstack-woodpecker,代码行数:27,代码来源:test_create_start_vm_scheduler_startdate_0.py


示例4: __init__

    def __init__(self, get_host_con = None, justify_con = None):
        self.exc_info = []
        self.hosts = []
        self.i = 0
        self.session_uuid = None
        self.session_to = None
        self.session_mc = None
        self.host_num = os.environ.get('ZSTACK_TEST_NUM')
        self.thread_threshold = os.environ.get('ZSTACK_THREAD_THRESHOLD')
        self.get_host_con = get_host_con
        self.justify_con = justify_con
        if not self.host_num:
            self.host_num = 0
        else:
            self.host_num = int(self.host_num)

        if not self.thread_threshold:
            self.thread_threshold = 1000
        else:
            self.thread_threshold = int(self.thread_threshold)

        self.hosts = res_ops.query_resource(res_ops.HOST, self.get_host_con)
        if self.host_num > len(self.hosts):
            self.host_num = len(self.hosts)
            test_util.test_warn('ZSTACK_TEST_NUM is forcibly set as %d\n' % len(self.hosts))

        self.session_to = con_ops.change_global_config('identity', 'session.timeout',\
                                                  '720000', self.session_uuid)

        self.session_mc = con_ops.change_global_config('identity', 'session.maxConcurrent',\
                                                  '10000', self.session_uuid)
        self.session_uuid = acc_ops.login_as_admin()
开发者ID:mrwangxc,项目名称:zstack-woodpecker,代码行数:32,代码来源:test_stub.py


示例5: check

    def check(self):
        super(zstack_kvm_vm_snat_checker, self).check()
        vm = self.test_obj.vm
        test_lib.lib_install_testagent_to_vr(vm)
        host = test_lib.lib_get_vm_host(vm)

        vm_cmd_result = None
        vr_vms = test_lib.lib_find_vr_by_vm(vm)
        test_lib.lib_set_vm_host_l2_ip(vm)
        for vr_vm in vr_vms:
            test_util.test_logger("Begin to check [vm:] %s SNAT" % vm.uuid)
            nic = test_lib.lib_get_vm_nic_by_vr(vm, vr_vm)
            if not 'SNAT' in test_lib.lib_get_l3_service_type(nic.l3NetworkUuid):
                test_util.test_logger("Skip [VR:] %s, since it doesn't provide SNAT service" % vr_vm.uuid)
                continue

            ping_target = test_lib.test_config.pingTestTarget.text_
            #Check if there is a SG rule to block ICMP checking
            if test_lib.lib_is_sg_rule_exist(nic.uuid, None, None, inventory.EGRESS):
                if not test_lib.lib_is_sg_rule_exist(nic.uuid, inventory.ICMP, ping_target, inventory.EGRESS):
                    test_util.test_warn('Skip SNAT checker: because there is ICMP Egress Rule was assigned to [nic:] %s and the allowed target ip is not %s' % (nic.uuid, ping_target))
                    return self.judge(self.exp_result)

            guest_ip = nic.ip
            vm_command = 'ping -c 5 -W 5 %s >/tmp/ping_result 2>&1; ret=$?; cat /tmp/ping_result; exit $ret' % ping_target
            vm_cmd_result = test_lib.lib_ssh_vm_cmd_by_agent_with_retry(host.managementIp, nic.ip, test_lib.lib_get_vm_username(vm), test_lib.lib_get_vm_password(vm), vm_command, self.exp_result)
            if not vm_cmd_result:
                test_util.test_logger('Checker result: FAIL to ping [target:] %s from [vm:] %s .' % (ping_target, vm.uuid))
                if self.exp_result == True:
                    test_util.test_logger("network connection result is not expected pass, will print VR's network configuration:")
                    test_lib.lib_print_vr_network_conf(vr_vm)
                return self.judge(False)
            else:
                test_util.test_logger('Checker result: SUCCEED to ping [target:] %s from [vm:] %s .' % (ping_target, vm.uuid))
                return self.judge(True)
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:35,代码来源:zstack_kvm_vm_checker.py


示例6: check

    def check(self):
        super(zstack_kvm_vm_network_checker, self).check()
        vm = self.test_obj.vm
        host = test_lib.lib_get_vm_host(vm)
        test_lib.lib_install_testagent_to_host(host)
        test_lib.lib_set_vm_host_l2_ip(vm)
        vr_vms = test_lib.lib_find_vr_by_vm(vm)
        if not vr_vms:
            test_util.test_warn('No Virtual Router was found for VM: %s. Skip testing.' % vm.uuid)
            return self.judge(self.exp_result)

        for vr_vm in vr_vms:
            nic = test_lib.lib_get_vm_nic_by_vr(vm, vr_vm)
            if not 'DHCP' in test_lib.lib_get_l3_service_type(nic.l3NetworkUuid):
                test_util.test_logger("Skip [VR:] %s, since it doesn't provide DHCP service" % vr_vm.uuid)
                continue

            guest_ip = nic.ip
            command = 'ping -c 5 -W 5 %s >/tmp/ping_result 2>&1; ret=$?; cat /tmp/ping_result; exit $ret' % guest_ip
            if not test_lib.lib_execute_sh_cmd_by_agent_with_retry(host.managementIp, command, self.exp_result):
                test_util.test_logger('Checker result: FAIL to ping [target:] %s [ip:] %s from [host:] %s' % (vm.uuid, guest_ip, host.uuid))

                if self.exp_result == True:
                    test_util.test_logger("network connection result is not expected pass, will print VR's network configuration:")
                    test_lib.lib_print_vr_network_conf(vr_vm)
                return self.judge(False)
            else:
                test_util.test_logger('Checker result: SUCCESSFULLY ping [target:] %s [ip:] %s from [host:] %s' % (vm.uuid, guest_ip, host.uuid))

        test_util.test_logger("Checker result: ping target [vm:] %s from [host:] %s SUCCESS" % (vm.uuid, host.uuid))

        return self.judge(True)
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:32,代码来源:zstack_kvm_vm_checker.py


示例7: check

    def check(self):
        super(zstack_kvm_sg_db_exist_checker, self).check()
        sg_list = self.test_obj.get_sg_list_by_nic(self.nic_uuid)

        if not sg_list:
            conditions = res_ops.gen_query_conditions('vmNicUuid', '=', self.nic_uuid)
            nic_sg = res_ops.query_resource(res_ops.VM_SECURITY_GROUP, conditions)
            if not nic_sg:
                test_util.test_logger('Check result: No [Security Group] is found in database for [nic:] %s.' % self.nic_uuid)
                return self.judge(False)
            else:
                test_util.test_warn('Check result: [Security Group] is found in database for [nic:] %s. It is not consistent with test_sg record.' % self.nic_uuid)
                return self.judge(True)

        for test_sg in sg_list:
            try:
                conditions = res_ops.gen_query_conditions('uuid', '=', test_sg.security_group.uuid)
                sg = res_ops.query_resource(res_ops.SECURITY_GROUP, conditions)[0]
            except Exception as e:
                traceback.print_exc(file=sys.stdout)
                test_util.test_logger('Check result: [Security Group Inventory uuid:] %s does not exist in database.' % test_sg.security_group.uuid)
                return self.judge(False)

        test_util.test_logger('Check result: [SecurityGroup Inventory uuid:] %s exist in database.' % sg.uuid)
        return self.judge(True)
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:25,代码来源:zstack_kvm_security_group_checker.py


示例8: check

    def check(self):
        if not self.checker_chain:
            test_util.test_warn('Not find any checker!')
            return

        for checker in self.checker_chain:
            checker.check()
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:7,代码来源:checker.py


示例9: error_cleanup

def error_cleanup():
    global image_obj
    test_lib.lib_error_cleanup(test_obj_dict)
    try:
        image_obj.add_root_volume_template()
    except Exception as e:
        test_util.test_warn('meet exception when try to recover image template')
        raise e
开发者ID:chancelq,项目名称:zstack-woodpecker,代码行数:8,代码来源:test_delete_image.py


示例10: check

    def check(self):
        super(zstack_volume_attach_db_checker, self).check()
        volume = self.test_obj.volume
        if not volume.vmInstanceUuid:
            test_util.test_logger(
                "Check result: test [volume:] %s does NOT record any vmInstanceUuid. It is not attached to any vm yet."
                % volume.uuid
            )
            return self.judge(False)

        try:
            conditions = res_ops.gen_query_conditions("uuid", "=", self.test_obj.volume.uuid)
            db_volume = res_ops.query_resource(res_ops.VOLUME, conditions)[0]
        except Exception as e:
            traceback.print_exc(file=sys.stdout)
            test_util.test_logger(
                "Check result: [volumeInventory uuid:] %s does not exist in database." % self.test_obj.volume.uuid
            )
            return self.judge(False)

        if not db_volume.vmInstanceUuid:
            # update self.test_obj, due to vm destroyed.
            if (
                self.test_obj.target_vm.state == vm_header.DESTROYED
                or self.test_obj.target_vm.state == vm_header.EXPUNGED
            ):
                test_util.test_warn("Update test [volume:] %s state, since attached VM was destroyed." % volume.uuid)
                self.test_obj.update()
            else:
                test_util.test_warn(
                    "Check warn: [volume:] %s state is not aligned with DB. DB did not record any attached VM, but test volume has attached vm record: %s."
                    % (volume.uuid, volume.vmInstanceUuid)
                )
            test_util.test_logger(
                "Check result: [volume:] %s does NOT have vmInstanceUuid in Database. It is not attached to any vm."
                % volume.uuid
            )
            return self.judge(False)

        if not self.test_obj.target_vm:
            test_util.test_logger(
                "Check result: test [volume:] %s does NOT have vmInstance record in test structure. Can not do furture checking."
                % volume.uuid
            )
            return self.judge(False)

        vm = self.test_obj.target_vm.vm

        if db_volume.vmInstanceUuid == vm.uuid:
            test_util.test_logger(
                "Check result: [volume:] %s is attached to [vm:] %s in zstack database." % (volume.uuid, vm.uuid)
            )
            return self.judge(True)
        else:
            test_util.test_logger(
                "Check result: [volume:] %s is NOT attached to [vm:] %s in zstack database." % (volume.uuid, vm.uuid)
            )
            return self.judge(False)
开发者ID:lstfyt,项目名称:zstack-woodpecker,代码行数:58,代码来源:zstack_db_checker.py


示例11: error_cleanup

def error_cleanup():
    global host_config
    test_lib.lib_error_cleanup(test_obj_dict)
    if not host1:
        try:
            host_ops.add_kvm_host(host_config)
        except Exception as e:
            test_util.test_warn('Fail to recover all [host:] %s resource. It will impact later test case.' % host1_name)
            raise e
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:9,代码来源:test_migrate_vr_when_del_host2.py


示例12: error_cleanup

def error_cleanup():
    global ir_option
    test_lib.lib_error_cleanup(test_obj_dict)
    ir = res_ops.get_resource(res_ops.IP_RANGE, name = ir1_name)
    if not ir:
        try:
            net_ops.add_ip_range(ir_option)
        except Exception as e:
            test_util.test_warn('Fail to recover [ip range:] %s resource. It will impact later test case.' % ir1_name)
            raise e
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:10,代码来源:test_delete_ip_range.py


示例13: error_cleanup

def error_cleanup():
    global curr_deploy_conf
    test_lib.lib_error_cleanup(test_obj_dict)
    l3_2 = res_ops.get_resource(res_ops.L3_NETWORK, name = l3_name2)[0]
    if not l3_2:
        try:
            net_ops.add_l3_resource(curr_deploy_conf, l3_name = l3_2.name)
        except Exception as e:
            test_util.test_warn('Fail to recover [l3:] %s resource. It will impact later test case.' % l3_name2)
            raise e
开发者ID:chancelq,项目名称:zstack-woodpecker,代码行数:10,代码来源:test_delete_l3.py


示例14: test

def test():
    global vm
    global schds
    vm = test_stub.create_vlan_vm(os.environ.get('l3VlanNetworkName1'))
    start_date = int(time.time())
    test_util.test_logger('Setup start VM scheduler')
    for ops_id in range(1000):
        thread = threading.Thread(target=create_start_vm_scheduler, args=(vm.get_vm().uuid, start_date, ops_id, ))
        while threading.active_count() > 10:
            time.sleep(0.5)
        exc = sys.exc_info()
        thread.start()

    while threading.activeCount() > 1:
        exc = sys.exc_info()
        time.sleep(0.1)

    test_stub.sleep_util(start_date+200)

    start_msg_mismatch = 0
    for i in range(0, 100):
        if not test_lib.lib_find_in_local_management_server_log(start_date+100+i, '[msg send]: org.zstack.header.vm.StartVmInstanceMsg {"org.zstack.header.vm.StartVmInstanceMsg', vm.get_vm().uuid):
            start_msg_mismatch += 1
            test_util.test_warn('StartVmInstanceMsg is expected to execute at %s' % (start_date+100+i))

    if start_msg_mismatch > 5:
        test_util.test_fail('%s of 58 StartVmInstanceMsg not executed at expected timestamp' % (start_msg_mismatch))

    for schd_job in schd_jobs:
        thread = threading.Thread(target=delete_scheduler_job, args=(schd_job.uuid, ))
        while threading.active_count() > 10:
            time.sleep(0.5)
        exc = sys.exc_info()
        thread.start()

    while threading.activeCount() > 1:
        exc = sys.exc_info()
        time.sleep(0.1)

    for schd_trigger in schd_triggers:
        thread = threading.Thread(target=delete_scheduler_trigger, args=(schd_trigger.uuid, ))
        while threading.active_count() > 10:
            time.sleep(0.5)
        exc = sys.exc_info()
        thread.start()

    while threading.activeCount() > 1:
        exc = sys.exc_info()
        time.sleep(0.1)

    try:
        vm.destroy()
    except:
	test_util.test_logger('expected exception when destroy VM since too many queued task')
    test_util.test_pass('Create 1000 Simple VM Start Scheduler Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:55,代码来源:test_create_1000_start_vm_simple_scheduler.py


示例15: error_cleanup

def error_cleanup():
    global curr_deploy_conf
    cluster1 = res_ops.get_resource(res_ops.CLUSTER, name = cluster1_name)
    if not cluster1:
        try:
            cluster_ops.add_cluster_resource(curr_deploy_conf, cluster1_name)
        except Exception as e:
            test_util.test_warn('Fail to recover all [cluster:] %s resource. It will impact later test case.' % cluster1_name)
            raise e

    test_lib.lib_error_cleanup(test_obj_dict)
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:11,代码来源:test_delete_cluster.py


示例16: error_cleanup

def error_cleanup():
    global host_config
    test_lib.lib_error_cleanup(test_obj_dict)
    host1_name = os.environ.get('hostName')
    host1 = res_ops.get_resource(res_ops.HOST, name = host1_name)[0]
    if not host1:
        try:
            host_ops.add_kvm_host(host_config)
        except Exception as e:
            test_util.test_warn('Fail to recover all [host:] %s resource. It will impact later test case.' % host1_name)
            raise e
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:11,代码来源:test_migrate_vr_when_del_host.py


示例17: error_cleanup

def error_cleanup():
    global curr_deploy_conf
    zone1 = res_ops.get_resource(res_ops.ZONE, name = zone1_name)
    if not zone1:
        try:
            zone_ops.add_zone_resource(curr_deploy_conf, zone1_name)
        except Exception as e:
            test_util.test_warn('Fail to recover all [zone:] %s resource. It will impact later test case.' % zone1_name)
            raise e

    test_lib.lib_error_cleanup(test_obj_dict)
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:11,代码来源:test_delete_zone.py


示例18: test

def test():
    global vm
    global schds
    vm = test_stub.create_vlan_vm(os.environ.get('l3VlanNetworkName1'))
    start_date = int(time.time())
    test_util.test_logger('Setup start VM scheduler')
    for ops_id in range(1000):
        thread = threading.Thread(target=create_start_vm_scheduler, args=(vm.get_vm().uuid, start_date, ops_id, ))
        while threading.active_count() > 10:
            time.sleep(0.5)
        exc = sys.exc_info()
        thread.start()

    while threading.activeCount() > 1:
        exc = sys.exc_info()
        time.sleep(0.1)

    test_stub.sleep_util(start_date+200)
    start_msg_mismatch = 0
    for i in range(0, 99):
        if test_lib.lib_find_in_local_management_server_log(start_date+i, '[msg send]: {"org.zstack.header.vm.StartVmInstanceMsg', vm.get_vm().uuid):
            start_msg_mismatch += 1
            test_util.test_warn('StartVmInstanceMsg is not expected to execute at %s' % (start_date+i))

    if start_msg_mismatch > 5:
        test_util.test_fail('%s of 58 StartVmInstanceMsg not executed at expected timestamp' % (start_msg_mismatch))

    count0 = test_lib.lib_count_in_local_management_server_log(start_date+100, '[msg send]: {"org.zstack.header.vm.StartVmInstanceMsg', vm.get_vm().uuid)
    test_util.test_logger('%s of 1000 scheduler executed at the same second' % count0)
    count1 = test_lib.lib_count_in_local_management_server_log(start_date+100+1, '[msg send]: {"org.zstack.header.vm.StartVmInstanceMsg', vm.get_vm().uuid)
    test_util.test_logger('%s of 1000 scheduler executed at the next second' % count1)
    count2 = test_lib.lib_count_in_local_management_server_log(start_date+100+2, '[msg send]: {"org.zstack.header.vm.StartVmInstanceMsg', vm.get_vm().uuid)
    test_util.test_logger('%s of 1000 scheduler executed at the third second' % count2)
    if count0 + count1 + count2 < 900:
        test_util.test_fail('only %s of 1000 scheduler executed at the specified first 3 seconds' % (count0 + count1 + count2))

    for schd in schds:
        thread = threading.Thread(target=delete_start_vm_scheduler, args=(schd.uuid, ))
        while threading.active_count() > 10:
            time.sleep(0.5)
        exc = sys.exc_info()
        thread.start()

    while threading.activeCount() > 1:
        exc = sys.exc_info()
        time.sleep(0.1)

    try:
        vm.destroy()
    except:
	test_util.test_logger('expected exception when destroy VM since too many queued task')
    test_util.test_pass('Create Simple VM Stop Start Scheduler Success')
开发者ID:mrwangxc,项目名称:zstack-woodpecker,代码行数:52,代码来源:test_create_1000_start_vm_simple_scheduler2.py


示例19: recalc_allowed_denied_ports

    def recalc_allowed_denied_ports(self, allowed_ports, denied_ports, \
            pf_allowed_ports, pf_denied_ports):
        new_allowed_ports = list(allowed_ports)
        new_denied_ports = list(denied_ports)
        for allowed_port in pf_allowed_ports:
            if allowed_port in allowed_ports:
                #this should not happen
                test_util.test_warn('Same VIP ports are assigned more than once. ')
            else:
                new_allowed_ports.append(allowed_port)
                new_denied_ports.remove(allowed_port)

        return new_allowed_ports, new_denied_ports
开发者ID:mrwangxc,项目名称:zstack-woodpecker,代码行数:13,代码来源:zstack_vcenter_vip_checker.py


示例20: error_cleanup

def error_cleanup():
    global host_config
    global ps_inv
    test_lib.lib_error_cleanup(test_obj_dict)
    host1 = res_ops.get_resource(res_ops.HOST, name = host1_name)
    if not host1:
        try:
            test_stub.recover_ps(ps_inv)
        except Exception as e:
            test_util.test_warn('Fail to recover all primary storage %s resource. It might impact later test case.' % ps_inv.name)
        try:
            host_ops.add_kvm_host(host_config)
        except Exception as e:
            test_util.test_warn('Fail to recover all [host:] %s resource. It will impact later test case.' % host1_name)
            raise e
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:15,代码来源:test_delete_host_and_ps.py



注:本文中的zstackwoodpecker.test_util.test_warn函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python transform.ZMapTransformOutput类代码示例发布时间:2022-05-26
下一篇:
Python test_util.test_skip函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap