Example #1
0
from TestData.VirtualMachine.ITC05010502_DelVm_WithoutDisk import disk_alias
from TestAPIs.StorageDomainAPIs import StorageDomainAPIs
from TestAPIs.VirtualMachineAPIs import VirtualMachineAPIs
'''
---------------------------------------------------------------------------------------------------
@note: ModuleTestData
---------------------------------------------------------------------------------------------------
'''

########################################################################
# 集群名称和两个主机id                                                                                                                                  
########################################################################
cluster_name = ModuleData.cluster_nfs_name
host1_name = ModuleData.host1_name
host2_name = ModuleData.host2_name
host1_id = HostAPIs().getHostIdByName(host1_name)
host2_id = HostAPIs().getHostIdByName(host2_name)


########################################################################
# 主机的gluster存储目录                                                                                                                       
########################################################################


dir_list = ['/storage/d1','/storage/dd2','/storage/d3','/storage/d4']
'''
---------------------------------------------------------------------------------------------------
@note: Test-Data
----
-----------------------------------------------------------------------------------------------
'''
# V0.1           2014/10/17          初始版本                                                            Liu Fei 
#---------------------------------------------------------------------------------
'''

from Configs.GlobalConfig import IsoStorages
from TestData.StorageDomain import ITC04_SetUp as ModuleData
from TestAPIs.HostAPIs import HostAPIs
'''
-------------------------------------------------------------------------------------------------
@note: Pre-Test-Data
-------------------------------------------------------------------------------------------------
'''
iso = IsoStorages['ISO-Storage2']
iso_ip = iso['ip']
iso_path = iso['path']
host_id = HostAPIs().getHostIdByName(ModuleData.host1_name)
iso_name = 'iso1-ITC04010701'
xml_iso_info = '''
    <storage_domain>
        <name>%s</name>
        <type>iso</type>
        <host id="%s"/>
        <storage>
            <type>nfs</type>
            <address>%s</address>
            <path>%s</path>
        </storage>
    </storage_domain>
''' % (iso_name, host_id, iso_ip, iso_path)
xml_destroy_iso_option = '''
<storage_domain>
@note: Test-Data
-------------------------------------------------------------------------------------------------
'''
data1_name = ModuleData.data1_nfs_name
data1_info_xml = '''
<storage_domain>
    <name>%s</name>
    <type>data</type>
    <host id="%s"/>
    <storage>
        <type>nfs</type>
        <address>%s</address>
        <path>%s</path>
    </storage>
</storage_domain>
''' % (data1_name, HostAPIs().getHostIdByName(ModuleData.host1_name), data1_ip, data1_path)

'''
-------------------------------------------------------------------------------------------------
@note: Post-Test-Data
-------------------------------------------------------------------------------------------------
'''


'''
-------------------------------------------------------------------------------------------------
@note: ExpectedResult
-------------------------------------------------------------------------------------------------
'''
expected_status_code_create_sd_dup_name = 409
expected_info_create_sd_dup_name = '''