Bug #28184
closedforeman-maintain leaves fio test-files after running disk-benchmark
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1762302
Description of problem:
After running foreman-maintain, /var/lib/pulp/job1.0.0 is still on the disk. This file was created by the fio disk-benchmark.
fio --name=job1 --rw=read --size=1g --output-format=json --directory=/var/lib/pulp --direct=1
- ls
lh /var/lib/pulp/job1.0.0. 1 root root 1.0G Oct 16 12:51 /var/lib/pulp/job1.0.0
-rw-r--r-
- rpm -qa |grep maintain
rubygem-foreman_maintain-0.3.5-1.el7sat.noarch
satellite-maintain-0.0.1-1.el7sat.noarch
How reproducible:
Always
Steps to Reproduce:
1. run "foreman-maintain health check --label disk-performance"
2. see "/var/lib/pulp/job1.0.0" created, but never removed
3.
Actual results:
Leftovers from those benchmark tests.
Expected results:
Leftovers removed after benchmark has been run
Additional info:
/usr/share/gems/gems/foreman_maintain-0.3.5/lib/foreman_maintain/utils/disk/io_device.rb should probably add a file-removal after fio finished.
28 def fio
29 cmd = "fio --name=job1 --rw=read --size=1g --output-format=json\
30 --directory=#{dir} --direct=1"
31 stdout = execute(cmd)
32 output = JSON.parse(stdout)
33 @fio ||= output['jobs'].first['read']['bw'].to_i
34 endprobably here??
Additional, I see that /usr/share/gems/gems/foreman_maintain-0.3.5/definitions/checks/disk/performance.rb should test pulp, mongo and pgsql directories for speed, I only saw pulp being tested.
17 DEFAULT_DIRS = ['/var/lib/pulp', '/var/lib/mongodb', '/var/lib/pgsql'].freeze