Test open security

This commit is contained in:
Paul Tyng
2019-12-28 12:12:59 -05:00
parent a197979717
commit f4ebac0ddc

View File

@@ -6,14 +6,14 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
func TestAccWLAN_basic(t *testing.T) {
func TestAccWLAN_wpapsk(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { preCheck(t) },
Providers: providers,
// TODO: CheckDestroy: ,
Steps: []resource.TestStep{
{
Config: testAccWLANConfig,
Config: testAccWLANConfig_wpapsk,
Check: resource.ComposeTestCheckFunc(
// testCheckNetworkExists(t, "name"),
),
@@ -26,7 +26,27 @@ func TestAccWLAN_basic(t *testing.T) {
})
}
const testAccWLANConfig = `
func TestAccWLAN_open(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { preCheck(t) },
Providers: providers,
// TODO: CheckDestroy: ,
Steps: []resource.TestStep{
{
Config: testAccWLANConfig_open,
Check: resource.ComposeTestCheckFunc(
// testCheckNetworkExists(t, "name"),
),
},
importStep("unifi_wlan.test",
"name", "passphrase", "vlan_id", "wlan_group_id",
"user_group_id", "security",
),
},
})
}
const testAccWLANConfig_wpapsk = `
data "unifi_wlan_group" "default" {
}
@@ -34,7 +54,7 @@ data "unifi_user_group" "default" {
}
resource "unifi_wlan" "test" {
name = "foo"
name = "foowpapsk"
vlan_id = 202
passphrase = "12345678"
wlan_group_id = data.unifi_wlan_group.default.id
@@ -42,3 +62,19 @@ resource "unifi_wlan" "test" {
security = "wpapsk"
}
`
const testAccWLANConfig_open = `
data "unifi_wlan_group" "default" {
}
data "unifi_user_group" "default" {
}
resource "unifi_wlan" "test" {
name = "fooopen"
vlan_id = 202
wlan_group_id = data.unifi_wlan_group.default.id
user_group_id = data.unifi_user_group.default.id
security = "open"
}
`