Add acceptance test

main
William Beuil 2021-01-04 15:51:22 +01:00
parent 98d1021505
commit 1bde15eb6c
No known key found for this signature in database
GPG Key ID: BED2072C5C2BF537
3 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,26 @@
package aws_test
import (
"testing"
"github.com/cloudskiff/driftctl/test/acceptance"
)
func TestAcc_AwsRoute53Record_WithFQDNAsId(t *testing.T) {
acceptance.Run(t, acceptance.AccTestCase{
Path: "./testdata/acc/aws_route53_record",
Args: []string{"scan", "--filter", "Type=='aws_route53_record'"},
Checks: []acceptance.AccCheck{
{
Check: func(result *acceptance.ScanResult, stdout string, err error) {
if err != nil {
t.Fatal(err)
}
result.AssertDriftCountTotal(0)
result.Equal(0, result.Summary().TotalDeleted)
result.Equal(4, result.Summary().TotalManaged)
},
},
},
})
}

View File

@ -0,0 +1,10 @@
provider "aws" {
region = "eu-west-3"
}
terraform {
required_providers {
aws = {
version = "~> 3.19.0"
}
}
}

View File

@ -0,0 +1,35 @@
resource "aws_route53_zone" "foo-zone" {
name = "foo-2.com"
}
resource "aws_route53_record" "foo-record" {
zone_id = aws_route53_zone.foo-zone.zone_id
name = "test0"
type = "TXT"
ttl = 300
records = ["test0"]
}
resource "aws_route53_record" "foo-record-2" {
zone_id = aws_route53_zone.foo-zone.zone_id
name = "test1.foo-2.com"
type = "TXT"
ttl = 300
records = ["test1.foo-2.com"]
}
resource "aws_route53_record" "foo-record-bis-3" {
zone_id = aws_route53_zone.foo-zone.zone_id
name = "_test2.foo-2.com"
type = "TXT"
ttl = 300
records = ["_test2.foo-2.com"]
}
resource "aws_route53_record" "foo-record-bis-4" {
zone_id = aws_route53_zone.foo-zone.zone_id
name = "test3."
type = "TXT"
ttl = 300
records = ["test3."]
}