When running unit tests on a live system without an /etc/fstab file, unit tests fails.
It is normal that the unit tests want to access live system /etc/fstab.
step to reproduce:
create a jammy lxd container
run unit test will error with the following
======================================================================
ERROR: test_001_config_changed_call (tests.unit.test_fstab_config.TestCharm)
Test that mounting new filesystems works upon config-changed.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/root/charm-fstab-config/src/.tox/unit/lib/python3.10/site-packages/mock/mock.py", line 1346, in patched
return func(*newargs, **newkeywargs)
File "/root/charm-fstab-config/src/tests/unit/test_fstab_config.py", line 102, in test_001_config_changed_call
config_changed()
File "/root/charm-fstab-config/src/reactive/fstab_config.py", line 129, in config_changed
now = get_last_modification_fstab()
File "/root/charm-fstab-config/src/reactive/fstab_config.py", line 16, in get_last_modification_fstab
stat = os.path.getmtime("/etc/fstab")
File "/usr/lib/python3.10/genericpath.py", line 55, in getmtime
return os.stat(filename).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/etc/fstab'