asan_options=None
lsan_options=None
ubsan_options=None
+with_coverage=False
running_units = []
drop_in += ['SystemCallFilter=']
if use_valgrind or asan_options or lsan_options or ubsan_options:
drop_in += ['MemoryDenyWriteExecute=no']
+ if with_coverage:
+ drop_in += ['ProtectSystem=no']
os.makedirs('/run/systemd/system/systemd-networkd.service.d', exist_ok=True)
with open('/run/systemd/system/systemd-networkd.service.d/00-override.conf', mode='w') as f:
drop_in += ['SystemCallFilter=']
if use_valgrind or asan_options or lsan_options or ubsan_options:
drop_in += ['MemoryDenyWriteExecute=no']
+ if with_coverage:
+ drop_in += ['ProtectSystem=no']
os.makedirs('/run/systemd/system/systemd-resolved.service.d', exist_ok=True)
with open('/run/systemd/system/systemd-resolved.service.d/00-override.conf', mode='w') as f:
parser.add_argument('--asan-options', help='ASAN options', dest='asan_options')
parser.add_argument('--lsan-options', help='LSAN options', dest='lsan_options')
parser.add_argument('--ubsan-options', help='UBSAN options', dest='ubsan_options')
+ parser.add_argument('--with-coverage', help='Loosen certain sandbox restrictions to make gcov happy', dest='with_coverage', type=bool, nargs='?', const=True, default=with_coverage)
ns, args = parser.parse_known_args(namespace=unittest)
if ns.build_dir:
asan_options = ns.asan_options
lsan_options = ns.lsan_options
ubsan_options = ns.ubsan_options
+ with_coverage = ns.with_coverage
if use_valgrind:
networkctl_cmd = ['valgrind', '--track-origins=yes', '--leak-check=full', '--show-leak-kinds=all', networkctl_bin]