From 9c8edccec3c6cf7d137072ec29d7aedfb2af3efb Mon Sep 17 00:00:00 2001 From: Katy Moe Date: Tue, 2 Feb 2021 18:40:58 +0000 Subject: [PATCH] test --- .github/workflows/test.yml | 49 +++++++++++++++++---------------- internal/provider/acceptance.sh | 4 +-- internal/provider/provider.go | 7 +++++ 3 files changed, 34 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f55b869..ba7dbd65 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,38 +13,38 @@ on: - 'CHANGELOG.md' - 'website/*' jobs: - build: - name: Build - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: + # build: + # name: Build + # runs-on: ubuntu-latest + # timeout-minutes: 5 + # steps: - - name: Set up Go - uses: actions/setup-go@v2.1.3 - with: - go-version: '1.15' - id: go + # - name: Set up Go + # uses: actions/setup-go@v2.1.3 + # with: + # go-version: '1.15' + # id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v2.3.3 + # - name: Check out code into the Go module directory + # uses: actions/checkout@v2.3.3 - - name: Go fmt - run: | - make fmt + # - name: Go fmt + # run: | + # make fmt - - name: Go vet - run: | - make vet + # - name: Go vet + # run: | + # make vet - - name: Build - run: | - go build -v . + # - name: Build + # run: | + # go build -v . # run acceptance tests in a matrix with Terraform core versions test: name: Matrix Test - needs: build + # needs: build runs-on: ubuntu-latest timeout-minutes: 15 strategy: @@ -52,8 +52,9 @@ jobs: matrix: terraform: - '0.12.30' - - '0.13.6' - - '0.14.5' + # - '0.13.6' + # - '0.14.5' + steps: - name: Set up Go diff --git a/internal/provider/acceptance.sh b/internal/provider/acceptance.sh index 761cd3be..1fe46d44 100755 --- a/internal/provider/acceptance.sh +++ b/internal/provider/acceptance.sh @@ -27,7 +27,7 @@ docker run -d -p "$DNS_UPDATE_PORT:53/udp" \ -e BIND_DOMAIN_REVERSE=${DNS_DOMAIN_REVERSE} \ -e BIND_INSECURE=true \ --name "$DOCKER_CONTAINER_NAME" drebes/bind || failed -GO111MODULE=on GOFLAGS=-mod=vendor make testacc TEST=./internal/provider || failed +GO111MODULE=on GOFLAGS=-mod=vendor TESTARGS=-run=TestAccDataDnsSRVRecordSet make testacc TEST=./internal/provider || failed cleanup_docker # Run with authentication @@ -43,5 +43,5 @@ docker run -d -p "$DNS_UPDATE_PORT:53/udp" \ -e BIND_KEY_ALGORITHM=${DNS_UPDATE_KEYALGORITHM} \ -e BIND_KEY_SECRET=${DNS_UPDATE_KEYSECRET} \ --name "$DOCKER_CONTAINER_NAME" drebes/bind || failed -GO111MODULE=on GOFLAGS=-mod=vendor make testacc TEST=./internal/provider || failed +GO111MODULE=on GOFLAGS=-mod=vendor TESTARGS=-run=TestAccDataDnsSRVRecordSet make testacc TEST=./internal/provider || failed cleanup_docker diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 65eb2935..cca1c8b4 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -470,6 +470,9 @@ func resourceDnsRead(d *schema.ResourceData, meta interface{}, rrType uint16) ([ msg := new(dns.Msg) msg.SetQuestion(fqdn, rrType) + fmt.Println("EXCHANGING DNS MESSAGE:") + fmt.Println(msg) + r, err := exchange(msg, true, meta) if err != nil { return nil, fmt.Errorf("Error querying DNS record: %s", err) @@ -490,6 +493,10 @@ func resourceDnsRead(d *schema.ResourceData, meta interface{}, rrType uint16) ([ if rrType == dns.TypeNS { return r.Ns, nil } + + fmt.Println("RECEIVED RESPONSE:") + fmt.Println(r) + return r.Answer, nil } else { return nil, fmt.Errorf("update server is not set")