From e01affd4261f279e3fb98ad6f16ed1da179faccd Mon Sep 17 00:00:00 2001 From: Maksym Date: Sat, 30 Nov 2024 23:42:10 +0200 Subject: [PATCH] use mnazarenko/docker-routeros (#235) * use mnazarenko/docker-routeros * use RouterOS 7.14.3 as target for 7.x tests in github actions * dont run all acc tests in parallel * trigger CI * normalize DHCP server RouterOS response --- .github/workflows/continuous-integration.yml | 6 +++--- client/client_crud.go | 12 ++++++++++++ client/dhcp_server.go | 10 ++++++++++ client/dhcp_server_test.go | 5 +++-- docker/Dockerfile.routeros | 19 ------------------- docker/docker-compose.yml | 6 +----- mikrotik/resource_bgp_instance_test.go | 10 +++++----- mikrotik/resource_bgp_peer_test.go | 8 ++++---- mikrotik/resource_dhcp_lease_test.go | 6 +++--- mikrotik/resource_dns_record_test.go | 10 +++++----- .../resource_interface_wireguard_peer_test.go | 6 +++--- mikrotik/resource_interface_wireguard_test.go | 6 +++--- mikrotik/resource_ip_address_test.go | 4 ++-- mikrotik/resource_ipv6_address_test.go | 4 ++-- mikrotik/resource_pool_test.go | 10 +++++----- mikrotik/resource_scheduler_test.go | 6 +++--- mikrotik/resource_script_test.go | 12 ++++++------ 17 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 docker/Dockerfile.routeros diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 8987fb85..394e9988 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -16,8 +16,8 @@ jobs: experimental: [false] go: ["1.18"] os: [ubuntu-latest] - # Test against latest stable release, v6 beta and v7 beta - routeros: ["6.48.3", "6.49beta54", "7.1beta6"] + # Test against latest stable 6.x and 7.x and "latest" stable + routeros: ["6.49.15", "7.14.3"] include: - experimental: true go: 1.18 @@ -61,7 +61,7 @@ jobs: services: routeros: - image: evilfreelancer/docker-routeros:${{ matrix.routeros }} + image: mnazarenko/docker-routeros:${{ matrix.routeros }} ports: - 8728:8728 volumes: diff --git a/client/client_crud.go b/client/client_crud.go index c8657adb..73522102 100644 --- a/client/client_crud.go +++ b/client/client_crud.go @@ -61,6 +61,13 @@ type ( DeleteFieldValue() string } + // Normalizer is used to normalize response from RouterOS. + // The main use-case is to populate fields which are empty in response but have default value, + // for example `authoritative=yes` in `DHCPServer` resource is not returned by remote RouterOS instance. + Normalizer interface { + Normalize(r *routeros.Reply) + } + // ErrorHandler Defines contract to handle errors returned by RouterOS. // It can either return another error, or supress original error by returning nil. ErrorHandler interface { @@ -211,6 +218,11 @@ func (client Mikrotik) findByField(d Resource, field, value string) (Resource, e if err != nil { return nil, err } + + if n, ok := targetStructInterface.(Normalizer); ok { + n.Normalize(r) + } + // assertion is not checked as we are creating the targetStruct from 'd' argument which satisfies Resource interface targetResource := targetStructInterface.(Resource) if targetResource.ID() == "" { diff --git a/client/dhcp_server.go b/client/dhcp_server.go index efd97016..c43589b1 100644 --- a/client/dhcp_server.go +++ b/client/dhcp_server.go @@ -47,6 +47,16 @@ func (b *DhcpServer) FindField() string { return "name" } +func (b *DhcpServer) Normalize(r *routeros.Reply) { + if len(r.Re) < 1 || len(r.Re[0].Map) < 1 { + return + } + + if _, ok := r.Re[0].Map["authoritative"]; !ok { + b.Authoritative = "yes" + } +} + func (b *DhcpServer) FindFieldValue() string { return b.Name } diff --git a/client/dhcp_server_test.go b/client/dhcp_server_test.go index 1a937dbe..3ef9f814 100644 --- a/client/dhcp_server_test.go +++ b/client/dhcp_server_test.go @@ -8,8 +8,9 @@ func TestAddDhcpServerUpdateAndDelete(t *testing.T) { name := "myserver" disabled := true dhcpServer, err := c.AddDhcpServer(&DhcpServer{ - Name: name, - Disabled: disabled, + Name: name, + Disabled: disabled, + Interface: "*0", }) if err != nil { t.Fatal(err) diff --git a/docker/Dockerfile.routeros b/docker/Dockerfile.routeros deleted file mode 100644 index 1ada52c4..00000000 --- a/docker/Dockerfile.routeros +++ /dev/null @@ -1,19 +0,0 @@ -FROM alpine:3.19 as builder - -RUN apk add -U curl - -ARG ROUTEROS_VERSION -ENV ROUTEROS_VERSION=${ROUTEROS_VERSION:-7.15.1} - -RUN curl -o data.img.zip https://download.mikrotik.com/routeros/${ROUTEROS_VERSION}/chr-${ROUTEROS_VERSION}.img.zip \ - && unzip -p data.img.zip > /data.img - -FROM qemux/qemu-docker - -ENV KVM="N" -ENV BOOT_MODE="legacy" -ENV BOOT_INDEX="0" -ENV ARGUMENTS="-nographic" -ENV DISK_TYPE="blk" - -COPY --from=builder /data.img /storage/data.img diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 456d6f6f..32294189 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,11 +2,7 @@ services: routeros: - build: - context: . - dockerfile: Dockerfile.routeros - args: - ROUTEROS_VERSION: ${ROUTEROS_VERSION} + image: mnazarenko/docker-routeros:${ROUTEROS_VERSION:-latest} environment: DEBUG: "N" DISPLAY: "web" diff --git a/mikrotik/resource_bgp_instance_test.go b/mikrotik/resource_bgp_instance_test.go index 5a087c4f..9ced5771 100644 --- a/mikrotik/resource_bgp_instance_test.go +++ b/mikrotik/resource_bgp_instance_test.go @@ -21,7 +21,7 @@ func TestAccMikrotikBgpInstance_create(t *testing.T) { resourceName := "mikrotik_bgp_instance.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikBgpInstanceDestroy, @@ -47,7 +47,7 @@ func TestAccMikrotikBgpInstance_createFailsOnRouterOSv7(t *testing.T) { routerId := internal.GetNewIpAddr() as := acctest.RandIntRange(1, 65535) - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikBgpInstanceDestroy, @@ -68,7 +68,7 @@ func TestAccMikrotikBgpInstance_createAndPlanWithNonExistantBgpInstance(t *testi resourceName := "mikrotik_bgp_instance.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikBgpInstanceDestroy, @@ -107,7 +107,7 @@ func TestAccMikrotikBgpInstance_updateBgpInstance(t *testing.T) { resourceName := "mikrotik_bgp_instance.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikBgpInstanceDestroy, @@ -155,7 +155,7 @@ func TestAccMikrotikBgpInstance_import(t *testing.T) { resourceName := "mikrotik_bgp_instance.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikBgpInstanceDestroy, diff --git a/mikrotik/resource_bgp_peer_test.go b/mikrotik/resource_bgp_peer_test.go index 69486dfc..de6962a3 100644 --- a/mikrotik/resource_bgp_peer_test.go +++ b/mikrotik/resource_bgp_peer_test.go @@ -30,7 +30,7 @@ func TestAccMikrotikBgpPeer_create(t *testing.T) { remoteAddress, _ := acctest.RandIpAddress("192.168.0.0/24") resourceName := "mikrotik_bgp_peer.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikBgpPeerDestroy, @@ -80,7 +80,7 @@ func TestAccMikrotikBgpPeer_createAndPlanWithNonExistantBgpPeer(t *testing.T) { t.Fatalf("Error removing the bgp peer: %s", err) } } - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikBgpPeerDestroy, @@ -107,7 +107,7 @@ func TestAccMikrotikBgpPeer_updateBgpPeer(t *testing.T) { remoteAddress, _ := acctest.RandIpAddress("192.168.3.0/24") resourceName := "mikrotik_bgp_peer.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikBgpPeerDestroy, @@ -170,7 +170,7 @@ func TestAccMikrotikBgpPeer_import(t *testing.T) { resourceName := "mikrotik_bgp_peer.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikBgpPeerDestroy, diff --git a/mikrotik/resource_dhcp_lease_test.go b/mikrotik/resource_dhcp_lease_test.go index 49095040..26cabe1a 100644 --- a/mikrotik/resource_dhcp_lease_test.go +++ b/mikrotik/resource_dhcp_lease_test.go @@ -17,7 +17,7 @@ func TestAccMikrotikDhcpLease_create(t *testing.T) { comment := acctest.RandomWithPrefix("tf-acc-comment") resourceName := "mikrotik_dhcp_lease.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikDhcpLeaseDestroy, @@ -46,7 +46,7 @@ func TestAccMikrotikDhcpLease_updateLease(t *testing.T) { updatedComment := acctest.RandomWithPrefix("tf-acc-comment") resourceName := "mikrotik_dhcp_lease.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikDhcpLeaseDestroy, @@ -107,7 +107,7 @@ func TestAccMikrotikDhcpLease_import(t *testing.T) { comment := acctest.RandomWithPrefix("tf-acc-comment") resourceName := "mikrotik_dhcp_lease.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikDhcpLeaseDestroy, diff --git a/mikrotik/resource_dns_record_test.go b/mikrotik/resource_dns_record_test.go index ebac648b..ed8cd900 100644 --- a/mikrotik/resource_dns_record_test.go +++ b/mikrotik/resource_dns_record_test.go @@ -15,7 +15,7 @@ func TestAccMikrotikDnsRecord_create(t *testing.T) { ipAddr := internal.GetNewIpAddr() resourceName := "mikrotik_dns_record.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikDnsRecordDestroy, @@ -48,7 +48,7 @@ func TestAccMikrotikDnsRecord_createAndPlanWithNonExistantRecord(t *testing.T) { } } - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikDnsRecordDestroy, @@ -74,7 +74,7 @@ func TestAccMikrotikDnsRecord_updateAddress(t *testing.T) { updatedIpAddr := internal.GetNewIpAddr() resourceName := "mikrotik_dns_record.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikDnsRecordDestroy, @@ -103,7 +103,7 @@ func TestAccMikrotikDnsRecord_updateComment(t *testing.T) { updatedComment := "new comment" resourceName := "mikrotik_dns_record.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikDnsRecordDestroy, @@ -130,7 +130,7 @@ func TestAccMikrotikDnsRecord_import(t *testing.T) { ipAddr := internal.GetNewIpAddr() resourceName := "mikrotik_dns_record.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikDnsRecordDestroy, diff --git a/mikrotik/resource_interface_wireguard_peer_test.go b/mikrotik/resource_interface_wireguard_peer_test.go index 75bffd7d..ae875e6c 100644 --- a/mikrotik/resource_interface_wireguard_peer_test.go +++ b/mikrotik/resource_interface_wireguard_peer_test.go @@ -20,7 +20,7 @@ func TestAccMikrotikInterfaceWireguardPeer_create(t *testing.T) { interfaceName := acctest.RandomWithPrefix("tf-acc-interface-wireguard") publicKey := "/yZWgiYAgNNSy7AIcxuEewYwOVPqJJRKG90s9ypwfiM=" resourceName := "mikrotik_interface_wireguard_peer.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikInterfaceWireguardPeerDestroy, @@ -43,7 +43,7 @@ func TestAccMikrotikInterfaceWireguardPeer_updatedComment(t *testing.T) { interfaceName := acctest.RandomWithPrefix("tf-acc-interface-wireguard") publicKey := "/bTmUihbgNsSy2AIcxuEcwYwOVdqJJRKG51s4ypwfiM=" resourceName := "mikrotik_interface_wireguard_peer.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikInterfaceWireguardPeerDestroy, @@ -131,7 +131,7 @@ func TestAccMikrotikInterfaceWireguardPeer_import(t *testing.T) { interfaceName := acctest.RandomWithPrefix("tf-acc-interface-wireguard") publicKey := "/zYaGiYbgNsSy8AIcxuEcwYwOVdqJJRKG91s9ypwfiM=" resourceName := "mikrotik_interface_wireguard_peer.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikInterfaceWireguardPeerDestroy, diff --git a/mikrotik/resource_interface_wireguard_test.go b/mikrotik/resource_interface_wireguard_test.go index eee24f12..a952593d 100644 --- a/mikrotik/resource_interface_wireguard_test.go +++ b/mikrotik/resource_interface_wireguard_test.go @@ -21,7 +21,7 @@ func TestAccMikrotikInterfaceWireguard_create(t *testing.T) { name := acctest.RandomWithPrefix("tf-acc-create") resourceName := "mikrotik_interface_wireguard.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikInterfaceWireguardDestroy, @@ -45,7 +45,7 @@ func TestAccMikrotikInterfaceWireguard_updatedComment(t *testing.T) { name := acctest.RandomWithPrefix("tf-acc-update-comment") resourceName := "mikrotik_interface_wireguard.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikInterfaceWireguardDestroy, @@ -73,7 +73,7 @@ func TestAccMikrotikInterfaceWireguard_import(t *testing.T) { name := acctest.RandomWithPrefix("tf-acc-import") resourceName := "mikrotik_interface_wireguard.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikInterfaceWireguardDestroy, diff --git a/mikrotik/resource_ip_address_test.go b/mikrotik/resource_ip_address_test.go index f6f22e5a..bc7b449b 100644 --- a/mikrotik/resource_ip_address_test.go +++ b/mikrotik/resource_ip_address_test.go @@ -17,7 +17,7 @@ func TestAccMikrotikResourceIpAddress_create(t *testing.T) { comment := acctest.RandomWithPrefix("tf-acc-comment") resourceName := "mikrotik_ip_address.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikIpAddressDestroy, @@ -46,7 +46,7 @@ func TestAccMikrotikResourceIpAddress_updateAddr(t *testing.T) { updatedDisabled := "true" resourceName := "mikrotik_ip_address.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikIpAddressDestroy, diff --git a/mikrotik/resource_ipv6_address_test.go b/mikrotik/resource_ipv6_address_test.go index 43587596..28585b8a 100644 --- a/mikrotik/resource_ipv6_address_test.go +++ b/mikrotik/resource_ipv6_address_test.go @@ -19,7 +19,7 @@ func TestAccMikrotikResourceIpv6Address_create(t *testing.T) { comment := acctest.RandomWithPrefix("tf-acc-comment") resourceName := "mikrotik_ipv6_address.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikIpv6AddressDestroy, @@ -80,7 +80,7 @@ func TestAccMikrotikResourceIpv6Address_updateAddr(t *testing.T) { updatedDisabled := "true" resourceName := "mikrotik_ipv6_address.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikIpv6AddressDestroy, diff --git a/mikrotik/resource_pool_test.go b/mikrotik/resource_pool_test.go index 89d671e3..da3527df 100644 --- a/mikrotik/resource_pool_test.go +++ b/mikrotik/resource_pool_test.go @@ -16,7 +16,7 @@ func TestAccMikrotikPool_create(t *testing.T) { ranges := fmt.Sprintf("%s,%s", internal.GetNewIpAddrRange(10), internal.GetNewIpAddr()) resourceName := "mikrotik_pool.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikPoolDestroy, @@ -40,7 +40,7 @@ func TestAccMikrotikPool_createNextPool(t *testing.T) { ranges := fmt.Sprintf("%s,%s", internal.GetNewIpAddrRange(10), internal.GetNewIpAddr()) resourceName := "mikrotik_pool.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikPoolDestroy, @@ -95,7 +95,7 @@ func TestAccMikrotikPool_createAndPlanWithNonExistantPool(t *testing.T) { t.Fatalf("Error removing the pool: %s", err) } } - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikPoolDestroy, @@ -123,7 +123,7 @@ func TestAccMikrotikPool_updatePool(t *testing.T) { comment := acctest.RandomWithPrefix("tf-acc-comment") resourceName := "mikrotik_pool.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikPoolDestroy, @@ -170,7 +170,7 @@ func TestAccMikrotikPool_import(t *testing.T) { ranges := fmt.Sprintf("%s,%s", internal.GetNewIpAddrRange(10), internal.GetNewIpAddr()) resourceName := "mikrotik_pool.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikPoolDestroy, diff --git a/mikrotik/resource_scheduler_test.go b/mikrotik/resource_scheduler_test.go index a438f853..7eb4930d 100644 --- a/mikrotik/resource_scheduler_test.go +++ b/mikrotik/resource_scheduler_test.go @@ -19,7 +19,7 @@ func TestAccMikrotikScheduler_create(t *testing.T) { name := acctest.RandomWithPrefix("tf-acc-create") resourceName := "mikrotik_scheduler.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikSchedulerDestroy, @@ -68,7 +68,7 @@ func TestAccMikrotikScheduler_updatedOnEvent(t *testing.T) { name := acctest.RandomWithPrefix("tf-acc-update-event") resourceName := "mikrotik_scheduler.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikSchedulerDestroy, @@ -93,7 +93,7 @@ func TestAccMikrotikScheduler_import(t *testing.T) { name := acctest.RandomWithPrefix("tf-acc-import") resourceName := "mikrotik_scheduler.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikSchedulerDestroy, diff --git a/mikrotik/resource_script_test.go b/mikrotik/resource_script_test.go index de551d7f..8789b139 100644 --- a/mikrotik/resource_script_test.go +++ b/mikrotik/resource_script_test.go @@ -20,7 +20,7 @@ func TestAccMikrotikScript_create(t *testing.T) { name := acctest.RandomWithPrefix("tf-acc-create") resourceName := "mikrotik_script.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikScriptDestroy, @@ -40,7 +40,7 @@ func TestAccMikrotikScript_updateSource(t *testing.T) { updatedSource := ":put updated" resourceName := "mikrotik_script.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikScriptDestroy, @@ -66,7 +66,7 @@ func TestAccMikrotikScript_updateOwner(t *testing.T) { updatedOwner := "prometheus" resourceName := "mikrotik_script.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikScriptDestroy, @@ -91,7 +91,7 @@ func TestAccMikrotikScript_updateDontReqPerms(t *testing.T) { name := acctest.RandomWithPrefix("tf-acc-update-perm") resourceName := "mikrotik_script.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikScriptDestroy, @@ -117,7 +117,7 @@ func TestAccMikrotikScript_updatePolicies(t *testing.T) { updatedPolicies := []string{"ftp"} resourceName := "mikrotik_script.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikScriptDestroy, @@ -145,7 +145,7 @@ func TestAccMikrotikScript_import(t *testing.T) { name := acctest.RandomWithPrefix("tf-acc-import") resourceName := "mikrotik_script.bar" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ProtoV5ProviderFactories: testAccProtoV5ProviderFactories, CheckDestroy: testAccCheckMikrotikScriptDestroy,