-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
tests/bats-test-scripts/shed-kubectl-resources/shed-kubectl-resources.expected
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 +1,2 @@ | ||
hello-world | ||
hello-world-scalable |
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 @@ | ||
setup(){ | ||
load '../common-setup' | ||
common_setup | ||
} | ||
@test "k-scale" { | ||
run bash -ic 'k-scale' | ||
assert_success | ||
cat_expected "shed-kubectl-scale-usage" | assert_output - | ||
} | ||
@test "k-scale xxx" { | ||
run bash -ic 'k-scale xxx' | ||
assert_success | ||
cat_expected "shed-kubectl-scale-usage" | assert_output - | ||
} | ||
@test "k-scale 2 hello-world-scalable" { | ||
shed-kubectl-apply hello-world-scalable | ||
run bash -ic 'k-scale 2 deployments/hello-world-scalable' | ||
assert_success | ||
cat_expected "shed-kubectl-scale" | assert_output - | ||
shed-kubectl delete deployments/hello-world-scalable | ||
shed-kubectl wait --for delete pod --selector=app=hello-world-scalable --timeout 60s | ||
} |
1 change: 1 addition & 0 deletions
1
tests/bats-test-scripts/shed-kubectl-scale/shed-kubectl-scale-usage.expected
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 @@ | ||
Usage: shed-kubectl-scale replicas resourceName |
22 changes: 22 additions & 0 deletions
22
tests/bats-test-scripts/shed-kubectl-scale/shed-kubectl-scale.bats
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 @@ | ||
setup(){ | ||
load '../common-setup' | ||
common_setup | ||
} | ||
@test "shed-kubectl-scale" { | ||
run shed-kubectl-scale | ||
assert_success | ||
cat_expected "shed-kubectl-scale-usage" | assert_output - | ||
} | ||
@test "shed-kubectl-scale xxx" { | ||
run shed-kubectl-scale xxx | ||
assert_success | ||
cat_expected "shed-kubectl-scale-usage" | assert_output - | ||
} | ||
@test "shed-kubectl-scale 2 hello-world-scalable" { | ||
shed-kubectl-apply hello-world-scalable | ||
run shed-kubectl-scale 2 deployments/hello-world-scalable | ||
assert_success | ||
cat_expected "shed-kubectl-scale" | assert_output - | ||
shed-kubectl delete deployments/hello-world-scalable | ||
shed-kubectl wait --for delete pod --selector=app=hello-world-scalable --timeout 60s | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/bats-test-scripts/shed-kubectl-scale/shed-kubectl-scale.expected
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,2 @@ | ||
+ kubectl --context kube-dev-1 --namespace ns-application scale --replicas=2 deployments/hello-world-scalable | ||
deployment.apps/hello-world-scalable scaled |
22 changes: 22 additions & 0 deletions
22
tests/bats-test-scripts/shed-kubectl-scale/shed_kubectl-scale.bats
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 @@ | ||
setup(){ | ||
load '../common-setup' | ||
common_setup | ||
} | ||
@test "shed kubectl-scale" { | ||
run shed kubectl-scale | ||
assert_success | ||
cat_expected "shed-kubectl-scale-usage" | assert_output - | ||
} | ||
@test "shed kubectl-scale xxx" { | ||
run shed kubectl-scale xxx | ||
assert_success | ||
cat_expected "shed-kubectl-scale-usage" | assert_output - | ||
} | ||
@test "shed kubectl-scale 2 hello-world-scalable" { | ||
shed-kubectl-apply hello-world-scalable | ||
run shed kubectl-scale 2 deployments/hello-world-scalable | ||
assert_success | ||
cat_expected "shed-kubectl-scale" | assert_output - | ||
shed-kubectl delete deployments/hello-world-scalable | ||
shed-kubectl wait --for delete pod --selector=app=hello-world-scalable --timeout 60s | ||
} |
29 changes: 29 additions & 0 deletions
29
tests/resources/shed-config/kubectl-resources/hello-world-scalable/deployment.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,29 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: hello-world-scalable | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: hello-world-scalable | ||
template: | ||
metadata: | ||
labels: | ||
app: hello-world-scalable | ||
spec: | ||
containers: | ||
- image: busybox | ||
imagePullPolicy: IfNotPresent | ||
name: say-hello | ||
command: | ||
- bin/sh | ||
- -c | ||
- "while true; do echo 'Hello World!' ; sleep 2; done" | ||
resources: | ||
limits: | ||
cpu: 300m | ||
memory: 256Mi | ||
requests: | ||
cpu: 100m | ||
memory: 128Mi |