* 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.
* Add support for mDNS on network resource
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
* Add mDSN network tests
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
---------
Signed-off-by: Xabier Larrakoetxea <me@slok.dev>
* feat: account resource with data source
* Adjust docs and validation
* add import test steps
* adjust radius capitalization in docs
Co-authored-by: Paul Tyng <paul@paultyng.net>
* Add missing WAN IPv6 properties to network resource
* Rename 'ipv6_static_subnet' to 'ipv6_subnet'
According to the go-unifi lib, the name was incorrect
* Improve description and validation of IPv6 properties
* Add missing IPv6 props to network
* Add IPv6 support to firewall rules
* Adjust naming
* ensure unique vlan
* Add vlan ID validation
* fix assertion
* Update docs
* rename attribute
* cleanup imports
* test protocol_v6
* test dhcp_v6_lease
* spelling
* switch protocol back
Co-authored-by: Paul Tyng <paul@paultyng.net>