Skip to content

Commit

Permalink
Don't use the USP-RPS as a test device
Browse files Browse the repository at this point in the history
The [USP-RPS](https://store.ui.com/products/usp-rps) is a "switch" (has `usw` type) but it doesn't have ports and so the port override tests will fail. Just ignore these devices.
  • Loading branch information
joshuaspence committed Feb 28, 2023
1 parent 80a8ff6 commit e865bf0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.25.0
github.com/paultyng/go-unifi v1.31.0
github.com/paultyng/go-unifi v1.32.0
)

require (
Expand Down
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/paultyng/go-unifi v1.31.0 h1:tPyaeuE9NAAldd6nmLpFdbed0oZisoDo93yOUlCGnyY=
github.com/paultyng/go-unifi v1.31.0/go.mod h1:pCGPjoyI/LYNRE9bZuM33U7unaUgIG/R/giIQNsYf8Y=
github.com/paultyng/go-unifi v1.32.0 h1:k3zHkL57JEmzghRgvvRuDTSkw9CtD10zdxCB9OUweYI=
github.com/paultyng/go-unifi v1.32.0/go.mod h1:i8D+gyo5NinnDlQ5ZGdqSvRqRyHuV4zA2CLZnHb0axE=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down Expand Up @@ -201,7 +201,7 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk=
github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
Expand Down
12 changes: 9 additions & 3 deletions internal/provider/resource_device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ func allocateDevice(t *testing.T) (string, func()) {
}

for _, device := range devices {
// TODO: Check device type instead of MAC address.
if strings.HasPrefix(device.MAC, "00:27:22:") {
devicesAvailable = append(devicesAvailable, device.MAC)
if device.Type != "usw" {
continue
}

// The USP-RPS isn't really a switch.
if device.Model == "USPRPS" {
continue
}

devicesAvailable = append(devicesAvailable, device.MAC)
}
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/init.d/demo-mode
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ write_config is_simulation true
# Increase the number of demo devices to allow more concurrent tests to be executed simultaneously.
write_config demo.num_uap 20
write_config demo.num_ugw 20
write_config demo.num_usw 20
write_config demo.num_usw 20

0 comments on commit e865bf0

Please sign in to comment.