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"), }) }
func TestBuilderAcc_basic(t *testing.T) { builderT.Test(t, builderT.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Builder: &Builder{}, Template: testBuilderAccBasic, }) }
func TestBuilderFileAcc_copy(t *testing.T) { builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: fileCopyTest, Check: checkCopy, }) }
func TestBuilderAcc_amiSharing(t *testing.T) { builderT.Test(t, builderT.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Builder: &Builder{}, Template: testBuilderAccSharing, Check: checkAMISharing(2, "932021504756", "all"), }) }
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"}), }) }
func TestBuilderAcc_encryptedBoot(t *testing.T) { builderT.Test(t, builderT.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Builder: &Builder{}, Template: testBuilderAccEncrypted, Check: checkBootEncrypted(), }) }
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), }) }
func TestBuilderAcc_basic(t *testing.T) { builderT.Test(t, builderT.TestCase{ Builder: &Builder{}, Template: testBuilderAccBasic, }) }