diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 266457af..a8779021 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,14 +68,14 @@ jobs: yq -i '.kraken.port="8081"' CI/config/common_test_config.yaml yq -i '.kraken.signal_address="0.0.0.0"' CI/config/common_test_config.yaml yq -i '.kraken.performance_monitoring="localhost:9090"' CI/config/common_test_config.yaml - echo "test_app_outages" > ./CI/tests/my_tests - echo "test_container" >> ./CI/tests/my_tests - echo "test_namespace" >> ./CI/tests/my_tests - echo "test_net_chaos" >> ./CI/tests/my_tests - echo "test_time" >> ./CI/tests/my_tests - echo "test_arca_cpu_hog" >> ./CI/tests/my_tests - echo "test_arca_memory_hog" >> ./CI/tests/my_tests - echo "test_arca_io_hog" >> ./CI/tests/my_tests + echo "test_app_outages" > ./CI/tests/functional_tests + echo "test_container" >> ./CI/tests/functional_tests + echo "test_namespace" >> ./CI/tests/functional_tests + echo "test_net_chaos" >> ./CI/tests/functional_tests + echo "test_time" >> ./CI/tests/functional_tests + echo "test_arca_cpu_hog" >> ./CI/tests/functional_tests + echo "test_arca_memory_hog" >> ./CI/tests/functional_tests + echo "test_arca_io_hog" >> ./CI/tests/functional_tests - name: Run Functional tests run: | ./CI/run.sh diff --git a/.gitignore b/.gitignore index 14083467..c510e7ea 100644 --- a/.gitignore +++ b/.gitignore @@ -61,7 +61,7 @@ inspect.local.* !CI/config/common_test_config.yaml CI/out/* CI/ci_results -CI/scenarios/*node.yaml +CI/legacy/*node.yaml CI/results.markdown #env diff --git a/CI/README.md b/CI/README.md index b31fbd4b..4257af5d 100644 --- a/CI/README.md +++ b/CI/README.md @@ -1,7 +1,7 @@ ## CI Tests ### First steps -Edit [my_tests](tests/my_tests) with tests you want to run +Edit [functional_tests](tests/functional_tests) with tests you want to run ### How to run ```./CI/run.sh``` @@ -11,7 +11,7 @@ This will run kraken using python, make sure python3 is set up and configured pr ### Adding a test case -1. Add in simple scenario yaml file to execute under [../CI/scenarios/](scenarios) +1. Add in simple scenario yaml file to execute under [../CI/scenarios/](legacy) 2. Copy [test_application_outages.sh](tests/test_app_outages.sh) for example on how to get started @@ -27,7 +27,7 @@ This will run kraken using python, make sure python3 is set up and configured pr e. 15: Make sure name of config in line 14 matches what you pass on this line -4. Add test name to [my_tests](../CI/tests/my_tests) file +4. Add test name to [functional_tests](../CI/tests/functional_tests) file a. This will be the name of the file without ".sh" diff --git a/CI/scenarios/cluster_shut_down_scenario.yml b/CI/legacy/scenarios/cluster_shut_down_scenario.yml similarity index 100% rename from CI/scenarios/cluster_shut_down_scenario.yml rename to CI/legacy/scenarios/cluster_shut_down_scenario.yml diff --git a/CI/scenarios/node_scenario.yml b/CI/legacy/scenarios/node_scenario.yml similarity index 100% rename from CI/scenarios/node_scenario.yml rename to CI/legacy/scenarios/node_scenario.yml diff --git a/CI/scenarios/volume_scenario.yaml b/CI/legacy/scenarios/volume_scenario.yaml similarity index 100% rename from CI/scenarios/volume_scenario.yaml rename to CI/legacy/scenarios/volume_scenario.yaml diff --git a/CI/scenarios/zone_outage.yaml b/CI/legacy/scenarios/zone_outage.yaml similarity index 100% rename from CI/scenarios/zone_outage.yaml rename to CI/legacy/scenarios/zone_outage.yaml diff --git a/CI/scenarios/zone_outage_env.yaml b/CI/legacy/scenarios/zone_outage_env.yaml similarity index 100% rename from CI/scenarios/zone_outage_env.yaml rename to CI/legacy/scenarios/zone_outage_env.yaml diff --git a/CI/tests/test_nodes.sh b/CI/legacy/tests/test_nodes.sh similarity index 100% rename from CI/tests/test_nodes.sh rename to CI/legacy/tests/test_nodes.sh diff --git a/CI/tests/test_shut_down.sh b/CI/legacy/tests/test_shut_down.sh similarity index 100% rename from CI/tests/test_shut_down.sh rename to CI/legacy/tests/test_shut_down.sh diff --git a/CI/tests/test_zone.sh b/CI/legacy/tests/test_zone.sh similarity index 100% rename from CI/tests/test_zone.sh rename to CI/legacy/tests/test_zone.sh diff --git a/CI/run.sh b/CI/run.sh index bea719a4..e3bd9e8f 100755 --- a/CI/run.sh +++ b/CI/run.sh @@ -17,7 +17,7 @@ wait_cluster_become_ready() { -ci_tests_loc="CI/tests/my_tests" +ci_tests_loc="CI/tests/functional_tests" echo -e "********* Running Functional Tests Suite *********\n\n" @@ -37,7 +37,7 @@ echo '-----------------------|--------|---------' >> $results # Run each test failed_tests=() -for test_name in `cat CI/tests/my_tests` +for test_name in `cat CI/tests/functional_tests` do wait_cluster_become_ready return_value=`./CI/run_test.sh $test_name $results` diff --git a/CI/scenarios/app_outage.yaml b/CI/scenarios/app_outage.yaml deleted file mode 100644 index 13b651c2..00000000 --- a/CI/scenarios/app_outage.yaml +++ /dev/null @@ -1,5 +0,0 @@ -application_outage: # Scenario to create an outage of an application by blocking traffic - duration: 10 # Duration in seconds after which the routes will be accessible - namespace: openshift-monitoring # Namespace to target - all application routes will go inaccessible if pod selector is empty - pod_selector: {} # Pods to target - block: [Ingress, Egress] # It can be Ingress or Egress or Ingress, Egress diff --git a/CI/scenarios/arcaflow/cpu-hog/config.yaml b/CI/scenarios/arcaflow/cpu-hog/config.yaml deleted file mode 100644 index de4837f2..00000000 --- a/CI/scenarios/arcaflow/cpu-hog/config.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -deployers: - image: - connection: {} - deployer_name: kubernetes -log: - level: debug -logged_outputs: - error: - level: error - success: - level: debug diff --git a/CI/scenarios/arcaflow/cpu-hog/input.yaml b/CI/scenarios/arcaflow/cpu-hog/input.yaml deleted file mode 100644 index 1ec98984..00000000 --- a/CI/scenarios/arcaflow/cpu-hog/input.yaml +++ /dev/null @@ -1,9 +0,0 @@ -input_list: -- cpu_count: 1 - cpu_load_percentage: 80 - cpu_method: all - duration: 1s - kubeconfig: '' - namespace: default - node_selector: - kubernetes.io/hostname: kind-worker2 diff --git a/CI/scenarios/arcaflow/cpu-hog/sub-workflow.yaml b/CI/scenarios/arcaflow/cpu-hog/sub-workflow.yaml deleted file mode 100644 index 8ad4ee23..00000000 --- a/CI/scenarios/arcaflow/cpu-hog/sub-workflow.yaml +++ /dev/null @@ -1,98 +0,0 @@ -version: v0.2.0 -input: - root: RootObject - objects: - RootObject: - id: input_item - properties: - kubeconfig: - display: - description: The complete kubeconfig file as a string - name: Kubeconfig file contents - type: - type_id: string - required: true - namespace: - display: - description: The namespace where the container will be deployed - name: Namespace - type: - type_id: string - required: true - node_selector: - display: - description: kubernetes node name where the plugin must be deployed - type: - type_id: map - values: - type_id: string - keys: - type_id: string - required: true - duration: - display: - name: duration the scenario expressed in seconds - description: stop stress test after T seconds. One can also specify the units of time in - seconds, minutes, hours, days or years with the suffix s, m, h, d or y - type: - type_id: string - required: true - cpu_count: - display: - description: Number of CPU cores to be used (0 means all) - name: number of CPUs - type: - type_id: integer - required: true - cpu_method: - display: - description: CPU stress method - name: fine grained control of which cpu stressors to use (ackermann, cfloat etc.) - type: - type_id: string - required: true - cpu_load_percentage: - display: - description: load CPU by percentage - name: CPU load - type: - type_id: integer - required: true - -steps: - kubeconfig: - plugin: - src: quay.io/arcalot/arcaflow-plugin-kubeconfig:0.2.0 - deployment_type: image - input: - kubeconfig: !expr $.input.kubeconfig - stressng: - plugin: - src: quay.io/arcalot/arcaflow-plugin-stressng:0.5.0 - deployment_type: image - step: workload - input: - cleanup: "true" - StressNGParams: - timeout: !expr $.input.duration - stressors: - - stressor: cpu - cpu_count: !expr $.input.cpu_count - cpu_method: !expr $.input.cpu_method - cpu_load: !expr $.input.cpu_load_percentage - deploy: - deployer_name: kubernetes - connection: !expr $.steps.kubeconfig.outputs.success.connection - pod: - metadata: - namespace: !expr $.input.namespace - labels: - arcaflow: stressng - spec: - nodeSelector: !expr $.input.node_selector - pluginContainer: - imagePullPolicy: Always -outputs: - success: - stressng: !expr $.steps.stressng.outputs.success - diff --git a/CI/scenarios/arcaflow/cpu-hog/workflow.yaml b/CI/scenarios/arcaflow/cpu-hog/workflow.yaml deleted file mode 100644 index aea9ae26..00000000 --- a/CI/scenarios/arcaflow/cpu-hog/workflow.yaml +++ /dev/null @@ -1,77 +0,0 @@ -version: v0.2.0 -input: - root: RootObject - objects: - RootObject: - id: RootObject - properties: - input_list: - type: - type_id: list - items: - id: input_item - type_id: object - properties: - kubeconfig: - display: - description: The complete kubeconfig file as a string - name: Kubeconfig file contents - type: - type_id: string - required: true - namespace: - display: - description: The namespace where the container will be deployed - name: Namespace - type: - type_id: string - required: true - node_selector: - display: - description: kubernetes node name where the plugin must be deployed - type: - type_id: map - values: - type_id: string - keys: - type_id: string - required: true - duration: - display: - name: duration the scenario expressed in seconds - description: stop stress test after T seconds. One can also specify the units of time in - seconds, minutes, hours, days or years with the suffix s, m, h, d or y - type: - type_id: string - required: true - cpu_count: - display: - description: Number of CPU cores to be used (0 means all) - name: number of CPUs - type: - type_id: integer - required: true - cpu_method: - display: - description: CPU stress method - name: fine grained control of which cpu stressors to use (ackermann, cfloat etc.) - type: - type_id: string - required: true - cpu_load_percentage: - display: - description: load CPU by percentage - name: CPU load - type: - type_id: integer - required: true -steps: - workload_loop: - kind: foreach - items: !expr $.input.input_list - workflow: sub-workflow.yaml - parallelism: 1000 -outputs: - success: - workloads: !expr $.steps.workload_loop.outputs.success.data - diff --git a/CI/scenarios/arcaflow/io-hog/config.yaml b/CI/scenarios/arcaflow/io-hog/config.yaml deleted file mode 100644 index 20195f38..00000000 --- a/CI/scenarios/arcaflow/io-hog/config.yaml +++ /dev/null @@ -1,11 +0,0 @@ -deployers: - image: - connection: {} - deployer_name: kubernetes -log: - level: debug -logged_outputs: - error: - level: error - success: - level: debug diff --git a/CI/scenarios/arcaflow/io-hog/input.yaml b/CI/scenarios/arcaflow/io-hog/input.yaml deleted file mode 100644 index 78c6f544..00000000 --- a/CI/scenarios/arcaflow/io-hog/input.yaml +++ /dev/null @@ -1,14 +0,0 @@ -input_list: -- duration: 30s - io_block_size: 1m - io_workers: 1 - io_write_bytes: 10m - kubeconfig: '' - namespace: default - node_selector: - kubernetes.io/hostname: kind-worker2 - target_pod_folder: /hog-data - target_pod_volume: - hostPath: - path: /tmp - name: node-volume diff --git a/CI/scenarios/arcaflow/io-hog/sub-workflow.yaml b/CI/scenarios/arcaflow/io-hog/sub-workflow.yaml deleted file mode 100644 index 516af174..00000000 --- a/CI/scenarios/arcaflow/io-hog/sub-workflow.yaml +++ /dev/null @@ -1,142 +0,0 @@ -version: v0.2.0 -input: - root: RootObject - objects: - hostPath: - id: HostPathVolumeSource - properties: - path: - type: - type_id: string - Volume: - id: Volume - properties: - name: - type: - type_id: string - hostPath: - type: - id: hostPath - type_id: ref - RootObject: - id: input_item - properties: - kubeconfig: - display: - description: The complete kubeconfig file as a string - name: Kubeconfig file contents - type: - type_id: string - required: true - namespace: - display: - description: The namespace where the container will be deployed - name: Namespace - type: - type_id: string - required: true - node_selector: - display: - description: kubernetes node name where the plugin must be deployed - type: - type_id: map - values: - type_id: string - keys: - type_id: string - required: true - duration: - display: - name: duration the scenario expressed in seconds - description: stop stress test after T seconds. One can also specify the units of time in - seconds, minutes, hours, days or years with the suffix s, m, h, d or y - type: - type_id: string - required: true - io_workers: - display: - description: number of workers - name: start N workers continually writing, reading and removing temporary files - type: - type_id: integer - required: true - io_block_size: - display: - description: single write size - name: specify size of each write in bytes. Size can be from 1 byte to 4MB. - type: - type_id: string - required: true - io_write_bytes: - display: - description: Total number of bytes written - name: write N bytes for each hdd process, the default is 1 GB. One can specify the size - as % of free space on the file system or in units of Bytes, KBytes, MBytes and - GBytes using the suffix b, k, m or g - type: - type_id: string - required: true - target_pod_folder: - display: - description: Target Folder - name: Folder in the pod where the test will be executed and the test files will be written - type: - type_id: string - required: true - target_pod_volume: - display: - name: kubernetes volume definition - description: the volume that will be attached to the pod. In order to stress - the node storage only hosPath mode is currently supported - type: - type_id: ref - id: Volume - required: true - -steps: - kubeconfig: - plugin: - src: quay.io/arcalot/arcaflow-plugin-kubeconfig:0.2.0 - deployment_type: image - input: - kubeconfig: !expr $.input.kubeconfig - stressng: - plugin: - src: quay.io/arcalot/arcaflow-plugin-stressng:0.5.0 - deployment_type: image - step: workload - input: - cleanup: "true" - StressNGParams: - timeout: !expr $.input.duration - workdir: !expr $.input.target_pod_folder - stressors: - - stressor: hdd - hdd: !expr $.input.io_workers - hdd_bytes: !expr $.input.io_write_bytes - hdd_write_size: !expr $.input.io_block_size - - deploy: - deployer_name: kubernetes - connection: !expr $.steps.kubeconfig.outputs.success.connection - pod: - metadata: - namespace: !expr $.input.namespace - labels: - arcaflow: stressng - spec: - nodeSelector: !expr $.input.node_selector - pluginContainer: - imagePullPolicy: Always - securityContext: - privileged: true - volumeMounts: - - mountPath: /hog-data - name: node-volume - volumes: - - !expr $.input.target_pod_volume - -outputs: - success: - stressng: !expr $.steps.stressng.outputs.success - diff --git a/CI/scenarios/arcaflow/io-hog/workflow.yaml b/CI/scenarios/arcaflow/io-hog/workflow.yaml deleted file mode 100644 index 2b7e70d6..00000000 --- a/CI/scenarios/arcaflow/io-hog/workflow.yaml +++ /dev/null @@ -1,113 +0,0 @@ -version: v0.2.0 -input: - root: RootObject - objects: - hostPath: - id: HostPathVolumeSource - properties: - path: - type: - type_id: string - Volume: - id: Volume - properties: - name: - type: - type_id: string - hostPath: - type: - id: hostPath - type_id: ref - RootObject: - id: RootObject - properties: - input_list: - type: - type_id: list - items: - id: input_item - type_id: object - properties: - kubeconfig: - display: - description: The complete kubeconfig file as a string - name: Kubeconfig file contents - type: - type_id: string - required: true - namespace: - display: - description: The namespace where the container will be deployed - name: Namespace - type: - type_id: string - required: true - node_selector: - display: - description: kubernetes node name where the plugin must be deployed - type: - type_id: map - values: - type_id: string - keys: - type_id: string - required: true - duration: - display: - name: duration the scenario expressed in seconds - description: stop stress test after T seconds. One can also specify the units of time in - seconds, minutes, hours, days or years with the suffix s, m, h, d or y - type: - type_id: string - required: true - io_workers: - display: - description: number of workers - name: start N workers continually writing, reading and removing temporary files - type: - type_id: integer - required: true - io_block_size: - display: - description: single write size - name: specify size of each write in bytes. Size can be from 1 byte to 4MB. - type: - type_id: string - required: true - io_write_bytes: - display: - description: Total number of bytes written - name: write N bytes for each hdd process, the default is 1 GB. One can specify the size - as % of free space on the file system or in units of Bytes, KBytes, MBytes and - GBytes using the suffix b, k, m or g - type: - type_id: string - required: true - target_pod_folder: - display: - description: Target Folder - name: Folder in the pod where the test will be executed and the test files will be written - type: - type_id: string - required: true - target_pod_volume: - display: - name: kubernetes volume definition - description: the volume that will be attached to the pod. In order to stress - the node storage only hosPath mode is currently supported - type: - type_id: ref - id: Volume - required: true -steps: - workload_loop: - kind: foreach - items: !expr $.input.input_list - workflow: sub-workflow.yaml - parallelism: 1000 -outputs: - success: - workloads: !expr $.steps.workload_loop.outputs.success.data - - - diff --git a/CI/scenarios/arcaflow/memory-hog/config.yaml b/CI/scenarios/arcaflow/memory-hog/config.yaml deleted file mode 100644 index de4837f2..00000000 --- a/CI/scenarios/arcaflow/memory-hog/config.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -deployers: - image: - connection: {} - deployer_name: kubernetes -log: - level: debug -logged_outputs: - error: - level: error - success: - level: debug diff --git a/CI/scenarios/arcaflow/memory-hog/input.yaml b/CI/scenarios/arcaflow/memory-hog/input.yaml deleted file mode 100644 index 3f26fa12..00000000 --- a/CI/scenarios/arcaflow/memory-hog/input.yaml +++ /dev/null @@ -1,14 +0,0 @@ -input_list: -- duration: 30s - vm_bytes: 10% - vm_workers: 2 - node_selector: - kubernetes.io/hostname: kind-worker2 - # node selector example - # node_selector: - # kubernetes.io/hostname: master - kubeconfig: "" - namespace: default - -# duplicate this section to run simultaneous stressors in the same run - diff --git a/CI/scenarios/arcaflow/memory-hog/sub-workflow.yaml b/CI/scenarios/arcaflow/memory-hog/sub-workflow.yaml deleted file mode 100644 index 3c1dc93a..00000000 --- a/CI/scenarios/arcaflow/memory-hog/sub-workflow.yaml +++ /dev/null @@ -1,90 +0,0 @@ -version: v0.2.0 -input: - root: RootObject - objects: - RootObject: - id: input_item - properties: - kubeconfig: - display: - description: The complete kubeconfig file as a string - name: Kubeconfig file contents - type: - type_id: string - required: true - namespace: - display: - description: The namespace where the container will be deployed - name: Namespace - type: - type_id: string - required: true - node_selector: - display: - description: kubernetes node name where the plugin must be deployed - type: - type_id: map - values: - type_id: string - keys: - type_id: string - required: true - duration: - display: - name: duration the scenario expressed in seconds - description: stop stress test after T seconds. One can also specify the units of time in seconds, minutes, hours, days or years with the suffix s, m, h, d or y - type: - type_id: string - required: true - vm_workers: - display: - description: Number of VM stressors to be run (0 means 1 stressor per CPU) - name: Number of VM stressors - type: - type_id: integer - required: true - vm_bytes: - display: - description: N bytes per vm process, the default is 256MB. The size can be expressed in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. - name: Kubeconfig file contents - type: - type_id: string - required: true - -steps: - kubeconfig: - plugin: - src: quay.io/arcalot/arcaflow-plugin-kubeconfig:0.2.0 - deployment_type: image - input: - kubeconfig: !expr $.input.kubeconfig - stressng: - plugin: - src: quay.io/arcalot/arcaflow-plugin-stressng:0.5.0 - deployment_type: image - step: workload - input: - cleanup: "true" - StressNGParams: - timeout: !expr $.input.duration - stressors: - - stressor: vm - vm: !expr $.input.vm_workers - vm_bytes: !expr $.input.vm_bytes - deploy: - deployer_name: kubernetes - connection: !expr $.steps.kubeconfig.outputs.success.connection - pod: - metadata: - namespace: !expr $.input.namespace - labels: - arcaflow: stressng - spec: - nodeSelector: !expr $.input.node_selector - pluginContainer: - imagePullPolicy: Always - -outputs: - success: - stressng: !expr $.steps.stressng.outputs.success - diff --git a/CI/scenarios/arcaflow/memory-hog/workflow.yaml b/CI/scenarios/arcaflow/memory-hog/workflow.yaml deleted file mode 100644 index b46a09a7..00000000 --- a/CI/scenarios/arcaflow/memory-hog/workflow.yaml +++ /dev/null @@ -1,73 +0,0 @@ -version: v0.2.0 -input: - root: RootObject - objects: - RootObject: - id: RootObject - properties: - input_list: - type: - type_id: list - items: - id: input_item - type_id: object - properties: - kubeconfig: - display: - description: The complete kubeconfig file as a string - name: Kubeconfig file contents - type: - type_id: string - required: true - namespace: - display: - description: The namespace where the container will be deployed - name: Namespace - type: - type_id: string - required: true - node_selector: - display: - description: kubernetes node name where the plugin must be deployed - type: - type_id: map - values: - type_id: string - keys: - type_id: string - required: true - duration: - display: - name: duration the scenario expressed in seconds - description: stop stress test after T seconds. One can also specify the units of time in seconds, minutes, hours, days or years with the suffix s, m, h, d or y - type: - type_id: string - required: true - vm_workers: - display: - description: Number of VM stressors to be run (0 means 1 stressor per CPU) - name: Number of VM stressors - type: - type_id: integer - required: true - vm_bytes: - display: - description: N bytes per vm process, the default is 256MB. The size can be expressed in units of Bytes, KBytes, MBytes and GBytes using the suffix b, k, m or g. - name: Kubeconfig file contents - type: - type_id: string - required: true -steps: - workload_loop: - kind: foreach - items: !expr $.input.input_list - workflow: sub-workflow.yaml - parallelism: 1000 -outputs: - success: - workloads: !expr $.steps.workload_loop.outputs.success.data - - - - - diff --git a/CI/scenarios/container_scenario.yml b/CI/scenarios/container_scenario.yml deleted file mode 100755 index d0a6595c..00000000 --- a/CI/scenarios/container_scenario.yml +++ /dev/null @@ -1,8 +0,0 @@ -scenarios: -- name: "kill test container" - namespace: "default" - label_selector: "scenario=container" - container_name: "fedtools" - action: 1 - count: 1 - retry_wait: 60 diff --git a/CI/scenarios/network_chaos.yaml b/CI/scenarios/network_chaos.yaml deleted file mode 100644 index bfe5a226..00000000 --- a/CI/scenarios/network_chaos.yaml +++ /dev/null @@ -1,8 +0,0 @@ -network_chaos: # Scenario to create an outage by simulating random variations in the network. - duration: 10 # seconds - instance_count: 1 - node_name: kind-worker2 - execution: serial - egress: - bandwidth: 100mbit - diff --git a/CI/scenarios/network_diagnostics_namespace.yaml b/CI/scenarios/network_diagnostics_namespace.yaml deleted file mode 100644 index 4277fa16..00000000 --- a/CI/scenarios/network_diagnostics_namespace.yaml +++ /dev/null @@ -1,7 +0,0 @@ -scenarios: - - action: delete - namespace: "^namespace-scenario$" - label_selector: - runs: 1 - sleep: 15 - wait_time: 30 diff --git a/CI/scenarios/time_scenarios.yml b/CI/scenarios/time_scenarios.yml deleted file mode 100644 index 367af83b..00000000 --- a/CI/scenarios/time_scenarios.yml +++ /dev/null @@ -1,5 +0,0 @@ -time_scenarios: -- action: skew_time - object_type: pod - label_selector: scenario=time-skew - container_name: "" diff --git a/CI/tests/my_tests b/CI/tests/functional_tests similarity index 100% rename from CI/tests/my_tests rename to CI/tests/functional_tests diff --git a/CI/tests/test_app_outages.sh b/CI/tests/test_app_outages.sh index a6fc2b57..51bf3372 100755 --- a/CI/tests/test_app_outages.sh +++ b/CI/tests/test_app_outages.sh @@ -7,10 +7,11 @@ trap finish EXIT function functional_test_app_outage { - yq -i '.application_outage.pod_selector={"scenario":"outage"}' CI/scenarios/app_outage.yaml - yq -i '.application_outage.namespace="default"' CI/scenarios/app_outage.yaml + yq -i '.application_outage.duration=10' scenarios/openshift/app_outage.yaml + yq -i '.application_outage.pod_selector={"scenario":"outage"}' scenarios/openshift/app_outage.yaml + yq -i '.application_outage.namespace="default"' scenarios/openshift/app_outage.yaml export scenario_type="application_outages" - export scenario_file="CI/scenarios/app_outage.yaml" + export scenario_file="scenarios/openshift/app_outage.yaml" export post_config="" envsubst < CI/config/common_test_config.yaml > CI/config/app_outage.yaml python3 -m coverage run -a run_kraken.py -c CI/config/app_outage.yaml diff --git a/CI/tests/test_arca_cpu_hog.sh b/CI/tests/test_arca_cpu_hog.sh index ad39f44f..51fc24e1 100644 --- a/CI/tests/test_arca_cpu_hog.sh +++ b/CI/tests/test_arca_cpu_hog.sh @@ -7,8 +7,9 @@ trap finish EXIT function functional_test_arca_cpu_hog { + yq -i '.input_list[0].node_selector={"kubernetes.io/hostname":"kind-worker2"}' scenarios/arcaflow/cpu-hog/input.yaml export scenario_type="arcaflow_scenarios" - export scenario_file="CI/scenarios/arcaflow/cpu-hog/input.yaml" + export scenario_file="scenarios/arcaflow/cpu-hog/input.yaml" export post_config="" envsubst < CI/config/common_test_config.yaml > CI/config/arca_cpu_hog.yaml python3 -m coverage run -a run_kraken.py -c CI/config/arca_cpu_hog.yaml diff --git a/CI/tests/test_arca_io_hog.sh b/CI/tests/test_arca_io_hog.sh index 0d92f3e8..652e883b 100644 --- a/CI/tests/test_arca_io_hog.sh +++ b/CI/tests/test_arca_io_hog.sh @@ -7,8 +7,9 @@ trap finish EXIT function functional_test_arca_io_hog { + yq -i '.input_list[0].node_selector={"kubernetes.io/hostname":"kind-worker2"}' scenarios/arcaflow/io-hog/input.yaml export scenario_type="arcaflow_scenarios" - export scenario_file="CI/scenarios/arcaflow/io-hog/input.yaml" + export scenario_file="scenarios/arcaflow/io-hog/input.yaml" export post_config="" envsubst < CI/config/common_test_config.yaml > CI/config/arca_io_hog.yaml python3 -m coverage run -a run_kraken.py -c CI/config/arca_io_hog.yaml diff --git a/CI/tests/test_arca_memory_hog.sh b/CI/tests/test_arca_memory_hog.sh index bdb7405e..c6f6b7bb 100644 --- a/CI/tests/test_arca_memory_hog.sh +++ b/CI/tests/test_arca_memory_hog.sh @@ -7,8 +7,9 @@ trap finish EXIT function functional_test_arca_memory_hog { + yq -i '.input_list[0].node_selector={"kubernetes.io/hostname":"kind-worker2"}' scenarios/arcaflow/memory-hog/input.yaml export scenario_type="arcaflow_scenarios" - export scenario_file="CI/scenarios/arcaflow/memory-hog/input.yaml" + export scenario_file="scenarios/arcaflow/memory-hog/input.yaml" export post_config="" envsubst < CI/config/common_test_config.yaml > CI/config/arca_memory_hog.yaml python3 -m coverage run -a run_kraken.py -c CI/config/arca_memory_hog.yaml diff --git a/CI/tests/test_container.sh b/CI/tests/test_container.sh index 0a92a0b5..725233bf 100755 --- a/CI/tests/test_container.sh +++ b/CI/tests/test_container.sh @@ -8,9 +8,11 @@ trap finish EXIT pod_file="CI/scenarios/hello_pod.yaml" function functional_test_container_crash { - + yq -i '.scenarios[0].namespace="default"' scenarios/openshift/app_outage.yaml + yq -i '.scenarios[0].label_selector="scenario=container"' scenarios/openshift/app_outage.yaml + yq -i '.scenarios[0].container_name="fedtools"' scenarios/openshift/app_outage.yaml export scenario_type="container_scenarios" - export scenario_file="- CI/scenarios/container_scenario.yml" + export scenario_file="- scenarios/openshift/app_outage.yaml" export post_config="" envsubst < CI/config/common_test_config.yaml > CI/config/container_config.yaml diff --git a/CI/tests/test_namespace.sh b/CI/tests/test_namespace.sh index 469d0aac..ce5e8a01 100755 --- a/CI/tests/test_namespace.sh +++ b/CI/tests/test_namespace.sh @@ -7,12 +7,13 @@ trap finish EXIT function funtional_test_namespace_deletion { export scenario_type="namespace_scenarios" - export scenario_file="- CI/scenarios/network_diagnostics_namespace.yaml" + export scenario_file="- scenarios/openshift/ingress_namespace.yaml" export post_config="" - yq '.scenarios.[0].namespace="^openshift-network-diagnostics$"' -i CI/scenarios/network_diagnostics_namespace.yaml + yq '.scenarios[0].namespace="^namespace-scenario$"' -i scenarios/openshift/ingress_namespace.yaml + yq '.scenarios[0].wait_time=30' -i scenarios/openshift/ingress_namespace.yaml + yq '.scenarios[0].action="delete"' -i scenarios/openshift/ingress_namespace.yaml envsubst < CI/config/common_test_config.yaml > CI/config/namespace_config.yaml python3 -m coverage run -a run_kraken.py -c CI/config/namespace_config.yaml - echo $? echo "Namespace scenario test: Success" } diff --git a/CI/tests/test_net_chaos.sh b/CI/tests/test_net_chaos.sh index ede2af35..b7a4eb5a 100755 --- a/CI/tests/test_net_chaos.sh +++ b/CI/tests/test_net_chaos.sh @@ -7,9 +7,16 @@ trap finish EXIT function functional_test_network_chaos { + yq -i '.network_chaos.duration=10' scenarios/openshift/network_chaos.yaml + yq -i '.network_chaos.node_name="kind-worker2"' scenarios/openshift/network_chaos.yaml + yq -i '.network_chaos.egress.bandwidth="100mbit"' scenarios/openshift/network_chaos.yaml + yq -i 'del(.network_chaos.interfaces)' scenarios/openshift/network_chaos.yaml + yq -i 'del(.network_chaos.label_selector)' scenarios/openshift/network_chaos.yaml + yq -i 'del(.network_chaos.egress.latency)' scenarios/openshift/network_chaos.yaml + yq -i 'del(.network_chaos.egress.loss)' scenarios/openshift/network_chaos.yaml export scenario_type="network_chaos" - export scenario_file="CI/scenarios/network_chaos.yaml" + export scenario_file="scenarios/openshift/network_chaos.yaml" export post_config="" envsubst < CI/config/common_test_config.yaml > CI/config/network_chaos.yaml python3 -m coverage run -a run_kraken.py -c CI/config/network_chaos.yaml diff --git a/CI/tests/test_time.sh b/CI/tests/test_time.sh index 96f28285..240f8f9a 100755 --- a/CI/tests/test_time.sh +++ b/CI/tests/test_time.sh @@ -7,8 +7,12 @@ trap finish EXIT function functional_test_time_scenario { + yq -i '.time_scenarios[0].label_selector="scenario=time-skew"' scenarios/openshift/time_scenarios_example.yml + yq -i '.time_scenarios[0].container_name=""' scenarios/openshift/time_scenarios_example.yml + yq -i '.time_scenarios[0].namespace="default"' scenarios/openshift/time_scenarios_example.yml + yq -i '.time_scenarios[1].label_selector="kubernetes.io/hostname=kind-worker2"' scenarios/openshift/time_scenarios_example.yml export scenario_type="time_scenarios" - export scenario_file="CI/scenarios/time_scenarios.yml" + export scenario_file="scenarios/openshift/time_scenarios_example.yml" export post_config="" envsubst < CI/config/common_test_config.yaml > CI/config/time_config.yaml diff --git a/scenarios/arcaflow/cpu-hog/input.yaml b/scenarios/arcaflow/cpu-hog/input.yaml index 2e359172..9c80fd37 100644 --- a/scenarios/arcaflow/cpu-hog/input.yaml +++ b/scenarios/arcaflow/cpu-hog/input.yaml @@ -1,8 +1,9 @@ input_list: -- cpu_count: 1 - cpu_load_percentage: 80 - cpu_method: all - duration: 1s - kubeconfig: '' - namespace: default - node_selector: {} + - cpu_count: 1 + cpu_load_percentage: 80 + cpu_method: all + duration: 1s + kubeconfig: '' + namespace: default + node_selector: + kubernetes.io/hostname: kind-worker2 diff --git a/scenarios/kube/container_dns.yml b/scenarios/kube/container_dns.yml index f72fcfd9..3392bdc2 100755 --- a/scenarios/kube/container_dns.yml +++ b/scenarios/kube/container_dns.yml @@ -3,6 +3,6 @@ scenarios: namespace: "kube-system" label_selector: "k8s-app=kube-dns" container_name: "" - action: "kill 1" + action: 1 count: 1 retry_wait: 60 diff --git a/scenarios/openshift/network_chaos.yaml b/scenarios/openshift/network_chaos.yaml index 1c5ab595..c9246816 100644 --- a/scenarios/openshift/network_chaos.yaml +++ b/scenarios/openshift/network_chaos.yaml @@ -1,12 +1,11 @@ -network_chaos: # Scenario to create an outage by simulating random variations in the network. - duration: 300 # seconds - node_name: # node on which scenario has to be injected; - label_selector: # when node_name is not specified, a node with matching label_selector is selected for running the scenario. +network_chaos: # Scenario to create an outage by simulating random variations in the network. + duration: 300 # seconds + node_name: # node on which scenario has to be injected; + label_selector: # when node_name is not specified, a node with matching label_selector is selected for running the scenario. instance_count: 1 - interfaces: # Interface name would be the Kernel host network interface name. - - "" + interfaces: # Interface name would be the Kernel host network interface name. + - "" execution: serial egress: - latency: 50ms # 50ms - loss: 0.02 # percentage - bandwidth: 100mbit + latency: 50ms # 50ms + loss: 0.02 # percentage