test: add one more test for symlink dereferences + deltas

In the event that a symlink target changes between two versions, and the
files the symlink points to also change and would create a delta, do not
create a delta between the symlinks. The real delta is between the
underlying files the symlinks point to, which is created separately.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This commit is contained in:
Patrick McCarty
2017-04-03 16:07:47 -07:00
committed by tmarcu
parent c963ce9aa6
commit adb8241a83
+15
View File
@@ -25,6 +25,13 @@ setup() {
gen_file_to_delta 10 4096 20 4 os-core testfile2
copy_file 10 os-core testfile2 10 os-core testsym2
gen_symlink_to_file 20 os-core testsym2 testfile2
# symlink change + symlink target change; delta should be created for
# testfile3, but not for the dereferenced testsym3
gen_file_to_delta 10 4096 20 4 os-core testfile3
copy_file 20 os-core testfile3 20 os-core testfile4
gen_symlink_to_file 10 os-core testsym3 testfile3
gen_symlink_to_file 20 os-core testsym3 testfile4
}
@test "no deltas created for type changes or dereferenced symlinks" {
@@ -44,6 +51,10 @@ setup() {
hash2=$(hash_for 20 os-core "/testfile2")
[ -f $DIR/www/20/delta/10-20-$hash1-$hash2 ]
hash1=$(hash_for 10 os-core "/testfile3")
hash2=$(hash_for 20 os-core "/testfile3")
[ -f $DIR/www/20/delta/10-20-$hash1-$hash2 ]
# deltas for symlink type changes should not be created
hash1=$(hash_for 10 os-core "/testsym1")
hash2=$(hash_for 20 os-core "/testsym1")
@@ -52,6 +63,10 @@ setup() {
hash1=$(hash_for 10 os-core "/testsym2")
hash2=$(hash_for 20 os-core "/testsym2")
[ ! -f $DIR/www/20/delta/10-20-$hash1-$hash2 ]
hash1=$(hash_for 10 os-core "/testsym3")
hash2=$(hash_for 20 os-core "/testsym3")
[ ! -f $DIR/www/20/delta/10-20-$hash1-$hash2 ]
}