Skip to content

Commit

Permalink
Add test scenario for the new variables
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <rsevilla@redhat.com>
  • Loading branch information
rsevilla87 committed Nov 7, 2022
1 parent 5f287d2 commit 53f1117
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 38 deletions.
2 changes: 1 addition & 1 deletion cmd/kube-burner/kube-burner.go
Expand Up @@ -140,7 +140,7 @@ func initCmd() *cobra.Command {
cmd.Flags().StringVarP(&token, "token", "t", "", "Prometheus Bearer token")
cmd.Flags().StringVar(&username, "username", "", "Prometheus username for authentication")
cmd.Flags().StringVarP(&password, "password", "p", "", "Prometheus password for basic authentication")
cmd.Flags().StringVarP(&metricsProfile, "metrics-profile", "m", "metrics.yml", "Metrics profile file or URL")
cmd.Flags().StringVarP(&metricsProfile, "metrics-profile", "m", "", "Metrics profile file or URL")
cmd.Flags().StringVarP(&alertProfile, "alert-profile", "a", "", "Alert profile file or URL")
cmd.Flags().BoolVar(&skipTLSVerify, "skip-tls-verify", true, "Verify prometheus TLS certificate")
cmd.Flags().DurationVarP(&prometheusStep, "step", "s", 30*time.Second, "Prometheus step size")
Expand Down
51 changes: 51 additions & 0 deletions test/kube-burner-delete.yml
@@ -0,0 +1,51 @@
---

global:
writeToFile: true
metricsDirectory: collected-metrics
prometheusURL: http://localhost:9090
metricsProfile: metrics-profile.yaml
measurements:
- name: podLatency
esIndex: kube-burner

indexerConfig:
enabled: false

jobs:
- name: not-namespaced
jobType: create
jobIterations: {{randInteger 1 2}}
qps: {{randInt 5 6 }}
burst: 15
namespacedIterations: false
cleanup: true
namespace: not-namespaced
podWait: true
waitWhenFinished: false
verifyObjects: true
errorOnVerify: true
preLoadImages: false
maxWaitTimeout: 2m
objects:

- objectTemplate: objectTemplates/deployment.yml
replicas: 1
inputVars:
containerImage: gcr.io/google_containers/pause-amd64:3.0


- name: delete-job
jobType: delete
waitForDeletion: true
qps: 10
burst: 20
jobPause: 1ms
objects:

- kind: Deployment
labelSelector: {kube-burner-job: not-namespaced}
apiVersion: apps/v1

- kind: Namespace
labelSelector: {kube-burner-job: not-namespaced}
36 changes: 0 additions & 36 deletions test/kube-burner.yml
Expand Up @@ -40,39 +40,3 @@ jobs:
replicas: 1
inputVars:
containerImage: gcr.io/google_containers/pause-amd64:3.0

- name: not-namespaced
jobType: create
jobIterations: {{randInteger 1 2}}
qps: {{randInt 5 6 }}
burst: 15
namespacedIterations: false
cleanup: true
namespace: not-namespaced
podWait: true
waitWhenFinished: false
verifyObjects: true
errorOnVerify: true
maxWaitTimeout: 2m
objects:

- objectTemplate: objectTemplates/deployment.yml
replicas: 1
inputVars:
containerImage: gcr.io/google_containers/pause-amd64:3.0


- name: delete-job
jobType: delete
waitForDeletion: true
qps: 10
burst: 20
jobPause: 1ms
objects:

- kind: Deployment
labelSelector: {kube-burner-job: not-namespaced}
apiVersion: apps/v1

- kind: Namespace
labelSelector: {kube-burner-job: not-namespaced}
3 changes: 2 additions & 1 deletion test/run.sh
Expand Up @@ -53,8 +53,9 @@ log "Running kube-burner init"
timeout 500 kube-burner init -c kube-burner.yml --uuid ${uuid} --log-level=debug -u http://localhost:9090 -m metrics-profile.yaml -a alert-profile.yaml
check_files
check_ns kube-burner-job=namespaced,kube-burner-uuid=${uuid} 10
check_destroyed_ns kube-burner-job=not-namespaced,kube-burner-uuid=${uuid}
check_running_pods kube-burner-job=namespaced,kube-burner-uuid=${uuid} 10
timeout 500 kube-burner init -c kube-burner-delete.yml --uuid ${uuid} --log-level=debug
check_destroyed_ns kube-burner-job=not-namespaced,kube-burner-uuid=${uuid}
log "Running kube-burner destroy"
kube-burner destroy --uuid ${uuid}
check_destroyed_ns kube-burner-job=namespaced,kube-burner-uuid=${uuid}
Expand Down

0 comments on commit 53f1117

Please sign in to comment.