* feat: add magic site-to-site VPN setting resource support with `unifi_setting_magic_site_to_site_vpn` resource
* do not use default
* require controller version >=7.4 for magic site to site vpn tests
* feat: add automatic speedtest setting resource support with `unifi_setting_auto_speedtest` resource
* restore lowered test paralellism
* refactoring and fixes
* fix speedtest after refactor
* run speedtest test on versions [7.2,7.4.156), cause later it was removed from USG which is used in tests
* feat: initialize Terraform Plugin Framework
* fix docker-compose path for tests
* fix: ensure documentation can be generated with old provider SDK and new plugin framework
* lint
* fix: temporarily disable CheckDestroy in TestAccSite_basic causing test flakiness
References #480
* fix: generate random name and mac in TestAccDataAccount_default and TestAccDataAccount_mac respectively to fix flakiness
References #480
* chore: disable linter on testAccCheckSiteResourceDestroy
* Add support for port aggregation
Fixes#142
* Return `*unifi.Device` from `allocateDevice`
* Merge `TestAccDevice_switch_portOverrides` and `TestAccDevice_remove_portOverrides`
* Add tests
Note that only switches with a Broadcom, Microsemi or Nephos chipset support both port mirroring and port aggregation.
```java
package com.ubnt.data;
public class Device extends X implements Sanitizable
{
// ...
public int getMaxMirrorSession() {
int n = 0;
if (this.getModel() == Model.\u00f8\u00f50000) {
n = 2;
}
else if (this.isBroadcomSwitch() || this.isMicrosemiSwitch() || this.isMediaTekSwitch() || this.isNephosSwitch()) {
n = 1;
}
return this.thisforObject().getInt("max_mirror_sessions", n);
}
public int getMaxAggregation() {
int n = 0;
if (this.isBroadcomSwitch() || this.isMicrosemiSwitch() || this.isNephosSwitch()) {
n = 6;
}
return this.thisforObject().getInt("max_aggregate_sessions", n);
}
// ...
public boolean isBroadcomSwitch() {
final Model model = this.getModel();
return model.getChipset().typeOf(Chipset.\u00f400000) && model.getType() == DeviceType.if;
}
public boolean isMicrosemiSwitch() {
final Model model = this.getModel();
return model.getChipset().typeOf(Chipset.o00000) && model.getType() == DeviceType.if;
}
public boolean isMediaTekSwitch() {
final Model model = this.getModel();
return model.getChipset().typeOf(Chipset.\u00d3O0000) && model.getType() == DeviceType.if;
}
public boolean isNephosSwitch() {
final Model model = this.getModel();
return model.getChipset().typeOf(Chipset.\u00d5O0000) && model.getType() == DeviceType.if;
}
// ...
}
```
To extract the list of models that use one of these chipsets I used the following script (executed as `java --class-path path/to/ace.jar main.java`):
```java
import com.ubnt.data.Model;
class UniFiModels {
public static void main(String[] args) {
/*
for (Model model : Model.values()) {
System.out.printf(
"Model = %s\nSKU = %s\nType = %s\nFeatures = %s\nChipset = %s\nSysId = %s\nPortNum = %s\n\n",
model,
model.getSku(),
model.getType(),
model.getFeatures(),
model.getChipset(),
model.getSysId(),
model.getPortNum());
}
*/
for (Model model : Model.values()) {
System.out.printf("%s: %s (%s)\n", model.getChipset(), model, model.getSku());
}
}
}
```
---------
Co-authored-by: Joshua Spence <josh@spence.com.au>
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.