| 1 | module coracle |
| 2 | |
| 3 | import nspkg.tests.signaturefixtures |
| 4 | import os |
| 5 | |
| 6 | fn test_archive_scriptlet_staging_matches_libalpm() ! { |
| 7 | $if !linux { |
| 8 | return |
| 9 | } |
| 10 | base := os.join_path(os.vtmp_dir(), 'alpm-archive-scriptlet-${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', 'archive_scriptlet_probe.v')])! |
| 16 | output := signaturefixtures.command('timeout', ['60s', 'unshare', '--user', '--map-root-user', |
| 17 | '--mount', probe, base, os.readlink('/proc/self/ns/mnt')!])! |
| 18 | assert output.contains('48 archive scriptlet comparisons verified') |
| 19 | } |
| 20 | |