mirror of
https://github.com/clearlinux/swupd-server.git
synced 2026-08-19 04:57:43 +00:00
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:
@@ -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 ]
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user