-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from 21kyu/test/setup-e2e
test(e2e): setup e2e tests using kuttl
- Loading branch information
Showing
10 changed files
with
96 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,7 @@ Cargo.lock | |
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# Generated by Kuttl | ||
kubeconfig | ||
kind-logs-* |
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 |
---|---|---|
@@ -1,16 +1,21 @@ | ||
setup-kind-cluster: | ||
kind create cluster --config tests/e2e/kind-config.yaml | ||
build-image: | ||
cargo xtask build-ebpf | ||
cargo build --target $(uname -m)-unknown-linux-musl | ||
docker build --build-arg ARCH=$(uname -m) -t sinabro:test . | ||
|
||
setup-kind-cluster: build-image | ||
kind create cluster --config tests/e2e/kind-config.yaml | ||
kind load docker-image sinabro:test | ||
|
||
clean-kind-cluster: | ||
kind delete cluster | ||
|
||
deploy-agent: setup-kind-cluster | ||
kubectl apply -f tests/e2e/deploy-test/00-install.yaml | ||
kubectl apply -f tests/e2e/deploy-test/agent.yaml | ||
|
||
deploy-test-pods: deploy-agent | ||
kubectl taint nodes kind-control-plane node-role.kubernetes.io/control-plane- | ||
kubectl apply -f tests/e2e/deploy-test/01-test-pods.yaml | ||
kubectl apply -f tests/e2e/deploy-test/test-pods.yaml | ||
|
||
e2e-test: build-image | ||
kubectl kuttl test --config ./tests/kuttl-test.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,6 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
apply: | ||
- agent.yaml | ||
assert: | ||
- agent-assert.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,8 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
apply: | ||
- test-pods.yaml | ||
assert: | ||
- test-pods-assert.yaml | ||
commands: | ||
- command: kubectl taint nodes kind-control-plane node-role.kubernetes.io/control-plane- |
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,9 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: POD_IP=$(kubectl get pod nginx-master -n $NAMESPACE -o jsonpath='{.status.podIP}') && kubectl exec -n $NAMESPACE curl-worker -c curl -- curl $POD_IP | ||
- script: POD_IP=$(kubectl get pod nginx-worker -n $NAMESPACE -o jsonpath='{.status.podIP}') && kubectl exec -n $NAMESPACE curl-worker -c curl -- curl $POD_IP | ||
- script: POD_IP=$(kubectl get pod nginx-master -n $NAMESPACE -o jsonpath='{.status.podIP}') && kubectl exec -n $NAMESPACE curl-master -c curl -- curl $POD_IP | ||
- script: POD_IP=$(kubectl get pod nginx-worker -n $NAMESPACE -o jsonpath='{.status.podIP}') && kubectl exec -n $NAMESPACE curl-master -c curl -- curl $POD_IP | ||
- command: kubectl exec -n $NAMESPACE curl-worker -c curl -- curl google.com | ||
- command: kubectl exec -n $NAMESPACE curl-master -c curl -- curl google.com |
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,12 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: agent | ||
namespace: kube-system | ||
status: | ||
currentNumberScheduled: 2 | ||
desiredNumberScheduled: 2 | ||
numberAvailable: 2 | ||
numberMisscheduled: 0 | ||
numberReady: 2 | ||
updatedNumberScheduled: 2 |
File renamed without changes.
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,27 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: curl-worker | ||
status: | ||
phase: Running | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx-worker | ||
status: | ||
phase: Running | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: curl-master | ||
status: | ||
phase: Running | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx-master | ||
status: | ||
phase: Running |
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
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,12 @@ | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestSuite | ||
startKIND: true | ||
skipDelete: true | ||
kindConfig: ./tests/e2e/kind-config.yaml | ||
kindNodeCache: true | ||
kindContainers: | ||
- sinabro:test | ||
testDirs: | ||
- ./tests/e2e/ | ||
suppress: | ||
- events |