Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
ordered #1
Browse files Browse the repository at this point in the history
  • Loading branch information
kuritka committed Jan 20, 2023
1 parent 90ef068 commit 98cebe0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
22 changes: 21 additions & 1 deletion terratest/test/fo_lifecycle_3_clusters_ordered_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
func TestFailoverLifecycleOnThreeClustersOrdered(t *testing.T) {
const ingressPath1 = "./resources/ingress_fo3_ordered1.yaml"
// const ingressPath2 = "./resources/ingress_fo3_ordered2.yaml"
// const digHits = 10
const digHits = 10
// const wgetHits = 8
instanceEU, err := utils.NewWorkflow(t, terratest.Environment.EUCluster, terratest.Environment.EUClusterPort).
WithIngress(ingressPath1).
Expand Down Expand Up @@ -71,4 +71,24 @@ func TestFailoverLifecycleOnThreeClustersOrdered(t *testing.T) {
terratest.Environment.USCluster,
terratest.Environment.ZACluster)

t.Run("🇺🇸 Digging US,EU,ZA cluster, IPs of US are returned", func(t *testing.T) {
usClusterIPs := instanceUS.GetInfo().NodeIPs
ips := instanceEU.Tools().DigNCoreDNSAll(digHits)
require.True(t, utils.MapHasOnlyKeys(ips, usClusterIPs...))
ips = instanceUS.Tools().DigNCoreDNSAll(digHits)
require.True(t, utils.MapHasOnlyKeys(ips, usClusterIPs...))
ips = instanceZA.Tools().DigNCoreDNSAll(digHits)
require.True(t, utils.MapHasOnlyKeys(ips, usClusterIPs...))
})

t.Run("💀🇺🇸 Killing namespace on Primary US cluster", func(t *testing.T) {
zaClusterIPs := instanceZA.GetInfo().NodeIPs
instanceUS.Kill()
err = instanceEU.Resources().WaitUntilDNSEndpointContainsTargets(instanceEU.GetInfo().Host, zaClusterIPs)
require.NoError(t, err, "WARNING: If you running test locally, ensure the App with same host IS NOT running in forgotten namespaces")
err = instanceUS.Resources().WaitUntilDNSEndpointContainsTargets(instanceUS.GetInfo().Host, zaClusterIPs)
require.NoError(t, err, "WARNING: If you running test locally, ensure the App with same host IS NOT running in forgotten namespaces")
err = instanceZA.Resources().WaitUntilDNSEndpointContainsTargets(instanceZA.GetInfo().Host, zaClusterIPs)
require.NoError(t, err, "WARNING: If you running test locally, ensure the App with same host IS NOT running in forgotten namespaces")
})
}
2 changes: 1 addition & 1 deletion terratest/test/resources/ingress_fo3_ordered1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
spec:
ingressClassName: nginx
rules:
- host: terratest-fo-3.cloud.example.com
- host: terratest-fo-3-ordered1.cloud.example.com
http:
paths:
- backend:
Expand Down
2 changes: 1 addition & 1 deletion terratest/test/resources/ingress_fo3_ordered2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
spec:
ingressClassName: nginx
rules:
- host: terratest-fo-3.cloud.example.com
- host: terratest-fo-3-ordered2.cloud.example.com
http:
paths:
- backend:
Expand Down

0 comments on commit 98cebe0

Please sign in to comment.