當前位置: 首頁>>代碼示例>>Python>>正文


Python Iso.copy方法代碼示例

本文整理匯總了Python中marvin.lib.base.Iso.copy方法的典型用法代碼示例。如果您正苦於以下問題:Python Iso.copy方法的具體用法?Python Iso.copy怎麽用?Python Iso.copy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在marvin.lib.base.Iso的用法示例。


在下文中一共展示了Iso.copy方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_04_copy_iso

# 需要導入模塊: from marvin.lib.base import Iso [as 別名]
# 或者: from marvin.lib.base.Iso import copy [as 別名]
    def test_04_copy_iso(self):
        """
        @Desc: Test to copy ISO from one zone to another
        @steps:
        Step1: Listing Zones available for a user
        Step2: Verifying if the zones listed are greater than 1.
               If Yes continuing.
               If not halting the test.
        Step3: Listing all the ISO's for a user in zone1
        Step4: Verifying that no ISO's are listed
        Step5: Listing all the ISO's for a user in zone2
        Step6: Verifying that no ISO's are listed
        Step7: Creating an ISO in zone 1
        Step8: Listing all the ISO's again for a user in zone1
        Step9: Verifying that list size is 1
        Step10: Listing all the ISO's for a user in zone2
        Step11: Verifying that no ISO's are listed
        Step12: Copying the ISO created in step7 from zone1 to zone2
        Step13: Listing all the ISO's for a user in zone2
        Step14: Verifying that list size is 1
        Step15: Listing all the ISO's for a user in zone1
        Step16: Verifying that list size is 1
        """
        # Listing Zones available for a user
        zones_list = Zone.list(
                               self.userapiclient,
                               available=True
                               )
        status = validateList(zones_list)
        self.assertEquals(
                          PASS,
                          status[0],
                          "Failed to list Zones"
                          )
        if not len(zones_list) > 1:
            self.skipTest("Enough zones doesnot exists to copy iso")
        else:
            # Listing all the ISO's for a User in Zone 1
            list_isos_zone1 = Iso.list(
                                       self.userapiclient,
                                       listall=self.services["listall"],
                                       isofilter=self.services["templatefilter"],
                                       zoneid=zones_list[0].id
                                       )
            # Verifying that no ISO's are listed
            self.assertIsNone(
                              list_isos_zone1,
                              "ISO's listed for newly created User in Zone1"
                              )
            # Listing all the ISO's for a User in Zone 2
            list_isos_zone2 = Iso.list(
                                       self.userapiclient,
                                       listall=self.services["listall"],
                                       isofilter=self.services["templatefilter"],
                                       zoneid=zones_list[1].id
                                       )
            # Verifying that no ISO's are listed
            self.assertIsNone(
                              list_isos_zone2,
                              "ISO's listed for newly created User in Zone2"
                              )
            self.services["iso"]["zoneid"] = zones_list[0].id
            # Creating an ISO in Zone 1
            iso_created = Iso.create(
                                     self.userapiclient,
                                     self.services["iso"]
                                     )
            self.assertIsNotNone(
                                 iso_created,
                                 "ISO creation failed"
                                 )
            self.cleanup.append(iso_created)
            # Listing all the ISO's for a User in Zone 1
            list_isos_zone1 = Iso.list(
                                       self.userapiclient,
                                       listall=self.services["listall"],
                                       isofilter=self.services["templatefilter"],
                                       zoneid=zones_list[0].id
                                       )
            status = validateList(list_isos_zone1)
            self.assertEquals(
                              PASS,
                              status[0],
                              "ISO creation failed in Zone1"
                              )
            # Verifying that list size is 1
            self.assertEquals(
                              1,
                              len(list_isos_zone1),
                              "Failed to create a Template"
                              )
            # Listing all the ISO's for a User in Zone 2
            list_isos_zone2 = Iso.list(
                                       self.userapiclient,
                                       listall=self.services["listall"],
                                       isofilter=self.services["templatefilter"],
                                       zoneid=zones_list[1].id
                                       )
            # Verifying that no ISO's are listed
            self.assertIsNone(
#.........這裏部分代碼省略.........
開發者ID:fengyueyugu,項目名稱:cloudstack,代碼行數:103,代碼來源:test_escalations_isos.py


注:本文中的marvin.lib.base.Iso.copy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。