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

Python test_util.test_dsc函数代码示例

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

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



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

示例1: test

def test():
    test_util.test_dsc('Create test vm to test zstack upgrade by -u.')
    image_name = os.environ.get('imageName_i_c7')
    vm = test_stub.create_vlan_vm(image_name)
    test_obj_dict.add_vm(vm)
    if os.environ.get('zstackManagementIp') == None:
        vm.check()
    else:
        time.sleep(60)

    vm_inv = vm.get_vm()
    vm_ip = vm_inv.vmNics[0].ip
    target_file = '/root/zstack-all-in-one.tgz'
    test_stub.prepare_test_env(vm_inv, target_file)
    ssh_cmd = 'ssh  -oStrictHostKeyChecking=no -oCheckHostIP=no -oUserKnownHostsFile=/dev/null %s' % vm_ip
    test_stub.copy_id_dsa(vm_inv, ssh_cmd, tmp_file)
    test_stub.copy_id_dsa_pub(vm_inv)
    test_stub.execute_all_install(ssh_cmd, target_file, tmp_file)
    test_stub.check_installation(ssh_cmd, tmp_file, vm_inv)

    test_stub.upgrade_zstack(ssh_cmd, target_file, tmp_file)
    test_stub.check_installation(ssh_cmd, tmp_file, vm_inv)

    os.system('rm -f %s' % tmp_file)
    vm.destroy()
    test_util.test_pass('ZStack upgrade Test Success')
开发者ID:TinaL3,项目名称:zstack-woodpecker,代码行数:26,代码来源:test_zs_upgd_on_cos7.py


示例2: test

def test():
    test_util.test_dsc('Test storage capacity when using expunge vm')
    if conf_ops.get_global_config_value('vm', 'deletionPolicy') != 'Delay' :
        test_util.test_skip('vm delete_policy is not Delay, skip test.')
        return

    zone_uuid = res_ops.query_resource(res_ops.ZONE)[0].uuid
    cond = res_ops.gen_query_conditions('state', '=', 'Enabled')
    cond = res_ops.gen_query_conditions('status', '=', 'Connected', cond)
    host = res_ops.query_resource_with_num(res_ops.HOST, cond, limit = 1)
    if not host:
        test_util.test_skip('No Enabled/Connected host was found, skip test.' )
        return True

    ps = res_ops.query_resource_with_num(res_ops.PRIMARY_STORAGE, cond, limit = 1)
    if not ps:
        test_util.test_skip('No Enabled/Connected primary storage was found, skip test.' )
        return True

    host = host[0]
    ps = ps[0]

    host_res = vol_ops.get_local_storage_capacity(host.uuid, ps.uuid)[0]
    avail_cap = host_res.availableCapacity

    vm = test_stub.create_vm(vm_name = 'basic-test-vm', host_uuid = host.uuid)
    test_obj_dict.add_vm(vm)
    time.sleep(1)
    vm.destroy()
    vm.expunge()
    host_res2 = vol_ops.get_local_storage_capacity(host.uuid, ps.uuid)[0]
    avail_cap2 = host_res.availableCapacity
    if avail_cap != avail_cap2:
        test_util.test_fail('PS capacity is not same after create/expunge vm on host: %s. Capacity before create vm: %s, after expunge vm: %s ' % (host.uuid, avail_cap, avail_cap2))
    test_util.test_pass('Expunge VM Test Success')
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:35,代码来源:test_expunge_vm_ps_capacity2.py


示例3: test

