diff --git a/.github/workflows/docker-tests.yml b/.github/workflows/docker-tests.yml index c0e0d03d2..386f431b6 100644 --- a/.github/workflows/docker-tests.yml +++ b/.github/workflows/docker-tests.yml @@ -52,4 +52,7 @@ jobs: run: | echo "Running simple make targets on ${{ matrix.distro_container }} environment" make mrproper + make defconfig-fio-tests-null + make -j$(nproc) + make fio-tests diff --git a/defconfigs/fio-tests-null b/defconfigs/fio-tests-null new file mode 100644 index 000000000..3c901c3eb --- /dev/null +++ b/defconfigs/fio-tests-null @@ -0,0 +1,10 @@ +CONFIG_SKIP_BRINGUP=y +CONFIG_WORKFLOWS=y +CONFIG_WORKFLOW_LINUX_DISTRO=y +CONFIG_WORKFLOWS_TESTS=y +CONFIG_WORKFLOWS_LINUX_TESTS=y +CONFIG_WORKFLOWS_DEDICATED_WORKFLOW=y +CONFIG_KDEVOPS_WORKFLOW_DEDICATE_FIO_TESTS=y +CONFIG_KDEVOPS_WORKFLOW_ENABLE_FIO_TESTS=y +CONFIG_FIO_TEST_BASIC=y +CONFIG_FIO_TESTS_DEVICE="/dev/null" diff --git a/kconfigs/workflows/Kconfig b/kconfigs/workflows/Kconfig index d10ab6c97..92ce5c4c1 100644 --- a/kconfigs/workflows/Kconfig +++ b/kconfigs/workflows/Kconfig @@ -169,11 +169,18 @@ config KDEVOPS_WORKFLOW_DEDICATE_LTP ltp workflow in separate target nodes per testing group. config KDEVOPS_WORKFLOW_DEDICATE_NFSTEST - bool "nfstest" - select KDEVOPS_WORKFLOW_ENABLE_NFSTEST - help - This will dedicate your configuration to running only the - nfstest workflow in separate target nodes per testing group. + bool "nfstest" + select KDEVOPS_WORKFLOW_ENABLE_NFSTEST + help + This will dedicate your configuration to running only the + nfstest workflow in separate target nodes per testing group. + +config KDEVOPS_WORKFLOW_DEDICATE_FIO_TESTS + bool "fio-tests" + select KDEVOPS_WORKFLOW_ENABLE_FIO_TESTS + help + This will dedicate your configuration to running only the + fio-tests workflow. config KDEVOPS_WORKFLOW_DEDICATE_SYSBENCH bool "sysbench" @@ -193,8 +200,9 @@ config KDEVOPS_WORKFLOW_NAME default "selftests" if KDEVOPS_WORKFLOW_DEDICATE_SELFTESTS default "gitr" if KDEVOPS_WORKFLOW_DEDICATE_GITR default "ltp" if KDEVOPS_WORKFLOW_DEDICATE_LTP - default "nfstest" if KDEVOPS_WORKFLOW_DEDICATE_NFSTEST - default "sysbench" if KDEVOPS_WORKFLOW_DEDICATE_SYSBENCH + default "nfstest" if KDEVOPS_WORKFLOW_DEDICATE_NFSTEST + default "sysbench" if KDEVOPS_WORKFLOW_DEDICATE_SYSBENCH + default "fio-tests" if KDEVOPS_WORKFLOW_DEDICATE_FIO_TESTS endif @@ -281,12 +289,20 @@ config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_NFSTEST single target node for by-hand testing. config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_SYSBENCH - bool "sysbench" - select KDEVOPS_WORKFLOW_ENABLE_SYSBENCH - depends on LIBVIRT || TERRAFORM_PRIVATE_NET - help - Select this option if you want to provision sysbench on a - single target node for by-hand testing. + bool "sysbench" + select KDEVOPS_WORKFLOW_ENABLE_SYSBENCH + depends on LIBVIRT || TERRAFORM_PRIVATE_NET + help + Select this option if you want to provision sysbench on a + single target node for by-hand testing. + +config KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_FIO_TESTS + bool "fio-tests" + select KDEVOPS_WORKFLOW_ENABLE_FIO_TESTS + depends on LIBVIRT || TERRAFORM_PRIVATE_NET || SKIP_BRINGUP + help + Select this option if you want to run fio-tests on a single + target node for by-hand testing. endif # !WORKFLOWS_DEDICATED_WORKFLOW @@ -380,9 +396,9 @@ endmenu endif # KDEVOPS_WORKFLOW_ENABLE_NFSTEST config KDEVOPS_WORKFLOW_ENABLE_SYSBENCH - bool - output yaml - default y if KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_SYSBENCH || KDEVOPS_WORKFLOW_DEDICATE_SYSBENCH + bool + output yaml + default y if KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_SYSBENCH || KDEVOPS_WORKFLOW_DEDICATE_SYSBENCH if KDEVOPS_WORKFLOW_ENABLE_SYSBENCH menu "Configure and run the sysbench tests" @@ -390,6 +406,17 @@ source "workflows/sysbench/Kconfig" endmenu endif # KDEVOPS_WORKFLOW_ENABLE_SYSBENCH +config KDEVOPS_WORKFLOW_ENABLE_FIO_TESTS + bool + output yaml + default y if KDEVOPS_WORKFLOW_NOT_DEDICATED_ENABLE_FIO_TESTS || KDEVOPS_WORKFLOW_DEDICATE_FIO_TESTS + +if KDEVOPS_WORKFLOW_ENABLE_FIO_TESTS +menu "Configure and run fio-tests" +source "workflows/fio_tests/Kconfig" +endmenu +endif # KDEVOPS_WORKFLOW_ENABLE_FIO_TESTS + config KDEVOPS_WORKFLOW_ENABLE_SSD_STEADY_STATE bool "Attain SSD steady state prior to tests" output yaml diff --git a/playbooks/fio_tests.yml b/playbooks/fio_tests.yml new file mode 100644 index 000000000..5bd25ec81 --- /dev/null +++ b/playbooks/fio_tests.yml @@ -0,0 +1,4 @@ +--- +- hosts: all + roles: + - role: fio_tests diff --git a/playbooks/roles/fio_tests/defaults/main.yml b/playbooks/roles/fio_tests/defaults/main.yml new file mode 100644 index 000000000..bdd8700e7 --- /dev/null +++ b/playbooks/roles/fio_tests/defaults/main.yml @@ -0,0 +1,7 @@ +--- +fio_tests_device: "/dev/null" +fio_test_basic: false +fio_test_iobatch: false +fio_test_max_iobatch_single: false +fio_test_max_iobatch_jobs: false +fio_test_snia: false diff --git a/playbooks/roles/fio_tests/tasks/main.yml b/playbooks/roles/fio_tests/tasks/main.yml new file mode 100644 index 000000000..93a824bdf --- /dev/null +++ b/playbooks/roles/fio_tests/tasks/main.yml @@ -0,0 +1,35 @@ +--- +- name: Import optional extra_args file + ansible.builtin.include_vars: + file: "{{ item }}" + with_first_found: + - files: + - "../extra_vars.yml" + - "../extra_vars.yaml" + - "../extra_vars.json" + skip: true + failed_when: false + tags: vars + +- name: Install fio + become: yes + package: + name: fio + state: present + tags: ['install'] + +- name: Run basic fio sequential write + become: yes + command: >- + fio --name=basic-seqwrite --rw=write --filename={{ fio_tests_device }} \ + --size=1M --ioengine=libaio --direct=1 --output=/tmp/basic-seqwrite.out + when: fio_test_basic | bool + tags: ['fio'] + +- name: Fetch fio result + ansible.builtin.fetch: + src: /tmp/basic-seqwrite.out + dest: "{{ topdir_path }}/workflows/fio_tests/results/{{ inventory_hostname }}/" + flat: yes + when: fio_test_basic | bool + tags: ['results'] diff --git a/playbooks/roles/gen_hosts/defaults/main.yml b/playbooks/roles/gen_hosts/defaults/main.yml index f6ab9bcce..696f6bf36 100644 --- a/playbooks/roles/gen_hosts/defaults/main.yml +++ b/playbooks/roles/gen_hosts/defaults/main.yml @@ -28,6 +28,7 @@ kdevops_workflow_enable_gitr: False kdevops_workflow_enable_ltp: False kdevops_workflow_enable_nfstest: false kdevops_workflow_enable_sysbench: false +kdevops_workflow_enable_fio_tests: false is_fstests: False fstests_fstyp: "bogus" diff --git a/playbooks/roles/gen_hosts/tasks/main.yml b/playbooks/roles/gen_hosts/tasks/main.yml index 5f5234591..6ee1fb8fe 100644 --- a/playbooks/roles/gen_hosts/tasks/main.yml +++ b/playbooks/roles/gen_hosts/tasks/main.yml @@ -312,6 +312,30 @@ - kdevops_workflow_enable_sysbench - ansible_hosts_template.stat.exists +- name: Collect enabled fio-tests targets + vars: + fio_tests_vars: "{{ vars | dict2items | selectattr('key','match','^fio_test_') }}" + fio_tests_enabled: "{{ fio_tests_vars | selectattr('value','eq',True) | map(attribute='key') | list }}" + fio_tests_nodes: "{{ fio_tests_enabled | map('regex_replace','fio_test_','') | list }}" + set_fact: + enabled_fio_tests: "{{ fio_tests_nodes }}" + when: + - kdevops_workflows_dedicated_workflow + - kdevops_workflow_enable_fio_tests + +- name: Generate the Ansible hosts file for a dedicated fio-tests setup + tags: [ 'hosts' ] + template: + src: "{{ kdevops_hosts_template }}" + dest: "{{ topdir_path }}/{{ kdevops_hosts }}" + force: yes + trim_blocks: True + lstrip_blocks: True + when: + - kdevops_workflows_dedicated_workflow + - kdevops_workflow_enable_fio_tests + - ansible_hosts_template.stat.exists + - name: Verify if final host file exists stat: path: "{{ topdir_path }}/{{ kdevops_hosts }}" diff --git a/playbooks/roles/gen_hosts/templates/fio_tests.j2 b/playbooks/roles/gen_hosts/templates/fio_tests.j2 new file mode 100644 index 000000000..d36a18c83 --- /dev/null +++ b/playbooks/roles/gen_hosts/templates/fio_tests.j2 @@ -0,0 +1,23 @@ +[all] +{% for t in enabled_fio_tests %} +{{ kdevops_host_prefix }}-{{ t }} +{% if kdevops_baseline_and_dev %} +{{ kdevops_host_prefix }}-{{ t }}-dev +{% endif %} +{% endfor %} +[all:vars] +ansible_python_interpreter = "{{ kdevops_python_interpreter }}" +[baseline] +{% for t in enabled_fio_tests %} +{{ kdevops_host_prefix }}-{{ t }} +{% endfor %} +[baseline:vars] +ansible_python_interpreter = "{{ kdevops_python_interpreter }}" +[dev] +{% if kdevops_baseline_and_dev %} + {% for t in enabled_fio_tests %} +{{ kdevops_host_prefix }}-{{ t }}-dev + {% endfor %} +{% endif %} +[dev:vars] +ansible_python_interpreter = "{{ kdevops_python_interpreter }}" diff --git a/workflows/Makefile b/workflows/Makefile index 89f6d3171..ff6e71ddc 100644 --- a/workflows/Makefile +++ b/workflows/Makefile @@ -50,6 +50,10 @@ ifeq (y,$(CONFIG_KDEVOPS_WORKFLOW_ENABLE_NFSTEST)) include workflows/nfstest/Makefile endif # CONFIG_KDEVOPS_WORKFLOW_ENABLE_NFSTEST == y +ifeq (y,$(CONFIG_KDEVOPS_WORKFLOW_ENABLE_FIO_TESTS)) +include workflows/fio_tests/Makefile +endif # CONFIG_KDEVOPS_WORKFLOW_ENABLE_FIO_TESTS == y + ifeq (y,$(CONFIG_KDEVOPS_WORKFLOW_ENABLE_SYSBENCH)) include workflows/sysbench/Makefile endif # CONFIG_KDEVOPS_WORKFLOW_ENABLE_SYSBENCH == y diff --git a/workflows/fio_tests/Kconfig b/workflows/fio_tests/Kconfig new file mode 100644 index 000000000..fb364e627 --- /dev/null +++ b/workflows/fio_tests/Kconfig @@ -0,0 +1,28 @@ +menu "fio-tests simple workflows" + +config FIO_TESTS_DEVICE + string "Device or file to use" + output yaml + default "/dev/null" + +config FIO_TEST_BASIC + bool "Basic tests" + output yaml + +config FIO_TEST_IOBATCH + bool "IO depth batch tests" + output yaml + +config FIO_TEST_MAX_IOBATCH_SINGLE + bool "Max iodepth batch single job tests" + output yaml + +config FIO_TEST_MAX_IOBATCH_JOBS + bool "Max iodepth batch jobs tests" + output yaml + +config FIO_TEST_SNIA + bool "SNIA interpretation tests" + output yaml + +endmenu diff --git a/workflows/fio_tests/Makefile b/workflows/fio_tests/Makefile new file mode 100644 index 000000000..f665fb1f5 --- /dev/null +++ b/workflows/fio_tests/Makefile @@ -0,0 +1,15 @@ +PHONY += fio-tests fio-tests-help-menu + +ifeq (y,$(CONFIG_WORKFLOWS_DEDICATED_WORKFLOW)) +export KDEVOPS_HOSTS_TEMPLATE := fio_tests.j2 +endif + +fio-tests: +$(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ +-i $(KDEVOPS_HOSTFILE) playbooks/fio_tests.yml + +fio-tests-help-menu: +@echo "fio-tests - Run fio-tests workflow" +@echo "" + +HELP_TARGETS += fio-tests-help-menu