Skip to content

Commit ebcec58

Browse files
committed
test: restructuring enable default user tests to have a 4 step comprehensive check for all transitions
1 parent fcafeea commit ebcec58

7 files changed

+131
-226
lines changed

provider/activeactive/testdata/enable_default_user_global_false_region_true.tf

Lines changed: 0 additions & 57 deletions
This file was deleted.

provider/activeactive/testdata/enable_default_user_global_true_inherit.tf

Lines changed: 0 additions & 55 deletions
This file was deleted.

provider/activeactive/testdata/enable_default_user_all_explicit.tf renamed to provider/activeactive/testdata/enable_default_user_step1_global_true_mixed.tf

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ resource "rediscloud_active_active_subscription" "example" {
3232
write_operations_per_second = 1000
3333
read_operations_per_second = 1000
3434
}
35+
36+
region {
37+
region = "eu-west-2"
38+
networking_deployment_cidr = "10.2.0.0/24"
39+
write_operations_per_second = 1000
40+
read_operations_per_second = 1000
41+
}
3542
}
3643
}
3744

@@ -44,16 +51,20 @@ resource "rediscloud_active_active_subscription_database" "example" {
4451
global_enable_default_user = true
4552
global_password = local.password
4653

47-
# us-east-1 explicitly set to true (matches global but is EXPLICIT)
48-
# This tests that explicit values are preserved even when matching global
54+
# us-east-1: explicitly set to true (matches global)
4955
override_region {
5056
name = "us-east-1"
5157
enable_default_user = true
5258
}
5359

54-
# us-east-2 explicitly set to false (differs from global)
60+
# us-east-2: explicitly set to false (differs from global)
5561
override_region {
5662
name = "us-east-2"
5763
enable_default_user = false
5864
}
65+
66+
# eu-west-2: NOT set (inherits from global=true)
67+
override_region {
68+
name = "eu-west-2"
69+
}
5970
}

provider/activeactive/testdata/enable_default_user_global_false_region_false.tf renamed to provider/activeactive/testdata/enable_default_user_step2_global_false_mixed.tf

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ resource "rediscloud_active_active_subscription" "example" {
3232
write_operations_per_second = 1000
3333
read_operations_per_second = 1000
3434
}
35+
36+
region {
37+
region = "eu-west-2"
38+
networking_deployment_cidr = "10.2.0.0/24"
39+
write_operations_per_second = 1000
40+
read_operations_per_second = 1000
41+
}
3542
}
3643
}
3744

@@ -44,14 +51,20 @@ resource "rediscloud_active_active_subscription_database" "example" {
4451
global_enable_default_user = false
4552
global_password = local.password
4653

47-
# us-east-1 explicitly set to false (matches global but is EXPLICIT)
54+
# us-east-1: explicitly set to true (differs from global)
4855
override_region {
4956
name = "us-east-1"
57+
enable_default_user = true
58+
}
59+
60+
# us-east-2: explicitly set to false (matches global)
61+
override_region {
62+
name = "us-east-2"
5063
enable_default_user = false
5164
}
5265

53-
# us-east-2 inherits from global (false) - NO enable_default_user specified
66+
# eu-west-2: NOT set (inherits from global=false)
5467
override_region {
55-
name = "us-east-2"
68+
name = "eu-west-2"
5669
}
5770
}

provider/activeactive/testdata/enable_default_user_global_false_inherit.tf renamed to provider/activeactive/testdata/enable_default_user_step3_all_inherit.tf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ resource "rediscloud_active_active_subscription" "example" {
3232
write_operations_per_second = 1000
3333
read_operations_per_second = 1000
3434
}
35+
36+
region {
37+
region = "eu-west-2"
38+
networking_deployment_cidr = "10.2.0.0/24"
39+
write_operations_per_second = 1000
40+
read_operations_per_second = 1000
41+
}
3542
}
3643
}
3744

@@ -44,12 +51,17 @@ resource "rediscloud_active_active_subscription_database" "example" {
4451
global_enable_default_user = false
4552
global_password = local.password
4653

47-
# Both regions inherit from global - NO enable_default_user specified
54+
# All regions inherit from global - NO enable_default_user specified
55+
# This tests the REMOVAL scenario: Step 2 had explicit values, now removed
4856
override_region {
4957
name = "us-east-1"
5058
}
5159

5260
override_region {
5361
name = "us-east-2"
5462
}
63+
64+
override_region {
65+
name = "eu-west-2"
66+
}
5567
}

provider/activeactive/testdata/enable_default_user_global_true_region_false.tf renamed to provider/activeactive/testdata/enable_default_user_step4_one_explicit.tf

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ resource "rediscloud_active_active_subscription" "example" {
3232
write_operations_per_second = 1000
3333
read_operations_per_second = 1000
3434
}
35+
36+
region {
37+
region = "eu-west-2"
38+
networking_deployment_cidr = "10.2.0.0/24"
39+
write_operations_per_second = 1000
40+
read_operations_per_second = 1000
41+
}
3542
}
3643
}
3744

@@ -44,14 +51,20 @@ resource "rediscloud_active_active_subscription_database" "example" {
4451
global_enable_default_user = true
4552
global_password = local.password
4653

47-
# us-east-1 explicitly disables default user (differs from global)
54+
# us-east-1: explicitly set to false (differs from global)
55+
# This tests the ADDITION scenario: Step 3 had all inherit, now adding explicit
4856
override_region {
4957
name = "us-east-1"
5058
enable_default_user = false
5159
}
5260

53-
# us-east-2 inherits from global - NO enable_default_user specified
61+
# us-east-2: NOT set (inherits from global=true)
5462
override_region {
5563
name = "us-east-2"
5664
}
65+
66+
# eu-west-2: NOT set (inherits from global=true)
67+
override_region {
68+
name = "eu-west-2"
69+
}
5770
}

0 commit comments

Comments
 (0)