From be20061f51b8407929cc608e5b1ba82040c27eda Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Thu, 28 Nov 2024 15:59:10 +0100 Subject: [PATCH] Add possibility to run Tobiko in debug mode This patch adds support in the `test-operator` role to run Tobiko tests in the debug mode (same as already is there for Tempest). Related: TOBIKO-100 --- roles/test_operator/README.md | 2 ++ roles/test_operator/defaults/main.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/roles/test_operator/README.md b/roles/test_operator/README.md index 143e4db146..ce0da139fd 100644 --- a/roles/test_operator/README.md +++ b/roles/test_operator/README.md @@ -90,6 +90,7 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/ * `cifmw_test_operator_tobiko_override_conf`: (Dict) Overrides the default configuration from `cifmw_test_operator_tobiko_default_conf` that is used to generate the tobiko.conf file. Default value: empty dictionary * `cifmw_test_operator_tobiko_ssh_keytype`: (String) Type of ssh key that tobiko will use to connect to the VM instances it creates. Defaults to `cifmw_ssh_keytype` which default to `ecdsa`. * `cifmw_test_operator_tobiko_ssh_keysize`: (Integer) Size of ssh key that tobiko will use to connect to the VM instances it creates. Defaults to `cifmw_ssh_keysize` which defaults to 521. +* `cifmw_test_operator_tobiko_debug`: (Bool) Run Tobiko in debug mode, it keeps the operator pod sleeping infinity (it must only set to `true`only for debugging purposes). Default value: `false` * `cifmw_test_operator_tobiko_network_attachments`: (List) List of network attachment definitions to attach to the tobiko pods spawned by test-operator. Default value: `[]`. * `cifmw_test_operator_tobiko_workflow`: (List) Definition of a Tobiko workflow that consists of multiple steps. Each step can contain all values from Spec section of [Tobiko CR](https://openstack-k8s-operators.github.io/test-operator/crds.html#tobiko-custom-resource). * `cifmw_test_operator_tobiko_config`: (Dict) Definition of Tobiko CRD instance that is passed to the test-operator (see [the test-operator documentation](https://openstack-k8s-operators.github.io/test-operator/crds.html#tobiko-custom-resource)). Default value: @@ -109,6 +110,7 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/ tolerations: "{{ cifmw_test_operator_tolerations | default(omit) }}" nodeSelector: "{{ cifmw_test_operator_node_selector | default(omit) }}" networkAttachments: "{{ cifmw_test_operator_tobiko_network_attachments }}" + debug: "{{ cifmw_test_operator_tobiko_debug }}" # preventCreate: preventCreate is generated by the test_operator role based on the value of cifmw_test_operator_tobiko_prevent_create # numProcesses: numProcesses is generated by the test_operator role based on the value of cifmw_test_operator_tobiko_num_processes # privateKey: privateKey is automatically generated by the test_operator role diff --git a/roles/test_operator/defaults/main.yml b/roles/test_operator/defaults/main.yml index afc0e6c1eb..86fe393856 100644 --- a/roles/test_operator/defaults/main.yml +++ b/roles/test_operator/defaults/main.yml @@ -147,6 +147,7 @@ cifmw_test_operator_tobiko_override_conf: {} cifmw_test_operator_tobiko_kubeconfig_secret: tobiko-secret cifmw_test_operator_tobiko_ssh_keytype: "{{ cifmw_ssh_keytype | default('ecdsa') }}" cifmw_test_operator_tobiko_ssh_keysize: "{{ cifmw_ssh_keysize | default(521) }}" +cifmw_test_operator_tobiko_debug: false cifmw_test_operator_tobiko_network_attachments: [] cifmw_test_operator_tobiko_workflow: [] cifmw_test_operator_tobiko_config: @@ -166,6 +167,7 @@ cifmw_test_operator_tobiko_config: pytestAddopts: "{{ cifmw_test_operator_tobiko_pytest_addopts if cifmw_test_operator_tobiko_pytest_addopts is not none else omit }}" tolerations: "{{ cifmw_test_operator_tolerations | default(omit) }}" nodeSelector: "{{ cifmw_test_operator_node_selector | default(omit) }}" + debug: "{{ cifmw_test_operator_tobiko_debug }}" networkAttachments: "{{ cifmw_test_operator_tobiko_network_attachments }}" # preventCreate: preventCreate is generated by the test_operator role based on the value of cifmw_test_operator_tobiko_prevent_create # numProcesses: numProcesses is generated by the test_operator role based on the value of cifmw_test_operator_tobiko_num_processes