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


Golang testing.Test函數代碼示例

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


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

示例1: TestBuilderAcc_forceDeregister

func TestBuilderAcc_forceDeregister(t *testing.T) {
	// Build the same AMI name twice, with force_deregister on the second run
	builderT.Test(t, builderT.TestCase{
		PreCheck:             func() { testAccPreCheck(t) },
		Builder:              &Builder{},
		Template:             buildForceDeregisterConfig("false", "dereg"),
		SkipArtifactTeardown: true,
	})

	builderT.Test(t, builderT.TestCase{
		PreCheck: func() { testAccPreCheck(t) },
		Builder:  &Builder{},
		Template: buildForceDeregisterConfig("true", "dereg"),
	})
}
開發者ID:blairham,項目名稱:packer,代碼行數:15,代碼來源:builder_acc_test.go

示例2: TestBuilderAcc_basic

func TestBuilderAcc_basic(t *testing.T) {
	builderT.Test(t, builderT.TestCase{
		PreCheck: func() { testAccPreCheck(t) },
		Builder:  &Builder{},
		Template: testBuilderAccBasic,
	})
}
開發者ID:blairham,項目名稱:packer,代碼行數:7,代碼來源:builder_acc_test.go

示例3: TestBuilderFileAcc_copy

func TestBuilderFileAcc_copy(t *testing.T) {
	builderT.Test(t, builderT.TestCase{
		Builder:  &Builder{},
		Template: fileCopyTest,
		Check:    checkCopy,
	})
}
開發者ID:c12simple,項目名稱:packer,代碼行數:7,代碼來源:builder_test.go

示例4: TestBuilderAcc_amiSharing

func TestBuilderAcc_amiSharing(t *testing.T) {
	builderT.Test(t, builderT.TestCase{
		PreCheck: func() { testAccPreCheck(t) },
		Builder:  &Builder{},
		Template: testBuilderAccSharing,
		Check:    checkAMISharing(2, "932021504756", "all"),
	})
}
開發者ID:blairham,項目名稱:packer,代碼行數:8,代碼來源:builder_acc_test.go

示例5: TestBuilderAcc_regionCopy

func TestBuilderAcc_regionCopy(t *testing.T) {
	builderT.Test(t, builderT.TestCase{
		PreCheck: func() { testAccPreCheck(t) },
		Builder:  &Builder{},
		Template: testBuilderAccRegionCopy,
		Check:    checkRegionCopy([]string{"us-east-1", "us-west-2"}),
	})
}
開發者ID:blairham,項目名稱:packer,代碼行數:8,代碼來源:builder_acc_test.go

示例6: TestBuilderAcc_encryptedBoot

func TestBuilderAcc_encryptedBoot(t *testing.T) {
	builderT.Test(t, builderT.TestCase{
		PreCheck: func() { testAccPreCheck(t) },
		Builder:  &Builder{},
		Template: testBuilderAccEncrypted,
		Check:    checkBootEncrypted(),
	})
}
開發者ID:dave2,項目名稱:packer,代碼行數:8,代碼來源:builder_acc_test.go

示例7: TestBuilderAcc_forceDeleteSnapshot

func TestBuilderAcc_forceDeleteSnapshot(t *testing.T) {
	amiName := "packer-test-dereg"

	// Build the same AMI name twice, with force_delete_snapshot on the second run
	builderT.Test(t, builderT.TestCase{
		PreCheck:             func() { testAccPreCheck(t) },
		Builder:              &Builder{},
		Template:             buildForceDeleteSnapshotConfig("false", amiName),
		SkipArtifactTeardown: true,
	})

	// Get image data by AMI name
	ec2conn, _ := testEC2Conn()
	imageResp, _ := ec2conn.DescribeImages(
		&ec2.DescribeImagesInput{Filters: []*ec2.Filter{
			{
				Name:   aws.String("name"),
				Values: []*string{aws.String(amiName)},
			},
		}},
	)
	image := imageResp.Images[0]

	// Get snapshot ids for image
	snapshotIds := []*string{}
	for _, device := range image.BlockDeviceMappings {
		if device.Ebs != nil && device.Ebs.SnapshotId != nil {
			snapshotIds = append(snapshotIds, device.Ebs.SnapshotId)
		}
	}

	builderT.Test(t, builderT.TestCase{
		PreCheck: func() { testAccPreCheck(t) },
		Builder:  &Builder{},
		Template: buildForceDeleteSnapshotConfig("true", amiName),
		Check:    checkSnapshotsDeleted(snapshotIds),
	})
}
開發者ID:dave2,項目名稱:packer,代碼行數:38,代碼來源:builder_acc_test.go

示例8: TestBuilderAcc_basic

func TestBuilderAcc_basic(t *testing.T) {
	builderT.Test(t, builderT.TestCase{
		Builder:  &Builder{},
		Template: testBuilderAccBasic,
	})
}
開發者ID:c12simple,項目名稱:packer,代碼行數:6,代碼來源:builder_acc_test.go


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