Skip to content

Commit 51dc216

Browse files
Merge pull request #1096 from F5Networks/devel
devel to master
2 parents 26825a9 + 4b2d293 commit 51dc216

File tree

10 files changed

+1314
-50
lines changed

10 files changed

+1314
-50
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package bigip
2+
3+
import (
4+
"testing"
5+
6+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
7+
)
8+
9+
func TestAccDataSourceBigipLtmMonitor_basic(t *testing.T) {
10+
t.Parallel()
11+
resource.Test(t, resource.TestCase{
12+
PreCheck: func() { testAcctPreCheck(t) },
13+
Providers: testAccProviders,
14+
Steps: []resource.TestStep{
15+
{
16+
Config: testAccDataSourceBigipLtmMonitorConfig(),
17+
Check: resource.ComposeTestCheckFunc(
18+
resource.TestCheckResourceAttrSet("data.bigip_ltm_monitor.test", "name"),
19+
resource.TestCheckResourceAttrSet("data.bigip_ltm_monitor.test", "partition"),
20+
resource.TestCheckResourceAttrSet("data.bigip_ltm_monitor.test", "interval"),
21+
resource.TestCheckResourceAttrSet("data.bigip_ltm_monitor.test", "timeout"),
22+
),
23+
},
24+
},
25+
})
26+
}
27+
28+
func testAccDataSourceBigipLtmMonitorConfig() string {
29+
return `data "bigip_ltm_monitor" "test" {
30+
name = "http"
31+
partition = "Common"
32+
}`
33+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package bigip
2+
3+
import (
4+
"fmt"
5+
"testing"
6+
7+
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
8+
)
9+
10+
func TestAccDataSourceBigipLtmPolicy_basic(t *testing.T) {
11+
policyName := "/Common/test_policy"
12+
resource.Test(t, resource.TestCase{
13+
PreCheck: func() { testAcctPreCheck(t) },
14+
Providers: testAccProviders,
15+
Steps: []resource.TestStep{
16+
{
17+
Config: testAccDataSourceBigipLtmPolicyConfig(policyName),
18+
Check: resource.ComposeTestCheckFunc(
19+
resource.TestCheckResourceAttr("data.bigip_ltm_policy.test", "name", policyName),
20+
resource.TestCheckResourceAttrSet("data.bigip_ltm_policy.test", "strategy"),
21+
resource.TestCheckResourceAttrSet("data.bigip_ltm_policy.test", "controls"),
22+
resource.TestCheckResourceAttrSet("data.bigip_ltm_policy.test", "requires"),
23+
resource.TestCheckResourceAttrSet("data.bigip_ltm_policy.test", "rule"),
24+
),
25+
},
26+
},
27+
})
28+
}
29+
30+
func testAccDataSourceBigipLtmPolicyConfig(name string) string {
31+
return fmt.Sprintf(`
32+
data "bigip_ltm_policy" "test" {
33+
name = "%s"
34+
}
35+
`, name)
36+
}

0 commit comments

Comments
 (0)