jthornber / device-mapper-test-suite

Test suite for device mapper targets
GNU General Public License v3.0
23 stars 20 forks source link

Errno::ENOENT: No such file or directory @ rb_sysopen - /sys/block/sda1/queue/discard_granularity #69

Open simonxuhao opened 4 years ago

simonxuhao commented 4 years ago

A lot of tests fail due to Errno::ENOENT: No such file or directory @ rb_sysopen - /sys/block/<dev>/queue/discard_granularity when dev is a partition instead of a disk, so we should first find the disk of the partition and then read the discard_granularity file of the disk.

Example failure (DiscardQuickTests_discard_past_the_end_fails.log):

E, [2020-09-02T22:17:33.415373 #38027] ERROR -- : Error: test_discard_past_the_end_fails(DiscardQuickTests): Errno::ENOENT: No such file or directory @ rb_sysopen - /sys/block/sda1/queue/discard_granularity /root/device-mapper-test-suite/lib/dmtest/discard_limits.rb:17:in initialize' /root/device-mapper-test-suite/lib/dmtest/discard_limits.rb:17:inopen' /root/device-mapper-test-suite/lib/dmtest/discard_limits.rb:17:in read_param' /root/device-mapper-test-suite/lib/dmtest/discard_limits.rb:8:ininitialize' /root/device-mapper-test-suite/lib/dmtest/thinp-mixin.rb:154:in new' /root/device-mapper-test-suite/lib/dmtest/thinp-mixin.rb:154:inwith_discardable_dev' /root/device-mapper-test-suite/lib/dmtest/thinp-mixin.rb:167:in with_discardable_pool' /root/device-mapper-test-suite/lib/dmtest/tests/thin-provisioning/discard_tests.rb:558:inblock in ' I, [2020-09-02T22:17:33.415451 #38027] INFO -- : Peak bufio allocation was 0