nspkg / tests / coracle / removal_access_compatibility_test.v
19 lines · 17 sloc · 719 bytes · c01b0795d1db56c7bce2539b2c46b110637fdc1a
Raw
1module coracle
2
3import nspkg.tests.signaturefixtures
4import os
5
6fn test_removal_preflight_diagnostics_match_libalpm() ! {
7 $if !linux {
8 return
9 }
10 base := os.join_path(os.vtmp_dir(), 'alpm-removal-access-${os.getpid()}')
11 os.mkdir_all(base)!
12 defer { os.rmdir_all(base) or { eprintln(err) } }
13 probe := os.join_path(base, 'probe')
14 signaturefixtures.command('v', ['-path', os.dir(@VMODROOT) + '|@vlib|@vmodules', '-o', probe,
15 os.join_path(@VMODROOT, 'tests', 'removal_access_probe.v')])!
16 output := signaturefixtures.command('timeout', ['90s', 'unshare', '--user', '--map-root-user',
17 '--mount', probe, base, os.readlink('/proc/self/ns/mnt')!])!
18 assert output.contains('32 removal access comparisons verified')
19}
20