forked from litmuschaos/litmus-e2e
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
552 lines (418 loc) · 16.8 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
# Makefile for building litmus-e2e
# Reference Guide - https://www.gnu.org/software/make/manual/make.html
IS_DOCKER_INSTALLED = $(shell which docker >> /dev/null 2>&1; echo $$?)
# docker info
DOCKER_REPO ?= litmuschaos
DOCKER_IMAGE ?= litmus-e2e
DOCKER_TAG ?= ci
.PHONY: build-litmus
build-litmus:
@echo "----------------"
@echo "Building Litmus "
@echo "----------------"
@go test tests/install-litmus_test.go -v -count=1
.PHONY: app-deploy
app-deploy:
@echo "----------------------"
@echo "Deploying Application "
@echo "----------------------"
@go test tests/app-deploy_test.go -v -count=1
.PHONY: liveness
liveness:
@echo "----------------------"
@echo "Deploying Liveness Pod"
@echo "----------------------"
@go test tests/app-liveness_test.go -v -count=1
.PHONY: auxiliary-app
auxiliary-app:
@echo "-----------------------"
@echo "Deploying Auxiliary App"
@echo "-----------------------"
@go test tests/auxiliary-app_test.go -v -count=1
.PHONY: pod-delete
pod-delete:
@echo "-------------------------------"
@echo "Running pod-delete experiment"
@echo "--------------------------------"
@go test tests/pod-delete_test.go -v -count=1
.PHONY: container-kill
container-kill:
@echo "-------------------------------"
@echo "Running container-kill experiment"
@echo "--------------------------------"
@go test tests/container-kill_test.go -v -count=1
.PHONY: pod-network-latency
pod-network-latency:
@echo "--------------------------------------"
@echo "Running pod-network-latency experiment"
@echo "--------------------------------------"
@go test tests/pod-network-latency_test.go -v -count=1
.PHONY: pod-network-loss
pod-network-loss:
@echo "-----------------------------------"
@echo "Running pod-network-loss experiment"
@echo "-----------------------------------"
@go test tests/pod-network-loss_test.go -v -count=1
.PHONY: pod-network-corruption
pod-network-corruption:
@echo "-------------------------------"
@echo "Running pod-network-corruption experiment"
@echo "--------------------------------"
@go test tests/pod-network-corruption_test.go -v -count=1
.PHONY: pod-cpu-hog
pod-cpu-hog:
@echo "-------------------------------"
@echo "Running pod-cpu-hog experiment"
@echo "--------------------------------"
@go test tests/pod-cpu-hog_test.go -v -count=1
.PHONY: pod-cpu-hog-exec
pod-cpu-hog-exec:
@echo "-------------------------------"
@echo "Running pod-cpu-hog-exec experiment"
@echo "--------------------------------"
@go test tests/pod-cpu-hog-exec_test.go -v -count=1
.PHONY: node-cpu-hog
node-cpu-hog:
@echo "-------------------------------"
@echo "Running node-cpu-hog experiment"
@echo "--------------------------------"
@go test tests/node-cpu-hog_test.go -v -count=1
.PHONY: node-drain
node-drain:
@echo "---------------------------------"
@echo "Running node-drain experiment"
@echo "---------------------------------"
@go test tests/node-drain_test.go -v -count=1
.PHONY: disk-fill
disk-fill:
@echo "--------------------------------"
@echo "Running disk-fill experiment"
@echo "--------------------------------"
@go test tests/disk-fill_test.go -v -count=1
.PHONY: node-memory-hog
node-memory-hog:
@echo "----------------------------------"
@echo "Running node-memory-hog experiment"
@echo "----------------------------------"
@go test tests/node-memory-hog_test.go -v -count=1
.PHONY: pod-memory-hog
pod-memory-hog:
@echo "---------------------------------"
@echo "Running pod-memory-hog experiment"
@echo "---------------------------------"
@go test tests/pod-memory-hog_test.go -v -count=1
.PHONY: pod-memory-hog-exec
pod-memory-hog-exec:
@echo "---------------------------------"
@echo "Running pod-memory-hog-exec experiment"
@echo "---------------------------------"
@go test tests/pod-memory-hog-exec_test.go -v -count=1
.PHONY: kubelet-service-kill
kubelet-service-kill:
@echo "---------------------------------------"
@echo "Running kubelet-service-kill experiment"
@echo "---------------------------------------"
@go test tests/kubelet-service-kill_test.go -v -count=1
.PHONY: node-taint
node-taint:
@echo "---------------------------------------"
@echo "Running node-taint experiment"
@echo "---------------------------------------"
@go test tests/node-taint_test.go -v -count=1
.PHONY: pod-network-duplication
pod-network-duplication:
@echo "------------------------------------------"
@echo "Running pod-network-duplication experiment"
@echo "------------------------------------------"
@go test tests/pod-network-duplication_test.go -v -count=1
.PHONY: pod-autoscaler
pod-autoscaler:
@echo "------------------------------------------"
@echo "Running pod-autoscaler experiment"
@echo "------------------------------------------"
@go test tests/pod-autoscaler_test.go -v -count=1
.PHONY: pod-io-stress
pod-io-stress:
@echo "------------------------------------------"
@echo "Running pod-io-stress experiment"
@echo "------------------------------------------"
@go test tests/pod-io-stress_test.go -v -count=1
.PHONY: node-io-stress
node-io-stress:
@echo "------------------------------------------"
@echo "Running node-io-stress experiment"
@echo "------------------------------------------"
@go test tests/node-io-stress_test.go -v -count=1
.PHONY: ec2-terminate-by-id
ec2-terminate-by-id:
@echo "------------------------------------------"
@echo "Running ec2-terminate-by-id experiment"
@echo "------------------------------------------"
@go test platform/aws/ec2-terminate-by-id_test.go -v -count=1 -timeout=20m
.PHONY: ec2-terminate-by-tag
ec2-terminate-by-tag:
@echo "------------------------------------------"
@echo "Running ec2-terminate-by-tag experiment"
@echo "------------------------------------------"
@go test platform/aws/ec2-terminate-by-tag_test.go -v -count=1 -timeout=20m
.PHONY: ebs-loss-by-id
ebs-loss-by-id:
@echo "------------------------------------------"
@echo "Running ebs-loss-by-id experiment"
@echo "------------------------------------------"
@go test platform/aws/ebs-loss-by-id_test.go -v -count=1 -timeout=20m
.PHONY: ebs-loss-by-tag
ebs-loss-by-tag:
@echo "------------------------------------------"
@echo "Running ebs-loss-by-tag experiment"
@echo "------------------------------------------"
@go test platform/aws/ebs-loss-by-tag_test.go -v -count=1 -timeout=20m
.PHONY: gcp-vm-instance-stop
gcp-vm-instance-stop:
@echo "------------------------------------------"
@echo "Running gcp-vm-instance-stop experiment"
@echo "------------------------------------------"
@go test platform/gcp/gcp-vm-instance-stop_test.go -v -count=1 -timeout=20m
.PHONY: gcp-vm-disk-loss
gcp-vm-disk-loss:
@echo "------------------------------------------"
@echo "Running gcp-vm-disk-loss experiment"
@echo "------------------------------------------"
@go test platform/gcp/gcp-vm-disk-loss_test.go -v -count=1 -timeout=20m
.PHONY: vm-poweroff
vm-poweroff:
@echo "------------------------------------------"
@echo "Running vm-poweroff experiment"
@echo "------------------------------------------"
@go test platform/vmware/vm-poweroff_test.go -v -count=1 -timeout=20m
.PHONY: operator-reconcile-resiliency-check
operator-reconcile-resiliency-check:
@echo "--------------------------------------------"
@echo "Running Operator Reconcile Resiliency Check"
@echo "--------------------------------------------"
@go test components/operator/reconcile-resiliency_test.go -v -count=1
.PHONY: admin-mode-check
admin-mode-check:
@echo "------------------------"
@echo "Running Admin Mode Check"
@echo "------------------------"
@go test components/operator/admin-mode_test.go -v -count=1
.PHONY: with-app-info
with-app-info:
@echo "-----------------------------"
@echo "Running With App info test"
@echo "-----------------------------"
@go test tests/with-appinfo_test.go -v -count=1 -timeout=30m
.PHONY: pod-affected-perc-ton-parallel
pod-affected-perc-ton-parallel:
@echo "------------------------------------------------------------"
@echo "Running pod affected percentage 100 and sequence as parallel"
@echo "------------------------------------------------------------"
@go test tests/pod-affected-perc-ton-parallel_test.go -v -count=1 -timeout=30m
.PHONY: pod-affected-perc-ton-series
pod-affected-perc-ton-series:
@echo "----------------------------------------------------------"
@echo "Running pod affected percentage 100 and sequence as series"
@echo "----------------------------------------------------------"
@go test tests/pod-affected-perc-ton-series_test.go -v -count=1 -timeout=30m
.PHONY: multiple-app-deploy
multiple-app-deploy:
@echo "------------------------------------------------"
@echo "Running Pod Level Chaos With Multiple app deploy"
@echo "------------------------------------------------"
@go test tests/multiple-app-deploy_test.go -v -count=1 -timeout=30m
.PHONY: run-history
run-history:
@echo "------------------------------------------------"
@echo "Running Run History Check"
@echo "------------------------------------------------"
@go test components/result/run-history_test.go -v -count=1
.PHONY: node-selector
node-selector:
@echo "-----------------------------------"
@echo "Running Node Selector Check"
@echo "-----------------------------------"
@go test tests/node-selector_test.go -v -count=1
.PHONY: env-from-secret-and-configmap
env-from-secret-and-configmap:
@echo "------------------------------------------------------"
@echo "Running Pod Delete Chaos ENV from Secret and ConfigMap"
@echo "------------------------------------------------------"
@go test tests/env-from-secret-and-cm_test.go -v -count=1
.PHONY: app-cleanup
app-cleanup:
@echo "--------------------"
@echo "Deleting Application "
@echo "--------------------"
@go test tests/app-cleanup_test.go -v -count=1
.PHONY: litmus-cleanup
litmus-cleanup:
@echo "--------------------"
@echo "Deleting litmus "
@echo "--------------------"
@go test tests/litmus-cleanup_test.go -v -count=1
.PHONY: pipeline-status-update
pipeline-status-update:
@echo "------------------------"
@echo "Updating Pipeline Status"
@echo "------------------------"
@go test tests/pipeline-update_test.go -v -count=1
.PHONY: deps
deps: _build_check_docker godeps docker-build
_build_check_docker:
@if [ $(IS_DOCKER_INSTALLED) -eq 1 ]; \
then echo "" \
&& echo "ERROR:\tdocker is not installed. Please install it before build." \
&& echo "" \
&& exit 1; \
fi;
godeps:
@echo "INFO:\tverifying dependencies for litmus-e2e build ..."
@go get -u -v golang.org/x/lint/golint
@go get -u -v golang.org/x/tools/cmd/goimports
docker-build:
@echo "----------------------------"
@echo "--> Build litmus-e2e image"
@echo "----------------------------"
# Dockerfile available in the repo root
docker build . -f build/Dockerfile -t $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG)
.PHONY: save
save: docker-save
docker-save:
@echo "---------------------------"
@echo "--> Saving litmus-e2e image"
@echo "---------------------------"
@docker save -o $(SAVE_PATH)/image.tar $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG)
.PHONY: push
push: docker-push
docker-push:
@echo "---------------------------"
@echo "--> Push litmus-e2e image"
@echo "---------------------------"
REPONAME="$(DOCKER_REPO)" IMGNAME="$(DOCKER_IMAGE)" IMGTAG="$(DOCKER_TAG)" ./build/push
#################################################################################
################# Ansible Experiment BDDS #################
#################################################################################
.PHONY: ansible-pod-delete
ansible-pod-delete:
@echo "-------------------------------------"
@echo "Running Ansible Pod Delete Experiment"
@echo "-------------------------------------"
@go test ansible/ansible-pod-delete_test.go -v -count=1
.PHONY: ansible-container-kill
ansible-container-kill:
@echo "-------------------------------------"
@echo "Running Ansible Container Kill Experiment"
@echo "-------------------------------------"
@go test ansible/ansible-container-kill_test.go -v -count=1
.PHONY: ansible-disk-fill
ansible-disk-fill:
@echo "-------------------------------------"
@echo "Running Ansible disk fill Experiment"
@echo "-------------------------------------"
@go test ansible/ansible-disk-fill_test.go -v -count=1
.PHONY: ansible-node-cpu-hog
ansible-node-cpu-hog:
@echo "---------------------------------------"
@echo "Running Ansible Node CPU Hog Experiment"
@echo "---------------------------------------"
@go test ansible/ansible-node-cpu-hog_test.go -v -count=1
.PHONY: ansible-node-memory-hog
ansible-node-memory-hog:
@echo "------------------------------------------"
@echo "Running Ansible Node Memory Hog Experiment"
@echo "------------------------------------------"
@ansible/ansible-node-memory-hog_test.go -v -count=1
.PHONY: ansible-pod-cpu-hog
ansible-pod-cpu-hog:
@echo "--------------------------------------"
@echo "Running Ansible Pod CPU Hog Experiment"
@echo "--------------------------------------"
@go test ansible/ansible-pod-cpu-hog_test.go -v -count=1
.PHONY: ansible-pod-memory-hog
ansible-pod-memory-hog:
@echo "-----------------------------------------"
@echo "Running Ansible Pod Memory Hog Experiment"
@echo "-----------------------------------------"
@go test ansible/ansible-pod-memory-hog_test.go -v -count=1
.PHONY: ansible-pod-network-corruption
ansible-pod-network-corruption:
@echo "-------------------------------------------------"
@echo "Running Ansible Pod Network Corruption Experiment"
@echo "-------------------------------------------------"
@go test ansible/ansible-pod-network-corruption_test.go -v -count=1
.PHONY: ansible-pod-network-latency
ansible-pod-network-latency:
@echo "----------------------------------------------"
@echo "Running Ansible Pod Network Latency Experiment"
@echo "----------------------------------------------"
@go test ansible/ansible-pod-network-latency_test.go -v -count=1
.PHONY: ansible-pod-network-loss
ansible-pod-network-loss:
@echo "-------------------------------------------"
@echo "Running Ansible Pod Network Loss Experiment"
@echo "-------------------------------------------"
@go test ansible/ansible-pod-network-loss_test.go -v -count=1
.PHONY: ansible-kubelet-service-kill
ansible-kubelet-service-kill:
@echo "-----------------------------------------------"
@echo "Running Ansible Kubelet Service Kill Experiment"
@echo "-----------------------------------------------"
@go test ansible/ansible-kubelet-service-kill_test.go -v -count=1
.PHONY: ansible-node-drain
ansible-node-drain:
@echo "-------------------------------------"
@echo "Running Ansible Node Drain Experiment"
@echo "-------------------------------------"
@go test ansible/ansible-node-drain_test.go -v -count=1
######################
### NEGATIVE TESTS ###
######################
.PHONY: annotation-check
annotation-check:
@echo "-----------------------------------------"
@echo "Running Annotation Check For Chaos Engine"
@echo "-----------------------------------------"
@go test components/engine/annotation-check_test.go -v -count=1
.PHONY: appinfo
appinfo:
@echo "---------------------------------------"
@echo "Running App Info Check For Chaos Engine"
@echo "---------------------------------------"
@go test components/engine/appinfo_test.go -v -count=1
.PHONY: engine-state
engine-state:
@echo "---------------------------------------"
@echo "Running App Info Check For Chaos Engine"
@echo "---------------------------------------"
@go test components/engine/engine-state_test.go -v -count=1
.PHONY: experiment-404
experiment-404:
@echo "----------------------------------------------"
@echo "Running Experiment Name Check For Chaos Engine"
@echo "----------------------------------------------"
@go test components/engine/experiment-404_test.go -v -count=1
.PHONY: job-cleanup-policy
job-cleanup-policy:
@echo "-------------------------------------------------"
@echo "Running Job Cleanup Policy Check For Chaos Engine"
@echo "-------------------------------------------------"
@go test components/engine/job-cleanup-policy_test.go -v -count=1
.PHONY: service-account
service-account:
@echo "----------------------------------------------"
@echo "Running Service Account Check For Chaos Engine"
@echo "----------------------------------------------"
@go test components/engine/service-account_test.go -v -count=1
.PHONY: experiment-image
experiment-image:
@echo "---------------------------------------------------"
@echo "Running Experiment Image Check For Chaos Experiment"
@echo "---------------------------------------------------"
@go test components/experiment/experiment-image_test.go -v -count=1
.PHONY: target-pod
target-pod:
@echo "-----------------------------"
@echo "Running Target pod chaos test"
@echo "-----------------------------"
@go test components/experiment/target-pod_test.go -v -count=1