def test():
    test_util.test_dsc('''
        Will doing random test operations, including vm create/stop/start/reboot
        /destroy, volume create/attach/detach/delete. It doesn't include SG 
        VIP and snapshots operations. If reach max 4 coexisting running vm, 
        testing will success and quit. 
    ''')
    target_running_vm = 4

    test_util.test_dsc('Random Test Begin. Test target: 4 coexisting running VM (not include VR).')
    robot_test_obj = test_util.Robot_Test_Object()
    robot_test_obj.set_test_dict(test_dict)
    robot_test_obj.set_exclusive_actions_list(\
            test_state.TestAction.sg_actions \
            + test_state.TestAction.vip_actions \
            + test_state.TestAction.snapshot_actions)
    priority_actions = test_state.TestAction.volume_actions * 4
    priority_action_obj = action_select.ActionPriority()
    priority_action_obj.add_priority_action_list(priority_actions)
    robot_test_obj.set_priority_actions(priority_action_obj)

    rounds = 1
    while len(test_dict.get_vm_list(vm_header.RUNNING)) < target_running_vm:
        print "test_dict: %s" % test_dict
        test_util.test_dsc('New round %s starts: random operation pickup.' % rounds)
        test_lib.lib_vm_random_operation(robot_test_obj)
        test_util.test_dsc('Round %s finished. Begin status checking.' % rounds)
        rounds += 1
        test_lib.lib_robot_status_check(test_dict)

    test_util.test_dsc('Reach test pass exit criterial.')
    test_lib.lib_robot_cleanup(test_dict)
    test_util.test_pass('Create random VM Test Success')
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:33,代码来源:test_4vm_volumes_robot.py


示例4: test

def test():
   test_util.test_dsc('Test Change VM Image In Multihosts Env')
   global vm
   image = test_lib.lib_get_image_by_name("centos")
   vm = test_stub.create_vm(image_uuid=image.uuid)
   last_l3network_uuid = test_lib.lib_get_l3s_uuid_by_vm(vm.get_vm())
   last_primarystorage_uuid = test_lib.lib_get_root_volume(vm.get_vm()).primaryStorageUuid
   last_host_uuid = test_lib.lib_get_vm_last_host(vm.get_vm()).uuid
   image_uuid = test_lib.lib_get_image_by_name("image_for_sg_test").uuid
   vm_uuid = vm.get_vm().uuid
   host_ops.change_host_state(host_uuid = last_host_uuid, state = 'disable')
   vm_ops.stop_vm(vm_uuid)
   ps = test_lib.lib_get_primary_storage_by_vm(vm.get_vm())
   #Disable vm's host.If ps is shared storage,the vm will be started on another host that meets the conditions and the operation of changing vm image will success.
   if ps.type != 'LocalStorage':
      vm_ops.change_vm_image(vm_uuid,image_uuid)
      vm_ops.start_vm(vm_uuid)
      #check whether the network config has changed
      l3network_uuid_after = test_lib.lib_get_l3s_uuid_by_vm(vm.get_vm())
      if l3network_uuid_after != last_l3network_uuid:
         test_util.test_fail('Change VM Image Failed.The Network config has changed.')
      #check whether primarystorage has changed
      primarystorage_uuid_after = test_lib.lib_get_root_volume(vm.get_vm()).primaryStorageUuid
      if primarystorage_uuid_after != last_primarystorage_uuid:
         test_util.test_fail('Change VM Image Failed.Primarystorage has changed.')
      vm.destroy()
      test_util.test_pass('Change Vm Image Test Success In Multihosts Env Success')
   #Disable vm's host.If ps is local storage,the operation of changing vm image will fail.  
   else:
      try:
         vm_ops.change_vm_image(vm_uuid, image_uuid)
      except:
         test_util.test_pass('Change Vm Image Test Success In Multihosts Env Success')
   test_util.test_fail('Test Change VM Image In Multihosts Env Success Failed')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:34,代码来源:test_change_vm_image_in_multihosts_env.py


示例5: test

