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


Golang test_helpers.WaitForVirtualGuestToHaveNoActiveTransactions函數代碼示例

本文整理匯總了Golang中github.com/maximilien/softlayer-go/test_helpers.WaitForVirtualGuestToHaveNoActiveTransactions函數的典型用法代碼示例。如果您正苦於以下問題:Golang WaitForVirtualGuestToHaveNoActiveTransactions函數的具體用法?Golang WaitForVirtualGuestToHaveNoActiveTransactions怎麽用?Golang WaitForVirtualGuestToHaveNoActiveTransactions使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: cleanUpTestResources

func cleanUpTestResources() {
	virtualGuestIds, err := testhelpers.FindAndDeleteTestVirtualGuests()
	Expect(err).ToNot(HaveOccurred())

	for _, vgId := range virtualGuestIds {
		testhelpers.WaitForVirtualGuestToHaveNoActiveTransactions(vgId)
	}

	err = testhelpers.FindAndDeleteTestSshKeys()
	Expect(err).ToNot(HaveOccurred())
}
開發者ID:midoblgsm,項目名稱:softlayer-go,代碼行數:11,代碼來源:virtual_guest_lifecycle_suite_test.go

示例2:

		testhelpers.TIMEOUT = 35 * time.Minute
		testhelpers.POLLING_INTERVAL = 10 * time.Second
	})

	Context("set_vm_metadata", func() {
		BeforeEach(func() {
			err = testhelpers.FindAndDeleteTestSshKeys()
			Expect(err).ToNot(HaveOccurred())

			createdSshKey, _ = testhelpers.CreateTestSshKey()
			testhelpers.WaitForCreatedSshKeyToBePresent(createdSshKey.Id)

			virtualGuest = testhelpers.CreateVirtualGuestAndMarkItTest([]datatypes.SoftLayer_Security_Ssh_Key{createdSshKey})

			testhelpers.WaitForVirtualGuestToBeRunning(virtualGuest.Id)
			testhelpers.WaitForVirtualGuestToHaveNoActiveTransactions(virtualGuest.Id)

			pwd, err := os.Getwd()
			Expect(err).ToNot(HaveOccurred())
			rootTemplatePath = filepath.Join(pwd, "..", "..")

			strVGID = strconv.Itoa(virtualGuest.Id)

			replacementMap = map[string]string{
				"ID":             strVGID,
				"DirectorUuid":   "fake-director-uuid",
				"Tag_compiling":  "buildpack_python",
				"Tag_deployment": "metadata_deployment",
			}
		})
開發者ID:digideskweb,項目名稱:bosh-softlayer-cpi,代碼行數:30,代碼來源:set_vm_metadata_test.go

示例3:

		os.Setenv("SQLITE_DB_FOLDER", "/tmp")

		testhelpers.TIMEOUT = 35 * time.Minute
		testhelpers.POLLING_INTERVAL = 10 * time.Second

		pwd, err := os.Getwd()
		Expect(err).ToNot(HaveOccurred())
		rootTemplatePath = filepath.Join(pwd, "..", "..")

		tmpConfigPath, err = testhelperscpi.CreateTmpConfigPath(rootTemplatePath, configPath, username, apiKey)
		Expect(err).ToNot(HaveOccurred())

	})

	AfterEach(func() {
		testhelpers.WaitForVirtualGuestToHaveNoActiveTransactions(int(vmId))
		testhelpers.DeleteVirtualGuest(int(vmId))

		err = os.RemoveAll(tmpConfigPath)
		Expect(err).ToNot(HaveOccurred())

	})

	Context("True path of OS Reload", func() {

		BeforeEach(func() {
			os.Setenv("SQLITE_DB_FILE", "vm_pool.sqlite.right")
		})

		AfterEach(func() {
			err = os.Remove("/tmp/vm_pool.sqlite.right")
開發者ID:jianqiu,項目名稱:bosh-softlayer-cpi,代碼行數:31,代碼來源:os_reload_test.go


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