Skip to content

Commit

Permalink
TF Fixes to support for 18.2.5 onwards
Browse files Browse the repository at this point in the history
  • Loading branch information
Rohan-sss1 committed Jul 12, 2019
1 parent b49d102 commit 54c7065
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 74 deletions.
16 changes: 2 additions & 14 deletions avi/data_source_avi_serviceenginegroup_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package avi

import (
"github.com/hashicorp/terraform/helper/resource"
"testing"

"github.com/hashicorp/terraform/helper/resource"
)

func TestAVIDataSourceServiceEngineGroupBasic(t *testing.T) {
Expand Down Expand Up @@ -57,8 +58,6 @@ func TestAVIDataSourceServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "auto_rebalance_interval", "300"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "vs_scaleout_timeout", "30"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "enable_routing", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "disable_tso", "false"),
resource.TestCheckResourceAttr(
Expand All @@ -73,8 +72,6 @@ func TestAVIDataSourceServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "distribute_queues", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "disable_csum_offloads", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "enable_vip_on_all_interfaces", "true"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "se_probe_port", "7"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -105,8 +102,6 @@ func TestAVIDataSourceServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "disable_gro", "true"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "vcenter_datastores_include", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "advertise_backend_networks", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "per_app", "false"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -143,8 +138,6 @@ func TestAVIDataSourceServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "mem_reserve", "true"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "cpu_reserve", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "enable_vmac", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "vs_host_redundancy", "true"),
),
Expand Down Expand Up @@ -186,7 +179,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
se_tunnel_udp_port = "1550"
auto_rebalance_interval = "300"
vs_scaleout_timeout = "30"
enable_routing = false
disable_tso = false
ha_mode = "HA_MODE_SHARED"
se_sb_threads = "1"
Expand All @@ -195,7 +187,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
active_standby = false
distribute_queues = false
disable_csum_offloads = false
enable_vip_on_all_interfaces = true
se_probe_port = "7"
se_udp_encap_ipc = "0"
extra_config_multiplier = "0"
Expand All @@ -215,7 +206,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
ingress_access_data = "SG_INGRESS_ACCESS_ALL"
disable_gro = true
vcenter_datastores_include = false
advertise_backend_networks = false
per_app = false
non_significant_log_throttle = "100"
max_cpu_usage = "80"
Expand All @@ -238,8 +228,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
mem_reserve = true
cpu_reserve = false
algo = "PLACEMENT_ALGO_DISTRIBUTED"
se_bandwidth_type = "SE_BANDWIDTH_UNLIMITED"
enable_vmac = false
vs_host_redundancy = true
license_type = "LIC_CORES"
}
Expand Down
35 changes: 3 additions & 32 deletions avi/resource_avi_serviceenginegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
package avi

import (
"github.com/avinetworks/sdk/go/clients"
"github.com/hashicorp/terraform/helper/schema"
"log"
"strings"

"github.com/avinetworks/sdk/go/clients"
"github.com/hashicorp/terraform/helper/schema"
)