def test():
    global vm_inv
    test_util.test_dsc('Create test vm to test zstack upgrade by -u.')

    image_name = os.environ.get('imageName_i_c7_z_1.9')
    #iso_path = os.environ.get('iso_path')
    zstack_latest_version = os.environ.get('zstackLatestVersion')
    zstack_latest_path = os.environ.get('zstackLatestInstaller')
    vm_name = os.environ.get('vmName')
    #upgrade_script_path = os.environ.get('upgradeScript')

    vm_inv = test_stub.create_vm_scenario(image_name, vm_name)
    vm_ip = vm_inv.vmNics[0].ip
    test_lib.lib_wait_target_up(vm_ip, 22)

    test_stub.make_ssh_no_password(vm_ip, tmp_file)

    test_util.test_logger('Update MN IP')
    test_stub.update_mn_hostname(vm_ip, tmp_file)
    test_stub.update_mn_ip(vm_ip, tmp_file)
    test_stub.start_mn(vm_ip, tmp_file)
    test_stub.check_installation(vm_ip, tmp_file)

    test_util.test_logger('Upgrade zstack to latest with repo') 
    #test_stub.update_iso(vm_ip, tmp_file, iso_path, upgrade_script_path)
    test_stub.update_repo(vm_ip, tmp_file)
    test_stub.upgrade_zstack(vm_ip, zstack_latest_path, tmp_file) 
    test_stub.check_zstack_version(vm_ip, tmp_file, zstack_latest_version)
    test_stub.start_mn(vm_ip, tmp_file)
    test_stub.check_mn_running(vm_ip, tmp_file)
    test_stub.check_installation(vm_ip, tmp_file)

    os.system('rm -f %s' % tmp_file)
    test_stub.destroy_vm_scenario(vm_inv.uuid)
    test_util.test_pass('ZStack upgrade Test Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:35,代码来源:test_zs_upgd_1.9_latest_repo_on_cos7.py


示例6: test

def test():
    test_util.test_dsc('Create test vm with EIP and check.')
    vm = test_stub.create_vlan_vm(os.environ.get('l3VlanNetworkName1'))
    test_obj_dict.add_vm(vm)
    
    pri_l3_name = os.environ.get('l3VlanNetworkName1')
    pri_l3_uuid = test_lib.lib_get_l3_by_name(pri_l3_name).uuid

    pub_l3_name = os.environ.get('l3PublicNetworkName')
    pub_l3_uuid = test_lib.lib_get_l3_by_name(pub_l3_name).uuid

    vm_nic = vm.vm.vmNics[0]
    vm_nic_uuid = vm_nic.uuid
    vip = test_stub.create_vip('create_eip_test', pub_l3_uuid)
    test_obj_dict.add_vip(vip)
    eip = test_stub.create_eip('create eip test', vip_uuid=vip.get_vip().uuid, vnic_uuid=vm_nic_uuid, vm_obj=vm)
    
    vip.attach_eip(eip)
    
    vm.check()
    if not test_lib.lib_check_directly_ping(vip.get_vip().ip):
        test_util.test_fail('expected to be able to ping vip while it fail')
    vm.destroy()
    test_obj_dict.rm_vm(vm)
    if test_lib.lib_check_directly_ping(vip.get_vip().ip):
        test_util.test_fail('not expected to be able to ping vip while it succeed')

    eip.delete()
    vip.delete()

    test_obj_dict.rm_vip(vip)
    test_util.test_pass('Create EIP for VM Success')
开发者ID:TinaL3,项目名称:zstack-woodpecker,代码行数:32,代码来源:test_create_eip_vm.py


示例7: test

def test():
    test_util.test_dsc('Create test vm and check')
    vm1 = test_stub.create_vm(vm_name="vm1", image_name="ocfs2-host-image")
    test_obj_dict.add_vm(vm1)

    vm2 = test_stub.create_vm(vm_name="vm2", image_name="ocfs2-host-image")
    test_obj_dict.add_vm(vm2)

    vm1.check()
    vm2.check()

    test_util.test_dsc('Create volume and check')
    disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName'))
    volume_creation_option = test_util.VolumeOption()
    volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
    normal_volume = test_stub.create_volume(volume_creation_option)
    test_obj_dict.add_volume(normal_volume)
    normal_volume.check()

    volume_creation_option.set_system_tags(['ephemeral::shareable', 'capability::virtio-scsi'])
    sharable_volume = test_stub.create_volume(volume_creation_option)
    test_obj_dict.add_volume(sharable_volume)
    sharable_volume.check()
    normal_volume.check()

    test_util.test_dsc('Attach volume and check')
    #mv vm checker later, to save some time.
    normal_volume.attach(vm2)
    sharable_volume.attach(vm1)
    sharable_volume.attach(vm2)
    sharable_volume.check()
    normal_volume.check()

    config_ocfs2_vms(vm1, vm2)
    check_sharable_volume(vm1, vm2)

    test_util.test_dsc('Detach volume and check')
    sharable_volume.detach(vm1.get_vm().uuid)
    sharable_volume.detach(vm2.get_vm().uuid)
    normal_volume.detach(vm2.get_vm().uuid)
    sharable_volume.check()
    normal_volume.check()

    test_util.test_dsc('Delete volume and check')
    sharable_volume.delete()
    sharable_volume.expunge()
    normal_volume.delete()
    normal_volume.expunge()
    sharable_volume.check()
    normal_volume.check()
    test_obj_dict.rm_volume(sharable_volume)
    test_obj_dict.rm_volume(normal_volume)

    vm1.destroy()
    vm2.destroy()
    vm1.check()
    vm2.check()
    vm1.expunge()
    vm2.expunge()
    test_util.test_pass('Create Data Volume for VM Test Success')
开发者ID:mrwangxc,项目名称:zstack-woodpecker,代码行数:60,代码来源:test_add_sharable_vol_normal_vol.py


示例8: test

def test():
    global vms, ts
    test_util.test_dsc('create VM with setting password')

    for root_password in root_password_list:
        test_util.test_dsc("root_password: \"%s\"" %(root_password))
        
        for i in range(vm_num):
            vm_name = "VM%s" %(str(i))
            t = threading.Thread(target=create_vm_wrapper, args=('c7-'+vm_name, "batch_test_image", root_password))
            ts.append(t)
            t.start()

        for t in ts:
            t.join()

        for vm in vms:
            if not test_lib.lib_check_login_in_vm(vm.get_vm(), "root", root_password):
                test_util.test_fail("create vm with root password: %s failed", root_password)
            vm.destroy()
            vm.check()
            vm.expunge()
            vm.check()


    test_util.test_pass('Set password when VM is creating is successful.')
开发者ID:mrwangxc,项目名称:zstack-woodpecker,代码行数:26,代码来源:test_bath_crt_vm_passwd_c7.py


示例9: test

def test():
    pf_vm1 = test_stub.create_dnat_vm()
    test_obj_dict.add_vm(pf_vm1)

    l3_name = os.environ.get('l3VlanNetworkName1')
    vr1 = test_stub.create_vr_vm(test_obj_dict, l3_name)

    vr1_pub_ip = test_lib.lib_find_vr_pub_ip(vr1)
    
    pf_vm1.check()

    vm_nic1 = pf_vm1.vm.vmNics[0]
    vm_nic_uuid1 = vm_nic1.uuid
    pri_l3_uuid = vm_nic1.l3NetworkUuid
    vr = test_lib.lib_find_vr_by_l3_uuid(pri_l3_uuid)[0]
    vr_pub_nic = test_lib.lib_find_vr_pub_nic(vr)
    l3_uuid = vr_pub_nic.l3NetworkUuid
    vip = test_stub.create_vip('pf_attach_test', l3_uuid)
    test_obj_dict.add_vip(vip)
    vip_uuid = vip.get_vip().uuid

    test_util.test_dsc("attach, detach and delete pf for many times")
    for i in range(1, 451):
        test_util.test_logger('round %s' % (i))
        starttime = datetime.datetime.now()
        pf_creation_opt1 = PfRule.generate_pf_rule_option(vr1_pub_ip, protocol=inventory.TCP, vip_target_rule=Port.rule5_ports, private_target_rule=Port.rule5_ports, vip_uuid=vip_uuid)
        pf_creation_opt1.set_vip_ports(i, i)
        pf_creation_opt1.set_private_ports(i, i)
        test_pf1 = zstack_pf_header.ZstackTestPortForwarding()
        test_pf1.set_creation_option(pf_creation_opt1)
        test_pf1.create()
        vip.attach_pf(test_pf1)

        if i < 151:
            test_pf1.attach(vm_nic_uuid1, pf_vm1)
            pf_dict[i] = test_pf1.get_port_forwarding().uuid
        elif i < 301:
            test_pf1.attach(vm_nic_uuid1, pf_vm1)
            test_pf1.detach()
            pf_dict[i] = test_pf1.get_port_forwarding().uuid
        else :
            test_pf1.attach(vm_nic_uuid1, pf_vm1)
            test_pf1.detach()
            test_pf1.delete()
            
        endtime = datetime.datetime.now()
        optime = (endtime - starttime).seconds
        test_util.test_dsc("round %s, pf operation time: %s" % (i, optime))
        test_util.test_logger("the pf operation time is %s seconds" % optime)   
        if optime > 240:
            test_util.test_fail("the pf operation time is %s seconds, more than 240 seconds" % optime)   
  
    vip.delete()
    test_obj_dict.rm_vip(vip)
    pf_vm1.destroy()
    test_obj_dict.rm_vm(pf_vm1)
    for j in pf_dict:
        net_ops.delete_port_forwarding(pf_dict[j])

    test_util.test_pass("Test Port Forwarding Attach/Detach Successfully")
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:60,代码来源:test_attach_many_pf.py


示例10: env_recover

def env_recover():
    test_util.test_dsc("Destroy test object")
    test_lib.lib_error_cleanup(test_obj_dict)
    if new_ps_list:
        for new_ps in new_ps_list:
            ps_ops.detach_primary_storage(new_ps.uuid, new_ps.attachedClusterUuids[0])
            ps_ops.delete_primary_storage(new_ps.uuid)
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:7,代码来源:test_create_multi_vm_volume.py


示例11: test

def test():
    global test_obj_dict
    test_util.test_dsc('Create a VM with 3 additional data volumes with 1 of them using virtio-scsi')
    disk_offering1 = test_lib.lib_get_disk_offering_by_name(os.environ.get('smallDiskOfferingName'))
    disk_offering_uuids = []
    for i in range(0, 8):
        disk_offering_uuids.append(disk_offering1.uuid)
    disk_offering2 = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName'))
    for i in range(0, 14):
        disk_offering_uuids.append(disk_offering2.uuid)
    vm = test_stub.create_vlan_vm(system_tags=["virtio::diskOffering::%s::num::14" % (disk_offering2.uuid) ,"virtio::diskOffering::%s::num::14" % (disk_offering1.uuid)], l3_name=os.environ.get('l3VlanNetworkName1'), disk_offering_uuids=disk_offering_uuids)
    test_obj_dict.add_vm(vm)
    vm.check()
    volumes_number = len(test_lib.lib_get_all_volumes(vm.vm))
    if volumes_number != 23:
        test_util.test_fail('Did not find 23 volumes for [vm:] %s. But we assigned 22 data volume when create the vm. We only catch %s volumes' % (vm.vm.uuid, volumes_number))
    else:
        test_util.test_logger('Find 23 volumes for [vm:] %s.' % vm.vm.uuid)

    scsi_cmd = 'ls /dev/sd* | wc -l'
    if test_lib.lib_execute_command_in_vm(vm.get_vm(), scsi_cmd).strip() != '22':
        test_util.test_fail('Only expect 22 disk in virtio scsi mode')

    vm.destroy()
    test_util.test_pass('Create a VM with 22 additional data volumes with 22 of them using virtio-scsi PASS')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:25,代码来源:test_crt_vm_24_virtio_scsi_volumes.py


示例12: test

def test():
    global test_obj_dict
    test_util.test_dsc("Create 1 VMs with vlan VR L3 network for SG testing.")
    vm1 = test_stub.create_sg_vm()
    test_obj_dict.add_vm(vm1)
    vm1.check()

    nic_uuid = vm1.vm.vmNics[0].uuid
    vm_nics = (nic_uuid, vm1)
    l3_uuid = vm1.vm.vmNics[0].l3NetworkUuid

    vr_vm = test_lib.lib_find_vr_by_vm(vm1.vm)[0]
    vm1_ip = test_lib.lib_get_vm_nic_by_l3(vr_vm, l3_uuid).ip
    target_ip_prefix = '10.10.10.'
    
    test_util.test_dsc("Create security groups.")
    for i in range(sg_num):
        target_ip = '%s%s' % (target_ip_prefix, str(1+i))
        rule1 = test_lib.lib_gen_sg_rule(Port.rule1_ports, inventory.TCP, inventory.INGRESS, target_ip)
        rule2 = test_lib.lib_gen_sg_rule(Port.rule2_ports, inventory.TCP, inventory.INGRESS, target_ip)
        rule3 = test_lib.lib_gen_sg_rule(Port.rule3_ports, inventory.TCP, inventory.INGRESS, target_ip)
        rule4 = test_lib.lib_gen_sg_rule(Port.rule4_ports, inventory.TCP, inventory.INGRESS, target_ip)
        rule5 = test_lib.lib_gen_sg_rule(Port.rule5_ports, inventory.TCP, inventory.INGRESS, target_ip)

        sg = test_stub.create_sg()
        test_obj_dict.add_sg(sg.security_group.uuid)
        sg.add_rule([rule1, rule2, rule3, rule4, rule5])
        sg_vm.attach(sg, [vm_nics])

    time.sleep(3)
    #need regularlly clean up log files in virtual router when doing stress test
    test_lib.lib_check_cleanup_vr_logs_by_vm(vm1.vm)
    #clean up all vm and sg
    test_lib.lib_robot_cleanup(test_obj_dict)
    test_util.test_pass('Create/Destroy VM with VR successfully')
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:35,代码来源:test_1_vr_vm_with_200_sg.py


示例13: test

def test():
    global new_offering_uuid
    test_util.test_dsc('Test VM network bandwidth QoS by 1MB')

    #unit is KB
    net_bandwidth1 = 1024
    new_offering1 = test_lib.lib_create_instance_offering(net_bandwidth = net_bandwidth1)

    test_obj_dict.add_instance_offering(new_offering1)
    new_offering_uuid = new_offering1.uuid

    vm = test_stub.create_vm(vm_name = 'vm_net_qos', \
            instance_offering_uuid = new_offering1.uuid)
    test_obj_dict.add_vm(vm)

    vm.stop()

    net_bandwidth2 = 512
    new_offering2 = test_lib.lib_create_instance_offering(net_bandwidth = net_bandwidth2)

    test_obj_dict.add_instance_offering(new_offering2)
    new_offering_uuid = new_offering2.uuid
    vm_inv = vm.get_vm()
    vm.change_instance_offering(new_offering_uuid)
    vm.start()
    vm.check()
    import time
    time.sleep(1)
    test_stub.make_ssh_no_password(vm_inv)
    test_stub.create_test_file(vm_inv, net_bandwidth2)
    test_stub.test_scp_speed(vm_inv, net_bandwidth2)
    test_lib.lib_robot_cleanup(test_obj_dict)

    test_util.test_pass('VM Network QoS change instance offering Test Pass')
开发者ID:KevinDavidMitnick,项目名称:zstack-woodpecker,代码行数:34,代码来源:test_net_change_qos.py


示例14: test

def test():
    global ipsec
    global vip1_uuid
    global vpc_vr
    cond = res_ops.gen_query_conditions('name', '=', 'public network') 
    public_network = res_ops.query_resource(res_ops.L3_NETWORK, cond)[0]
    vip1 = test_stub.create_vip('vip_ipsec', public_network.uuid)
    vip1_uuid = vip1.get_vip().uuid
    test_util.test_dsc('Create vpc vr and attach networks')
    vpc_vr = test_stub.create_vpc_vrouter()

    cond = res_ops.gen_query_conditions('name', '=', 'l3VlanNetwork11')
    l3_vlan_network11 = res_ops.query_resource(res_ops.L3_NETWORK, cond)[0]
    vpc_vr.add_nic(l3_vlan_network11.uuid)

    peer_address = '10.94.10.10'
    
    try:
        ipsec = ipsec_ops.create_ipsec_connection('ipsec', None, peer_address, '123456', vip1_uuid, None)
    except:
        test_util.test_fail('Failed to create vpc ipsec')

    test_stub.delete_vip(vip1_uuid)
    vpc_vr.destroy()
    ipsec_ops.delete_ipsec_connection(ipsec.uuid)
    test_util.test_pass('Create VPC Ipsec Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:26,代码来源:test_create_ipsec.py


示例15: test

def test():
    test_util.test_dsc('Test update instance offering')

    cond = res_ops.gen_query_conditions('state', '=', 'Enabled')
    cond = res_ops.gen_query_conditions('status', '=', 'Connected', cond)
    host = res_ops.query_resource_with_num(res_ops.HOST, cond, limit = 1)
    if not host:
        test_util.test_skip('No Enabled/Connected host was found, skip test.' )
        return True

    host_uuid = host[0].uuid
    new_offering = test_lib.lib_create_instance_offering(cpuNum = 1, \
            cpuSpeed = 16, memorySize = 536870912, name = 'orgin_instance_name')

    test_obj_dict.add_instance_offering(new_offering)

    vm = test_stub.create_vm(vm_name = 'test_update_instance_offering', \
            host_uuid = host_uuid, \
            instance_offering_uuid = new_offering.uuid)
    test_obj_dict.add_vm(vm)

    vm.stop()

    #These parameters are need to be populated.
    updated_offering = test_lib.lib_update_instance_offering(new_offering.uuid, cpuNum = 2, cpuSpeed = 16, \
        memorySize = 1073741824, name = 'updated_instance_name', \
        volume_iops = None, volume_bandwidth = None, \
        net_outbound_bandwidth = None, net_inbound_bandwidth = None)

    vm.start()
    vm.check()

    test_lib.lib_robot_cleanup(test_obj_dict)
    test_util.test_pass('Test updated instance offering Pass')
开发者ID:mrwangxc,项目名称:zstack-woodpecker,代码行数:34,代码来源:test_update_offering.py


示例16: test

def test():
    test_util.test_logger("start dhcp test for l3 public network")

    test_util.test_dsc("get no vlan network uuid")
    private_network = test_stub_dhcp.Private_IP_For_Dhcp()
    private_network.set_l2_query_resource(l2_query_resource)
    private_network.set_l2_type(type_l2[1])
    l2_no_vlan_uuid = private_network.get_l2uuid()
    test_util.test_logger("antony @@@debug : %s" % (l2_no_vlan_uuid))

    test_util.test_logger("create l3 network")
    private_network.set_ipVersion(ip_Version[0])
    private_network.create_l3uuid(l3_name)
    test_util.test_logger(
        "antony @@@debug : %s" %
        (private_network.get_l3uuid()))
    private_network.add_service_to_l3network()

    test_util.test_logger("add ip v4 range to l3 network")
    private_network.add_ip_by_networkcidr(
        ip_range_name,
        networkcidr,
        dhcp_system_tags)
    if private_network.check_dhcp_ipaddress().find(dhcp_ip_for_private) == -1:
        test_util.test_fail("dhcp server ip create fail")
    test_util.test_logger("delete l3 network")
    private_network.del_l3uuid()
    test_util.test_pass("dhcp server ip create successfully")
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:28,代码来源:test_dhcp_for_private_cidr.py


示例17: input

 def input(self, label, content):
     css_selector = 'label[for="%s"]' % label
     selection_rendered = 'ant-select-selection__rendered'
     def select_opt(elem, opt_value):
         elem.get_element(selection_rendered).click()
         for opt in self.get_elements('li[role="option"]'):
             if opt.displayed() and opt_value in opt.text:
                 opt.click()
     def input_content(elem, content):
         element = elem.get_element('input', 'tag name')
         element.input(content)
     title = None
     for elem in self.get_elements('ant-row ant-form-item'):
         title_elem = elem.get_elements(css_selector)
         if title_elem:
             title = title_elem[0].text.encode('utf-8')
             break
     if isinstance(content, types.ListType):
         input_content(elem, content[0])
         select_opt(elem, content[1])
     else:
         if elem.get_elements(selection_rendered):
             select_opt(elem, content)
         else:
             test_util.test_dsc('input [%s] for [%s]' % (content, title))
             input_content(elem, content)
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:26,代码来源:e2e_lib.py


示例18: test

def test():
    global default_l3_mtu
    test_util.test_dsc('Create test vm and check. VR has DNS SNAT EIP PF and DHCP services')
    l3_name = os.environ.get('l3PublicNetworkName')
    l3_net_uuid = test_lib.lib_get_l3_by_name(l3_name).uuid
    default_l3_mtu = net_ops.get_l3_mtu(l3_net_uuid)
    vm = test_stub.create_vlan_vm(l3_name)
    test_obj_dict.add_vm(vm)
    vm.check()
    script_file = tempfile.NamedTemporaryFile(delete=False)
    script_file.write('tracepath -n yyk.net | tail -1 | grep "pmtu %s"' % (default_l3_mtu))
    script_file.close()
    if not test_lib.lib_execute_shell_script_in_vm(vm.get_vm(), script_file.name):
        test_util.test_fail("fail to check mtu in [vm:] %s" % (vm.get_vm().uuid))
    os.unlink(script_file.name)

    net_ops.set_l3_mtu(l3_net_uuid, 1200)
    vm.reboot()
    vm.check()
    
    script_file = tempfile.NamedTemporaryFile(delete=False)
    script_file.write('tracepath -n yyk.net | tail -1 | grep "pmtu 1200"')
    script_file.close()
    if not test_lib.lib_execute_shell_script_in_vm(vm.get_vm(), script_file.name):
        test_util.test_fail("fail to check mtu in [vm:] %s" % (vm.get_vm().uuid))
    os.unlink(script_file.name)

    vm.destroy()
    test_util.test_pass('Create VirtualRouter VM DNS DHCP SANT EIP PF Test Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:29,代码来源:test_update_l3_mtu.py


示例19: test

def test():
    global vm
    test_util.test_dsc('create VM with setting password')

    for root_password in root_password_list:
        test_util.test_dsc("root_password: \"%s\"" %(root_password))
        vm = test_stub.create_vm(vm_name = 'u13-vm', image_name = "imageName_i_u13", root_password=root_password)
        backup_storage_list = test_lib.lib_get_backup_storage_list_by_vm(vm.vm)
        for bs in backup_storage_list:
            if bs.type == inventory.IMAGE_STORE_BACKUP_STORAGE_TYPE:
                break
            if bs.type == inventory.SFTP_BACKUP_STORAGE_TYPE:
                break
            if bs.type == inventory.CEPH_BACKUP_STORAGE_TYPE:
                break
        else:
            vm.destroy()
            test_util.test_skip('Not find image store type backup storage.')

        if not test_lib.lib_check_login_in_vm(vm.get_vm(), "root", root_password):
            test_util.test_fail("create vm with root password: %s failed", root_password)

        vm.destroy()
        vm.check()

        vm.expunge()
        vm.check()

    test_util.test_pass('Set password when VM is creating is successful.')
开发者ID:mrwangxc,项目名称:zstack-woodpecker,代码行数:29,代码来源:test_crt_vm_passwd_u13.py


示例20: test

def test():
    test_util.test_dsc('Test VM online change instance offering')

    cpuNum = 1
    memorySize = 555 * 1024 * 1024
    new_offering = test_lib.lib_create_instance_offering(cpuNum = cpuNum,\
            memorySize = memorySize)

    vm = test_stub.create_vm(vm_name = 'ckvmoffering-c7-64', image_name = "imageName_i_c7", instance_offering_uuid=new_offering.uuid)
    vm.check()
    test_obj_dict.add_vm(vm)
    test_obj_dict.add_instance_offering(new_offering)
    cpuNum = 1
    memorySize = 667 * 1024 * 1024
    new_offering = test_lib.lib_create_instance_offering(cpuNum = cpuNum,\
            memorySize = memorySize)

    test_obj_dict.add_instance_offering(new_offering)
    new_offering_uuid = new_offering.uuid
    vm.change_instance_offering(new_offering_uuid)
    vm.check()

    test_lib.lib_robot_cleanup(test_obj_dict)

    test_util.test_pass('VM online change instance offering Test Pass')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:25,代码来源:test_chg_instance_offering_memory_online.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python test_util.test_fail函数代码示例发布时间:2022-05-26
下一篇:
Python test_util.action_logger函数代码示例发布时间: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