Debian Codegraph @

testsuite/chroot-special-inner-module_test.py

raw symbols SCIP
1 #!/usr/bin/env python3
2 import os
3
4 from rsyncfns import run_checked, setup_chroot_inner
5 from rsyncfns import rsync_argv, test_fail
6
7 base, inner, outside, src, url = setup_chroot_inner('chroot-special-inner')
8 os.symlink('target', src / 'link')
9 proc, out = run_checked(rsync_argv('-a', str(src / 'link'), f'{url}mod/linkparent/link'))
10 if (outside / 'link').exists() or os.path.islink(outside / 'link'):
11 test_fail(f"symlink creation escaped inner module through symlinked parent:\n{out}")
12 print("chroot-special-inner-module: symlink creation did not escape inner module")