Skip to content

Commit

Permalink
Added testing for monitor_port and monitor_address
Browse files Browse the repository at this point in the history
  • Loading branch information
flashjmp committed Apr 13, 2022
1 parent 7d59a24 commit 44696c5
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions openstack/resource_openstack_lb_members_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ func TestAccLBV2Members_basic(t *testing.T) {
testAccCheckLBV2MembersComputeHash(&members, 1, "192.168.199.111", &idx2),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.weight", &idx1, "0"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.weight", &idx2, "1"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.monitor_address", &idx1, "192.168.199.110"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.monitor_address", &idx2, "192.168.199.111"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.monitor_port", &idx1, "8088"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.monitor_port", &idx2, "8088"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.backup", &idx1, "false"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.backup", &idx2, "true"),
testCheckResourceAttrSetWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.subnet_id", &idx1),
Expand All @@ -80,6 +84,10 @@ func TestAccLBV2Members_basic(t *testing.T) {
testAccCheckLBV2MembersComputeHash(&members, 15, "192.168.199.111", &idx2),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.weight", &idx1, "10"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.weight", &idx2, "15"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.monitor_address", &idx1, "192.168.199.10"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.monitor_address", &idx2, "192.168.199.11"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.monitor_port", &idx1, "8080"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.monitor_port", &idx2, "8080"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.backup", &idx1, "true"),
testCheckResourceAttrWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.backup", &idx2, "false"),
testCheckResourceAttrSetWithIndexesAddr("openstack_lb_members_v2.members_1", "member.%d.subnet_id", &idx1),
Expand Down Expand Up @@ -218,15 +226,19 @@ resource "openstack_lb_members_v2" "members_1" {
member {
address = "192.168.199.110"
protocol_port = 8080
monitor_address = "192.168.199.110"
monitor_port = 8088
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
weight = 0
}
member {
address = "192.168.199.111"
protocol_port = 8080
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
backup = true
monitor_address = "192.168.199.111"
monitor_port = 8088
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
backup = true
}
timeouts {
Expand Down Expand Up @@ -275,6 +287,8 @@ resource "openstack_lb_members_v2" "members_1" {
member {
address = "192.168.199.110"
protocol_port = 8080
monitor_address = "192.168.199.10"
monitor_port = 8080
weight = 10
admin_state_up = "true"
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
Expand All @@ -284,6 +298,8 @@ resource "openstack_lb_members_v2" "members_1" {
member {
address = "192.168.199.111"
protocol_port = 8080
monitor_address = "192.168.199.11"
monitor_port = 8080
weight = 15
admin_state_up = "true"
subnet_id = "${openstack_networking_subnet_v2.subnet_1.id}"
Expand Down

0 comments on commit 44696c5

Please sign in to comment.