test-pull-untrusted.sh: always corrupt a regular file, not a symlink
test-pull-untrusted.sh would pass when run as root, but fail when run as testuser. It turned out that the way the files were stored in the repo when running as a testuser were different, which meant that a different .file object was chosen for corruption. Except that file turned out to be a symlink, so the echo "broke" actually just wrote to the no_such_file symlink target, thus keeping the actual symlink file's checksum the same and causing the pull-local to pass when it should have failed. [smcv: split this out of a larger commit, part of PR #231] Signed-off-by: Simon McVittie <smcv@debian.org> Closes: #232 Approved by: cgwalters
This commit is contained in:
parent
e1ce859368
commit
7835fcdc68
|
|
@ -39,6 +39,12 @@ echo "ok pull-local --untrusted didn't hardlink"
|
|||
|
||||
# Corrupt repo
|
||||
for i in ${test_tmpdir}/repo/objects/*/*.file; do
|
||||
|
||||
# make sure it's not a symlink
|
||||
if [ -L $i ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "corrupting $i"
|
||||
echo "broke" >> $i
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue