-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add acceptance tests that run connect tests for peering.
- Does not support TLS, ACLs and T-Proxy.
- Loading branch information
1 parent
2d2ab95
commit 339816b
Showing
14 changed files
with
438 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
acceptance/tests/fixtures/bases/peering/peering-acceptor.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: PeeringAcceptor | ||
metadata: | ||
name: server | ||
spec: | ||
peer: | ||
secret: | ||
name: "api-token" | ||
key: "data" | ||
backend: "kubernetes" |
10 changes: 10 additions & 0 deletions
10
acceptance/tests/fixtures/bases/peering/peering-dialer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: PeeringDialer | ||
metadata: | ||
name: client | ||
spec: | ||
peer: | ||
secret: | ||
name: "api-token" | ||
key: "data" | ||
backend: "kubernetes" |
5 changes: 5 additions & 0 deletions
5
acceptance/tests/fixtures/cases/crd-peers/default-namespace/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
resources: | ||
- ../../../bases/exportedservices-default | ||
|
||
patchesStrategicMerge: | ||
- patch.yaml |
10 changes: 10 additions & 0 deletions
10
acceptance/tests/fixtures/cases/crd-peers/default-namespace/patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: ExportedServices | ||
metadata: | ||
name: default | ||
spec: | ||
services: | ||
- name: static-server | ||
namespace: default | ||
consumers: | ||
- peer: client |
5 changes: 5 additions & 0 deletions
5
acceptance/tests/fixtures/cases/crd-peers/non-default-namespace/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
resources: | ||
- ../../../bases/exportedservices-default | ||
|
||
patchesStrategicMerge: | ||
- patch.yaml |
10 changes: 10 additions & 0 deletions
10
acceptance/tests/fixtures/cases/crd-peers/non-default-namespace/patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: consul.hashicorp.com/v1alpha1 | ||
kind: ExportedServices | ||
metadata: | ||
name: default | ||
spec: | ||
services: | ||
- name: static-server | ||
namespace: ns1 | ||
consumers: | ||
- peer: client |
5 changes: 5 additions & 0 deletions
5
acceptance/tests/fixtures/cases/static-client-peers/default-namespace/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
resources: | ||
- ../../../bases/static-client | ||
|
||
patchesStrategicMerge: | ||
- patch.yaml |
10 changes: 10 additions & 0 deletions
10
acceptance/tests/fixtures/cases/static-client-peers/default-namespace/patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: static-client | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
"consul.hashicorp.com/connect-inject": "true" | ||
"consul.hashicorp.com/connect-service-upstreams": "static-server.svc.default.ns.server.peer:1234" |
5 changes: 5 additions & 0 deletions
5
acceptance/tests/fixtures/cases/static-client-peers/non-default-namespace/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
resources: | ||
- ../../../bases/static-client | ||
|
||
patchesStrategicMerge: | ||
- patch.yaml |
10 changes: 10 additions & 0 deletions
10
acceptance/tests/fixtures/cases/static-client-peers/non-default-namespace/patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: static-client | ||
spec: | ||
template: | ||
metadata: | ||
annotations: | ||
"consul.hashicorp.com/connect-inject": "true" | ||
"consul.hashicorp.com/connect-service-upstreams": "static-server.svc.ns1.ns.server.peer:1234" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package peering | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"testing" | ||
|
||
testsuite "github.com/hashicorp/consul-k8s/acceptance/framework/suite" | ||
) | ||
|
||
var suite testsuite.Suite | ||
|
||
func TestMain(m *testing.M) { | ||
suite = testsuite.NewSuite(m) | ||
|
||
if suite.Config().EnableMultiCluster { | ||
os.Exit(suite.Run()) | ||
} else { | ||
fmt.Println("Skipping peering tests because -enable-multi-cluster is not set") | ||
os.Exit(0) | ||
} | ||
} |
Oops, something went wrong.