From 669dfe09cf6f4c571f2faeec27caf9f048e85b35 Mon Sep 17 00:00:00 2001 From: Otavio Pontes Date: Wed, 15 Apr 2020 15:17:39 -0700 Subject: [PATCH] test: Preserve attributes on copy When creating the fullfile and installing the bundle in targetfs we need to preserve the owner and mode of file Signed-off-by: Otavio Pontes --- test/functional/testlib.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/testlib.bash b/test/functional/testlib.bash index 3feaca03..12e637cb 100644 --- a/test/functional/testlib.bash +++ b/test/functional/testlib.bash @@ -2918,7 +2918,7 @@ add_content_to_bundle() { # the file is a file or symlink, copy it to the files directory # (do not follow links) debug_msg "Copying file/symlink $content_dir/$filename to $files_dir/$filehash..." - sudo cp -P "$content_dir"/"$filename" "$files_dir"/"$filehash" + sudo cp --preserve=all -P "$content_dir"/"$filename" "$files_dir"/"$filehash" fi # create the tar for each file, we need to skip validations since @@ -3042,7 +3042,7 @@ create_bundle_from_content() { #swupd_function # If the user chose to install the bundle, copy all files to the target directory if [ "$local_bundle" = true ]; then debug_msg "Installing $bundle_name in target $target_dir..." - sudo cp -r "$content_dir"/* "$target_dir"/ + sudo cp --preserve=all -r "$content_dir"/* "$target_dir"/ fi # If the user chose to track the bundle, create the tracking file for the bundle