Skip to content

Commit

Permalink
fix: Some test case are not working correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
amhn authored and smutel committed Nov 17, 2022
1 parent 76d052c commit 80a1b00
Show file tree
Hide file tree
Showing 290 changed files with 38,654 additions and 2,369 deletions.
6 changes: 5 additions & 1 deletion examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,13 @@ resource "netbox_virtualization_interface" "interface_test" {
description = "Interface de test"
}

data "netbox_json_ipam_rirs_list" "json_rir" {
limit = 1
}

resource "netbox_ipam_aggregate" "aggregate_test" {
prefix = "192.167.0.0/24"
rir_id = 1
rir_id = jsondecode(data.netbox_json_ipam_rirs_list.json_rir.json)[0].id
date_added = "2020-12-21"
description = "Aggregate created by terraform"

Expand Down
40 changes: 20 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ module github.com/smutel/terraform-provider-netbox/v4
go 1.18

require (
github.com/go-openapi/runtime v0.24.1
github.com/go-openapi/runtime v0.24.2
github.com/go-openapi/strfmt v0.21.3
github.com/hashicorp/terraform-plugin-docs v0.10.1
github.com/hashicorp/terraform-plugin-sdk/v2 v2.21.0
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1
github.com/smutel/go-netbox/v3 v3.2.3
)

Expand All @@ -31,34 +31,34 @@ require (
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/validate v0.22.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-hclog v1.2.2 // indirect
github.com/hashicorp/go-hclog v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.5 // indirect
github.com/hashicorp/go-plugin v1.4.6 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.4.0 // indirect
github.com/hashicorp/hcl/v2 v2.13.0 // indirect
github.com/hashicorp/hcl/v2 v2.15.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.17.2 // indirect
github.com/hashicorp/terraform-exec v0.17.3 // indirect
github.com/hashicorp/terraform-json v0.14.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.14.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.14.1 // indirect
github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect
github.com/hashicorp/terraform-registry-address v0.0.0-20220623143253-7d51757b572c // indirect
github.com/hashicorp/terraform-registry-address v0.1.0 // indirect
github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/mitchellh/cli v1.1.4 // indirect
github.com/mitchellh/cli v1.1.5 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
Expand All @@ -74,15 +74,15 @@ require (
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
github.com/vmihailenco/tagparser v0.1.2 // indirect
github.com/zclconf/go-cty v1.11.0 // indirect
go.mongodb.org/mongo-driver v1.10.1 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/net v0.0.0-20220822230855-b0a4917ee28c // indirect
golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect
golang.org/x/text v0.3.7 // indirect
github.com/zclconf/go-cty v1.12.1 // indirect
go.mongodb.org/mongo-driver v1.11.0 // indirect
golang.org/x/crypto v0.2.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect
google.golang.org/grpc v1.49.0 // indirect
google.golang.org/genproto v0.0.0-20221114212237-e4508ebdbee1 // indirect
google.golang.org/grpc v1.50.1 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
43 changes: 43 additions & 0 deletions go.sum

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion netbox/resource_netbox_ipam_aggregate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ func testAccCheckNetboxIPAMAggregateConfig(nameSuffix string, resourceFull, extr
# name = "test-{{ .namesuffix }}"
# slug = "test-{{ .namesuffix }}"
#}
data "netbox_json_ipam_rirs_list" "json_rir" {
limit = 1
}
{{ if eq .extraresources "true" }}
#resource "netbox_extras_tag" "test" {
Expand All @@ -113,8 +116,8 @@ func testAccCheckNetboxIPAMAggregateConfig(nameSuffix string, resourceFull, extr
resource "netbox_ipam_aggregate" "test" {
prefix = "{{ .prefix }}"
rir_id = jsondecode(data.netbox_json_ipam_rirs_list.json_rir.json)[0].id
#rir_id = netbox_ipam_rir.test.id
rir_id = 39
{{ if eq .resourcefull "true" }}
tenant_id = netbox_tenancy_tenant.test.id
Expand Down
13 changes: 12 additions & 1 deletion netbox/resource_netbox_virtualization_vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,18 @@ func testAccCheckNetboxVirtualizationVMConfig(nameSuffix string, resourceFull, e
# name = "test-{{ .namesuffix }}"
# type_id = netbox_virtualization_cluster_type.test.id
#}
data "netbox_virtualization_cluster" "cluster_test" {
name = "test"
}
{{ if eq .extraresources "true" }}
#resource "netbox_dcim_platform" "test" {
# name = "test-{{ .namesuffix }}"
# slug = "test-{{ .namesuffix }}"
#}
data "netbox_dcim_platform" "platform_test" {
slug = "Debian_10"
}
#resource "netbox_dcim_device_role" "test" {
# name = "test-{{ .namesuffix }}"
Expand All @@ -126,12 +132,13 @@ func testAccCheckNetboxVirtualizationVMConfig(nameSuffix string, resourceFull, e
resource "netbox_virtualization_vm" "test" {
name = "test-{{ .namesuffix }}"
#cluster_id = netbox_virtualization_cluster.test.id
cluster_id = 30
cluster_id = data.netbox_virtualization_cluster.cluster_test.id
{{ if eq .resourcefull "true" }}
comments = "VM created by terraform"
#role_id = netbox_dcim_device_role.test.id
#platform_id = netbox_dcim_platform.test.id
platform_id = data.netbox_dcim_platform.platform_test.id
tenant_id = netbox_tenancy_tenant.test.id
status = "planned"
vcpus = 2
Expand All @@ -149,6 +156,10 @@ func testAccCheckNetboxVirtualizationVMConfig(nameSuffix string, resourceFull, e
# name = netbox_extras_tag.test.name
# slug = netbox_extras_tag.test.slug
#}
tag {
name = "tag1"
slug = "tag1"
}
{{ end }}
}
`
Expand Down
2 changes: 2 additions & 0 deletions vendor/github.com/go-openapi/runtime/client/response.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 16 additions & 3 deletions vendor/github.com/go-openapi/runtime/client/runtime.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion vendor/github.com/go-openapi/runtime/middleware/context.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion vendor/github.com/go-openapi/runtime/middleware/parameter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 33 additions & 31 deletions vendor/github.com/google/go-cmp/cmp/compare.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 80a1b00

Please sign in to comment.