func ResourceServiceEngineGroupSchema() map[string]*schema.Schema {
Expand All @@ -24,11 +25,6 @@ func ResourceServiceEngineGroupSchema() map[string]*schema.Schema {
Optional: true,
Default: false,
},
"advertise_backend_networks": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
"aggressive_failure_detection": {
Type: schema.TypeBool,
Optional: true,
Expand Down Expand Up @@ -224,21 +220,6 @@ func ResourceServiceEngineGroupSchema() map[string]*schema.Schema {
Optional: true,
Default: false,
},
"enable_routing": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
"enable_vip_on_all_interfaces": {
Type: schema.TypeBool,
Optional: true,
Default: true,
},
"enable_vmac": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
"ephemeral_portrange_end": {
Type: schema.TypeInt,
Optional: true,
Expand Down Expand Up @@ -515,11 +496,6 @@ func ResourceServiceEngineGroupSchema() map[string]*schema.Schema {
Optional: true,
Default: true,
},
"se_bandwidth_type": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
"se_deprovision_delay": {
Type: schema.TypeInt,
Optional: true,
Expand Down Expand Up @@ -621,11 +597,6 @@ func ResourceServiceEngineGroupSchema() map[string]*schema.Schema {
Optional: true,
Default: 1501,
},
"se_routing": {
Type: schema.TypeBool,
Optional: true,
Default: true,
},
"se_sb_dedicated_core": {
Type: schema.TypeBool,
Optional: true,
Expand Down
31 changes: 3 additions & 28 deletions avi/resource_avi_serviceenginegroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package avi

import (
"fmt"
"strings"
"testing"

"github.com/avinetworks/sdk/go/clients"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
"strings"
"testing"
)

func TestAVIServiceEngineGroupBasic(t *testing.T) {
Expand Down Expand Up @@ -63,8 +64,6 @@ func TestAVIServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "auto_rebalance_interval", "300"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "vs_scaleout_timeout", "30"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "enable_routing", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "disable_tso", "false"),
resource.TestCheckResourceAttr(
Expand All @@ -79,8 +78,6 @@ func TestAVIServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "distribute_queues", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "disable_csum_offloads", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "enable_vip_on_all_interfaces", "true"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "se_probe_port", "7"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -111,8 +108,6 @@ func TestAVIServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "disable_gro", "true"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "vcenter_datastores_include", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "advertise_backend_networks", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "per_app", "false"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -149,8 +144,6 @@ func TestAVIServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "mem_reserve", "true"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "cpu_reserve", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "enable_vmac", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "vs_host_redundancy", "true"),
),
Expand Down Expand Up @@ -203,8 +196,6 @@ func TestAVIServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "auto_rebalance_interval", "300"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "vs_scaleout_timeout", "30"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "enable_routing", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "disable_tso", "false"),
resource.TestCheckResourceAttr(
Expand All @@ -219,8 +210,6 @@ func TestAVIServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "distribute_queues", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "disable_csum_offloads", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "enable_vip_on_all_interfaces", "true"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "se_probe_port", "7"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -251,8 +240,6 @@ func TestAVIServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "disable_gro", "true"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "vcenter_datastores_include", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "advertise_backend_networks", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "per_app", "false"),
resource.TestCheckResourceAttr(
Expand Down Expand Up @@ -289,8 +276,6 @@ func TestAVIServiceEngineGroupBasic(t *testing.T) {
"avi_serviceenginegroup.testServiceEngineGroup", "mem_reserve", "true"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "cpu_reserve", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "enable_vmac", "false"),
resource.TestCheckResourceAttr(
"avi_serviceenginegroup.testServiceEngineGroup", "vs_host_redundancy", "true"),
),
Expand Down Expand Up @@ -385,7 +370,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
se_tunnel_udp_port = "1550"
auto_rebalance_interval = "300"
vs_scaleout_timeout = "30"
enable_routing = false
disable_tso = false
ha_mode = "HA_MODE_SHARED"
se_sb_threads = "1"
Expand All @@ -394,7 +378,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
active_standby = false
distribute_queues = false
disable_csum_offloads = false
enable_vip_on_all_interfaces = true
se_probe_port = "7"
se_udp_encap_ipc = "0"
extra_config_multiplier = "0"
Expand All @@ -414,7 +397,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
ingress_access_data = "SG_INGRESS_ACCESS_ALL"
disable_gro = true
vcenter_datastores_include = false
advertise_backend_networks = false
per_app = false
non_significant_log_throttle = "100"
max_cpu_usage = "80"
Expand All @@ -437,8 +419,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
mem_reserve = true
cpu_reserve = false
algo = "PLACEMENT_ALGO_DISTRIBUTED"
se_bandwidth_type = "SE_BANDWIDTH_UNLIMITED"
enable_vmac = false
vs_host_redundancy = true
license_type = "LIC_CORES"
}
Expand Down Expand Up @@ -476,7 +456,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
se_tunnel_udp_port = "1550"
auto_rebalance_interval = "300"
vs_scaleout_timeout = "30"
enable_routing = false
disable_tso = false
ha_mode = "HA_MODE_SHARED"
se_sb_threads = "1"
Expand All @@ -485,7 +464,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
active_standby = false
distribute_queues = false
disable_csum_offloads = false
enable_vip_on_all_interfaces = true
se_probe_port = "7"
se_udp_encap_ipc = "0"
extra_config_multiplier = "0"
Expand All @@ -505,7 +483,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
ingress_access_data = "SG_INGRESS_ACCESS_ALL"
disable_gro = true
vcenter_datastores_include = false
advertise_backend_networks = false
per_app = false
non_significant_log_throttle = "100"
max_cpu_usage = "80"
Expand All @@ -528,8 +505,6 @@ resource "avi_serviceenginegroup" "testServiceEngineGroup" {
mem_reserve = true
cpu_reserve = false
algo = "PLACEMENT_ALGO_DISTRIBUTED"
se_bandwidth_type = "SE_BANDWIDTH_UNLIMITED"
enable_vmac = false
vs_host_redundancy = true
license_type = "LIC_CORES"
}
Expand Down

0 comments on commit 54c7065

Please sign in to comment.