fw4: simplify `is_loopback_dev()`
authorJo-Philipp Wich <jo@mein.io>
Mon, 13 Jun 2022 13:23:23 +0000 (15:23 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 14 Jun 2022 14:54:06 +0000 (16:54 +0200)
commit5994466353ecbd4e6fac738aa956b2cbd9f6308b
treee75b82ff402d9711756a79e44635144cf31a31f3
parent880dd31353c8db8bad4b193cc4928ba01ff29c78
fw4: simplify `is_loopback_dev()`

Use `fs.readfile()` to simplify the code reading flag values from sysfs.

Also add a mock implementation of `fs.readfile()` using the same mock
data files as `fs.open()`.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/ucode/fw4.uc
tests/01_configuration/01_ruleset
tests/lib/mocklib/fs.uc