当前位置: 首页>>代码示例>>Python>>正文


Python test_util.test_skip函数代码示例

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


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

示例1: test

def test():
    global test_obj_dict

    test_util.test_dsc('Create test vm and check')
    bs = res_ops.query_resource(res_ops.BACKUP_STORAGE)
    for i in bs:
        if i.type == 'AliyunEBS':
            test_util.test_skip('Skip test on AliyunEBS')
    vm1 = test_stub.create_vlan_vm()
    #Without this checking, the image (created later) might be not able to get a DHCP IP, when using to create a new vm. 
    vm1.check()
    test_obj_dict.add_vm(vm1)
    vm1.stop()

    image_creation_option = test_util.ImageOption()
    backup_storage_list = test_lib.lib_get_backup_storage_list_by_vm(vm1.vm)
    image_creation_option.set_backup_storage_uuid_list([backup_storage_list[0].uuid])
    image_creation_option.set_root_volume_uuid(vm1.vm.rootVolumeUuid)
    image_creation_option.set_name('test_create_image_template')

    image = test_image.ZstackTestImage()
    image.set_creation_option(image_creation_option)
    image.create()
    test_obj_dict.add_image(image)

    image.delete()
    image.check()

    test_util.test_pass('Delete Image Template Test Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:29,代码来源:test_del_temp_image.py

示例2: test

def test():
    if res_ops.query_resource(res_ops.SFTP_BACKUP_STORAGE):
        test_util.test_skip("sftp backupstorage doesn't support for clone test. Skip test")
    global vm
    vm_creation_option = test_util.VmOption()
    image_name = os.environ.get('imageName_net')
    l3_name = os.environ.get('l3VlanNetworkName1')
    vm = test_stub.create_vm("test_resize_vm", image_name, l3_name)
    test_obj_dict.add_vm(vm)
    vm.check()

    vol_size = test_lib.lib_get_root_volume(vm.get_vm()).size
    volume_uuid = test_lib.lib_get_root_volume(vm.get_vm()).uuid
    set_size = 1024*1024*1024*5
    vol_ops.resize_volume(volume_uuid, set_size)
    vm.update()
    vol_size_after = test_lib.lib_get_root_volume(vm.get_vm()).size
    if set_size != vol_size_after:
        test_util.test_fail('Resize Root Volume failed, size = %s' % vol_size_after)

    new_vm = vm.clone(['vm_clone'])[0]
    test_obj_dict.add_vm(new_vm)
    new_volume_uuid = test_lib.lib_get_root_volume_uuid(new_vm.get_vm())
    vol_size_after = test_lib.lib_get_root_volume(new_vm.get_vm()).size
    if set_size != vol_size_after:
        test_util.test_fail('Resize Root Volume failed, size = %s' % vol_size_after) 
    test_lib.lib_error_cleanup(test_obj_dict)
    test_util.test_pass('Resize VM Snapshot Test Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:28,代码来源:test_online_resize_vm_clone.py

示例3: test

def test():
    if "test-config-vpc-dns.xml" != os.path.basename(os.environ.get('WOODPECKER_TEST_CONFIG_FILE')).strip():
        test_util.test_skip('Skip test on test config except test-config-vpc-dns.xml')

    test_util.test_dsc("1. create vpc vrouter")
    vr = test_stub.create_vpc_vrouter(vpc_vr_name)
    vr_uuid = vr.inv.uuid

    vpc_l3_uuid = test_lib.lib_get_l3_by_name(vpc_l3_name).uuid

    test_util.test_dsc("2. attach vpc network to vpc router")
    test_stub.attach_l3_to_vpc_vr_by_uuid(vr, vpc_l3_uuid)

    test_util.test_dsc("3. disable and enable vpc snat service for 100 times")
    for i in range(1,100):
        vpc_ops.set_vpc_vrouter_network_service_state(vr_uuid, networkService='SNAT', state='disable')
        vpc_ops.set_vpc_vrouter_network_service_state(vr_uuid, networkService='SNAT', state='enable')

    serviceState = vpc_ops.get_vpc_vrouter_network_service_state(vr_uuid, networkService='SNAT')
    if serviceState.env.state != 'enable':
        test_util.test_fail("enable SNAT failed.")

    test_util.test_dsc("4. enable and disable vpc snat service for 100 times")
    for i in range(1,100):
        vpc_ops.set_vpc_vrouter_network_service_state(vr_uuid, networkService='SNAT', state='enable')
        vpc_ops.set_vpc_vrouter_network_service_state(vr_uuid, networkService='SNAT', state='disable')

    serviceState = vpc_ops.get_vpc_vrouter_network_service_state(vr_uuid, networkService='SNAT')
    if serviceState.env.state != 'disable':
        test_util.test_fail("disable SNAT failed.")
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:30,代码来源:disable_enable_vpc_snat_100times.py

示例4: test

def test():
    global test_obj_dict
    #volume_creation_option = test_util.VolumeOption()
    #test_util.test_dsc('Create volume and check')
    #disk_offering = test_lib.lib_get_disk_offering_by_name(os.environ.get('smallDiskOfferingName'))
    #volume_creation_option.set_disk_offering_uuid(disk_offering.uuid)
    #volume = test_stub.create_volume(volume_creation_option)

    bs_cond = res_ops.gen_query_conditions("status", '=', "Connected")
    bss = res_ops.query_resource_fields(res_ops.BACKUP_STORAGE, bs_cond, \
            None, fields=['uuid'])
    if not bss:
        test_util.test_skip("not find available backup storage. Skip test")

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

    test_util.test_dsc('Create vm and check')
    vm = test_stub.create_vr_vm('migrate_volume_vm', 'imageName_net', 'l3VlanNetwork2')
    test_obj_dict.add_vm(vm)
    vm.check()
    vm_uuid = vm.vm.uuid

    volume1.attach(vm)
    volume1.detach(vm_uuid)

    vm.stop()
    image_obj = volume1.create_template([bss[0].uuid])
    vm.start()
    host_uuid = vm.vm.hostUuid
    ps = test_lib.lib_get_primary_storage_by_uuid(vm.get_vm().allVolumes[0].primaryStorageUuid)
    volume2 = image_obj.create_data_volume(ps.uuid, 'volumeName', host_uuid)
    test_obj_dict.add_volume(volume2)
    volume2.check()
    volume_uuid = volume2.volume.uuid

    ps = test_lib.lib_get_primary_storage_by_uuid(vm.get_vm().allVolumes[0].primaryStorageUuid)
    if ps.type != inventory.LOCAL_STORAGE_TYPE:
        test_util.test_skip('Skip test on non-localstorage')

    snapshots = test_obj_dict.get_volume_snapshot(volume_uuid)
    snapshots.set_utility_vm(vm)
    snapshots.create_snapshot('create_snapshot1')
    snapshots.check()
    snapshots.create_snapshot('create_snapshot2')
    snapshots.check()

    target_host = test_lib.lib_find_random_host_by_volume_uuid(volume_uuid)
    target_host_uuid = target_host.uuid

    vol_ops.migrate_volume(volume_uuid, target_host_uuid)

    test_lib.lib_error_cleanup(test_obj_dict)
    test_util.test_pass('Cold migrate Data Volume from Template with Snapshot Test Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:60,代码来源:test_cold_migrate_data_volume_from_tmpt_with_sp.py

示例5: test

def test():
    imagestore_backup_storage = test_lib.lib_get_image_store_backup_storage()
    if not imagestore_backup_storage:
        test_util.test_skip('Not find image store type backup storage.')

    img_option = test_util.ImageOption()
    img_option.set_name('iso')
    root_disk_uuid = test_lib.lib_get_disk_offering_by_name(os.environ.get('rootDiskOfferingName')).uuid                       
    bs_uuid = imagestore_backup_storage.uuid          
    img_option.set_backup_storage_uuid_list([bs_uuid])
    command = "command -v genisoimage"
    result = test_lib.lib_execute_ssh_cmd(os.environ['ZSTACK_BUILT_IN_HTTP_SERVER_IP'], 'root', 'password', command)
    if not result:
        command = "yum -y install genisoimage --disablerepo=* --enablerepo=zstack-local"
        test_lib.lib_execute_ssh_cmd(os.environ['ZSTACK_BUILT_IN_HTTP_SERVER_IP'], 'root', 'password', command)
    command = "genisoimage -o %s/apache-tomcat/webapps/zstack/static/zstack-repo/7/x86_64/os/test.iso /tmp/" % os.environ.get('zstackInstallPath')
    test_lib.lib_execute_ssh_cmd(os.environ['ZSTACK_BUILT_IN_HTTP_SERVER_IP'], 'root', 'password', command)
    img_option.set_url('http://%s:8080/zstack/static/zstack-repo/7/x86_64/os/test.iso' % (os.environ['ZSTACK_BUILT_IN_HTTP_SERVER_IP']))
    image_inv = img_ops.add_iso_template(img_option)
    image = test_image.ZstackTestImage()
    image.set_image(image_inv)
    image.set_creation_option(img_option)

    test_obj_dict.add_image(image)
    image_url = image.export()
    image.delete_exported_image()
    test_lib.lib_robot_cleanup(test_obj_dict)
    if image_url.endswith('.iso'): 
        test_util.test_pass('Export ISO Image Test Success')
    else:
        test_util.test_fail('Export ISO Image Test Fail, exported ISO image ends with %s' % (image_url.split('.')[-1]))
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:31,代码来源:test_export_iso.py

示例6: 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

示例7: test

def test():
    #skip ceph in c74
    cmd = "cat /etc/redhat-release | grep '7.4'"
    mn_ip = res_ops.query_resource(res_ops.MANAGEMENT_NODE)[0].hostName
    rsp = test_lib.lib_execute_ssh_cmd(mn_ip, 'root', 'password', cmd, 180)
    if rsp != False:
        ps = res_ops.query_resource(res_ops.PRIMARY_STORAGE)
        for i in ps:
            if i.type == 'Ceph':
                test_util.test_skip('cannot hotplug iso to the vm in ceph,it is a libvirt bug:https://bugzilla.redhat.com/show_bug.cgi?id=1541702.')

    multi_iso.add_iso_image()
    multi_iso.create_windows_vm()
    test_obj_dict.add_vm(multi_iso.vm1)

    multi_iso.get_all_iso_uuids()
    multi_iso.attach_iso(multi_iso.iso_uuids[0])
    multi_iso.attach_iso(multi_iso.iso_uuids[1])
    multi_iso.attach_iso(multi_iso.iso_uuids[2])
    multi_iso.check_windows_vm_cdrom(3)

    multi_iso.detach_iso(multi_iso.iso_uuids[1])
    multi_iso.check_windows_vm_cdrom(2)
#     multi_iso.vm1.reboot()
    multi_iso.detach_iso(multi_iso.iso_uuids[0])
    multi_iso.check_windows_vm_cdrom(1)
    multi_iso.detach_iso(multi_iso.iso_uuids[2])
    multi_iso.check_windows_vm_cdrom(0)

    test_lib.lib_robot_cleanup(test_obj_dict)
    test_util.test_pass('Attach 3 ISO Test Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:31,代码来源:test_attach_3_iso_windows.py

示例8: test

def test():
    if "test-config-vpc-dns.xml" != os.path.basename(os.environ.get('WOODPECKER_TEST_CONFIG_FILE')).strip():
        test_util.test_skip('Skip test on test config except test-config-vpc-dns.xml')

    test_util.test_dsc("1. create vpc vrouter")
    vr = test_stub.create_vpc_vrouter(vpc_vr_name)
    vr_uuid = vr.inv.uuid

    vpc_l3_uuid = test_lib.lib_get_l3_by_name(vpc_l3_name).uuid

    test_util.test_dsc("2. attach vpc network to vpc router")
    test_stub.attach_l3_to_vpc_vr_by_uuid(vr, vpc_l3_uuid)

    test_util.test_dsc("3. add dns to vpc network and vpc router")
    for dns in l3_dns_list:
        vpcdns_ops.add_dns_to_l3_network(vpc_l3_uuid, dns)

    vpcdns_ops.add_dns_to_vpc_router(vr_uuid, default_dns)

    test_util.test_dsc("4. get vpc dns list and check")
    vpc_dns_info = test_stub.query_vpc_vrouter(vpc_vr_name).inv.dns
    for vpc_dns in vpc_dns_info:
        vpc_dns_list_end.append(vpc_dns['dns'])

    if vpc_dns_list_end != vpc_dns_list_begin:
        test_util.test_fail("add dns to vpc network take effect on vpc router, not expected.")
    else:
        for dns in l3_dns_list:
            vpcdns_ops.remove_dns_from_l3_network(vpc_l3_uuid, dns)
        test_util.test_pass("add dns to vpc network take no effect on vpc router, expected result.")
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:30,代码来源:add_dns_to_vpc_network.py

示例9: test

def test():
    global test_obj_dict
    global ps_uuid
    global host_uuid
    global vr_uuid
    allow_ps_list = [inventory.CEPH_PRIMARY_STORAGE_TYPE, "SharedBlock"]
    test_lib.skip_test_when_ps_type_not_in_list(allow_ps_list)

    test_util.test_dsc('Create test vm and check')

    bs_cond = res_ops.gen_query_conditions("status", '=', "Connected")
    bss = res_ops.query_resource_fields(res_ops.BACKUP_STORAGE, bs_cond, \
            None)
    if not bss:
        test_util.test_skip("not find available backup storage. Skip test")

    test_lib.lib_set_delete_policy('vm', 'Delay')
    test_lib.lib_set_delete_policy('volume', 'Delay')
    l3_1_name = os.environ.get('l3VlanNetworkName1')
    vm = test_stub.create_vlan_vm(l3_name=l3_1_name)
    l3_1 = test_lib.lib_get_l3_by_name(l3_1_name)
    vr = test_lib.lib_find_vr_by_l3_uuid(l3_1.uuid)[0]
    vr_uuid = vr.uuid
    
    host = test_lib.lib_get_vm_host(vm.get_vm())
    host_uuid = host.uuid
    test_obj_dict.add_vm(vm)
    vm.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)
    volume_creation_option.set_system_tags(['ephemeral::shareable', 'capability::virtio-scsi'])
    volume = test_stub.create_volume(volume_creation_option)
    test_obj_dict.add_volume(volume)
    volume.check()
    volume.attach(vm)

    #ps = test_lib.lib_get_primary_storage_by_vm(vm.get_vm())
    #ps_uuid = ps.uuid
    #ps_ops.change_primary_storage_state(ps_uuid, 'disable')
    test_stub.disable_all_pss()
    if not test_lib.lib_wait_target_up(vm.get_vm().vmNics[0].ip, '22', 90):
        test_util.test_fail('VM is expected to running when PS change to disable state')

    vm.set_state(vm_header.RUNNING)
    vm.check()
    volume.delete()
    volume.check()
    volume.expunge()
    volume.check()

    #ps_ops.change_primary_storage_state(ps_uuid, 'enable')
    test_stub.enable_all_pss()
    host_ops.reconnect_host(host_uuid)
    vm_ops.reconnect_vr(vr_uuid)
    vm.destroy()
    test_lib.lib_set_delete_policy('vm', 'Direct')
    test_lib.lib_set_delete_policy('volume', 'Direct')
    test_util.test_pass('Delete volume under PS disable mode Test Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:60,代码来源:test_disable_ps_expunge_attached_share_vol.py

示例10: test

def test():
    global vm, host3_uuid

    if test_lib.lib_get_ha_enable() != 'true':
        test_util.test_skip("vm ha not enabled. Skip test")

    conf_ops.change_global_config('ha', 'allow.slibing.cross.clusters', 'true')

    vm_creation_option = test_util.VmOption()
    image_name = os.environ.get('imageName_s')
    image_uuid = test_lib.lib_get_image_by_name(image_name).uuid
    #l3_name = os.environ.get('l3NoVlanNetworkName1')
    #l3_name = os.environ.get('l3VlanNetworkName1')
    l3_name = os.environ.get('l3PublicNetworkName')
    host3_name = os.environ.get('hostName3')
    host4_name = os.environ.get('hostName4')

    conditions1 = res_ops.gen_query_conditions('name', '=', host3_name)
    host3_uuid = res_ops.query_resource(res_ops.HOST, conditions1)[0].uuid
    host3_ip = res_ops.query_resource(res_ops.HOST, conditions1)[0].managementIp

    conditions2 = res_ops.gen_query_conditions('name', '=', host4_name)
    host4_uuid = res_ops.query_resource(res_ops.HOST, conditions2)[0].uuid
    host4_ip = res_ops.query_resource(res_ops.HOST, conditions2)[0].managementIp

    l3_net_uuid = test_lib.lib_get_l3_by_name(l3_name).uuid
    conditions = res_ops.gen_query_conditions('type', '=', 'UserVm')
    instance_offering_uuid = res_ops.query_resource(res_ops.INSTANCE_OFFERING, conditions)[0].uuid
    vm_creation_option.set_l3_uuids([l3_net_uuid])
    vm_creation_option.set_image_uuid(image_uuid)
    vm_creation_option.set_instance_offering_uuid(instance_offering_uuid)
    vm_creation_option.set_name('multihost_basic_vm')
    vm_creation_option.set_host_uuid(host3_uuid)
    vm = test_vm_header.ZstackTestVm()
    vm.set_creation_option(vm_creation_option)
    vm.create()
    time.sleep(30)
    ha_ops.set_vm_instance_ha_level(vm.get_vm().uuid, "NeverStop")
    time.sleep(5)
    vm.check()
    
    ssh_cmd1 = 'ssh  -oStrictHostKeyChecking=no -oCheckHostIP=no -oUserKnownHostsFile=/dev/null %s' % host3_ip    
    cmd = '%s "poweroff" ' % ssh_cmd1
    process_result = test_stub.execute_shell_in_process(cmd, tmp_file)
        
    time.sleep(360)
    host3_status = res_ops.query_resource(res_ops.HOST, conditions1)[0].status    
    if host3_status == "Disconnected":
        conditions3 = res_ops.gen_query_conditions('uuid', '=', vm.vm.uuid)
        vm_status = res_ops.query_resource(res_ops.VM_INSTANCE, conditions3)[0].state
        vm_host_uuid = res_ops.query_resource(res_ops.VM_INSTANCE, conditions3)[0].hostUuid
        if vm_status != "Running" or vm_host_uuid != host4_uuid:         
            test_util.test_fail('Test fail vm status: %s, vm_host_uuid: %s,' %(vm_status, vm_host_uuid))
    vm.destroy()
    conf_ops.change_global_config('ha', 'allow.slibing.cross.clusters', 'false')

    conditions4 = res_ops.gen_query_conditions('vmNics.ip', '=', host3_ip)
    vm3_uuid = sce_ops.query_resource(zstack_management_ip, res_ops.VM_INSTANCE, conditions4).inventories[0].uuid
    sce_ops.start_vm(zstack_management_ip, vm3_uuid)
    test_util.test_pass('VM auto ha across cluster Test Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:60,代码来源:test_ha_vm_auto_across_cluster_migration.py

示例11: test

def test():
    flavor = case_flavor[os.environ.get('CASE_FLAVOR')]
    global agent_url
    global image

    agent_url = flavor['agent_url']
    agent_action = flavor['agent_action']
    if agent_action == 1:
        agent_time = (24*60*60-60)*1000
    elif agent_action == 2:
        agent_time = 360 * 1000

    image_uuid = str(uuid.uuid4()).replace('-', '')
    rsp = dep_ops.json_post("http://127.0.0.1:8888/test/api/v1.0/store/create", simplejson.dumps({"key": image_uuid, "value": '{"%s":%s}' % (agent_url, agent_action)}))
    image_creation_option = test_util.ImageOption()
    imagestore = test_lib.lib_get_image_store_backup_storage()
    if imagestore == None:
        test_util.test_skip('Required imagestore to test')
    bs_uuid = imagestore.uuid

    image_option = test_util.ImageOption()
    image_option.set_uuid(image_uuid)
    image_option.set_name('fake_image')
    image_option.set_description('fake image')
    image_option.set_format('raw')
    image_option.set_mediaType('RootVolumeTemplate')
    image_option.set_backup_storage_uuid_list([bs_uuid])
    image_option.url = "http://fake/fake.raw"
    image_option.set_timeout(24*60*60*1000)

    start = time.time()
    image = img_ops.add_image(image_option)
    end = time.time()
    if end - start < agent_time / 2 / 1000:
        test_util.test_fail('execution time too short %s' % (end - start))
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:35,代码来源:test_imagestore_add_image.py

示例12: test

def test():
    global agent_url
    global vm
    imagestore = test_lib.lib_get_image_store_backup_storage()
    if imagestore == None:
        test_util.test_skip('Required imagestore to test')
    image_uuid = test_stub.get_image_by_bs(imagestore.uuid)
    cond = res_ops.gen_query_conditions('type', '=', 'SharedMountPoint')
    pss = res_ops.query_resource(res_ops.PRIMARY_STORAGE, cond)

    if len(pss) == 0:
        test_util.test_skip('Required %s ps to test' % (ps_type))
    ps_uuid = pss[0].uuid
    vm = test_stub.create_vm(image_uuid=image_uuid, ps_uuid=ps_uuid)


    vm.stop()
    ha_ops.set_vm_instance_ha_level(vm.get_vm().uuid,'NeverStop')
    cond = res_ops.gen_query_conditions('uuid', '=', vm.get_vm().uuid)
    for i in range(5):
        time.sleep(1)
        try:
            if res_ops.query_resource(res_ops.VM_INSTANCE, cond)[0].state == vm_header.RUNNING:
                break
        except:
            test_util.test_logger('Retry until VM change to running')

    if res_ops.query_resource(res_ops.VM_INSTANCE, cond)[0].state == vm_header.RUNNING:
        test_util.test_pass('set HA after stopped VM test pass')
    
    test_util.test_fail('set HA after stopped VM test fail')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:31,代码来源:test_set_ha_for_stopped_vm.py

示例13: 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('l3VlanNetworkName1')
    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)
    vrs = test_lib.lib_find_vr_by_vm(vm.vm)
    for vr in vrs:
        if vr.applianceVmType != "vrouter":
            test_util.test_skip("Skip l3 mtu test for non vrouter")

    vm.check()
    if not test_lib.lib_execute_command_in_vm(vm.get_vm(), 'tracepath -n yyk.net | tail -1 | grep "pmtu %s"' % (default_l3_mtu)):
        test_util.test_fail("fail to check mtu in [vm:] %s" % (vm.get_vm().uuid))

    net_ops.set_l3_mtu(l3_net_uuid, 1200)
    vm.reboot()
    vm.check()
    if not test_lib.lib_execute_command_in_vm(vm.get_vm(), 'tracepath -n yyk.net | tail -1 | grep "pmtu 1200"'):
        test_util.test_fail("fail to check mtu in [vm:] %s" % (vm.get_vm().uuid))

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

示例14: test

def test():
    ps_inv = res_ops.query_resource(res_ops.PRIMARY_STORAGE)
    sblk_ps = [ps for ps in ps_inv if ps.type == 'SharedBlock']
    if not sblk_ps:
        test_util.test_skip('Skip test as there is not SharedBlock primary storage')
    flavor = case_flavor[os.getenv('CASE_FLAVOR')]
    if flavor['with_vm']:
        multi_ps.create_vm(ps_type='SharedBlock', with_data_vol=True, one_volume=True)
    else:
        multi_ps.create_vm(ps_type='SharedBlock')
    if flavor['shared']:
        if flavor['ps2_vm']:
            multi_ps.create_vm(except_ps_type='SharedBlock')
        else:
            multi_ps.create_vm(ps_type='SharedBlock')
        multi_ps.create_data_volume(shared=True, vms=multi_ps.vm, except_ps_type='SharedBlock')
    else:
        if not flavor['with_vm']:
            multi_ps.create_data_volume(vms=multi_ps.vm, except_ps_type='SharedBlock')

    if flavor['shared']:
        for data_volume in multi_ps.data_volume.values():
            for vm in multi_ps.vm:
                data_volume.detach(vm.get_vm().uuid)
        if flavor['ps2_vm']:
            multi_ps.migrate_vm()
        else:
            multi_ps.migrate_vm(multi_ps.vm)
        for data_volume in multi_ps.data_volume.values():
            for vm in multi_ps.vm:
                data_volume.attach(vm)
    else:
        multi_ps.migrate_vm()

    test_util.test_pass('SAN VM PS Migration with other PS Volume Test Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:35,代码来源:test_san_vm_migration_other_ps_volume.py

示例15: test

def test():
    test_util.test_dsc("create vr vm and vpc vrouter")
    vm = test_stub.create_vr_vm('vr_vm','imageName_s','l3NoVlanNetworkName2')
    test_obj_dict.add_vm(vm)

    if not test_lib.lib_find_vr_by_vm(vm.vm) or not test_lib.lib_find_vr_by_vm(vm.vm)[0]:
        test_lib.lib_error_cleanup(test_obj_dict)
        test_util.test_skip("skip the test for no vr found in the env.")
    vpc_vr = test_stub.create_vpc_vrouter()
    check_host_prometheus_conf()
    check_vrouter_prometheus_conf()
    check_prometheus_data()
    hosts = test_lib.lib_get_all_hosts_from_plan()
    
    for host in hosts:
        host_ops.reconnect_host(host_uuid)
    check_host_prometheus_conf()
    check_vrouter_prometheus_conf()
    check_prometheus_data()

    test_lib.lib_execute_ssh_cmd(mn_ip,"root","password","zstack-ctl restart_node",timeout=300)
    check_host_prometheus_conf()
    check_vrouter_prometheus_conf()
    check_prometheus_data()

    test_lib.lib_error_cleanup(test_obj_dict)
    test_util.test_pass('Test prometheus Success')
开发者ID:zstackorg,项目名称:zstack-woodpecker,代码行数:27,代码来源:test_prometheus.py


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