Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Release Tools Bot <delivery-team+release-tools@gitlab.com>2023-10-31 17:30:35 +0300
committerGitLab Release Tools Bot <delivery-team+release-tools@gitlab.com>2023-10-31 17:30:35 +0300
commitec770ec0d801782fb39cf52c01710bf347d70e3a (patch)
treee3be576199894d84efe9e0598e82633712c19c91 /spec/lib/gitlab/import_export/command_line_util_spec.rb
parent9de3f08bc2d59576d74162ebfd16543f7b40c696 (diff)
parentabc892a30ec014fc8b13d0280aa2bdb15ac93d9d (diff)
Merge remote-tracking branch 'dev/16-3-stable' into 16-3-stable
Diffstat (limited to 'spec/lib/gitlab/import_export/command_line_util_spec.rb')
-rw-r--r--spec/lib/gitlab/import_export/command_line_util_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/import_export/command_line_util_spec.rb b/spec/lib/gitlab/import_export/command_line_util_spec.rb
index 8ed3a60d7fc..b709a2dbedb 100644
--- a/spec/lib/gitlab/import_export/command_line_util_spec.rb
+++ b/spec/lib/gitlab/import_export/command_line_util_spec.rb
@@ -84,6 +84,20 @@ RSpec.describe Gitlab::ImportExport::CommandLineUtil, feature_category: :importe
end
end
+ shared_examples 'deletes pipes' do |compression, decompression|
+ it 'deletes the pipes', :aggregate_failures do
+ FileUtils.touch("#{source_dir}/file.txt")
+ File.mkfifo("#{source_dir}/pipe")
+
+ archive_file = File.join(archive_dir, 'file_with_pipes.tar.gz')
+ subject.public_send(compression, archive: archive_file, dir: source_dir)
+ subject.public_send(decompression, archive: archive_file, dir: target_dir)
+
+ expect(File).to exist("#{target_dir}/file.txt")
+ expect(File).not_to exist("#{target_dir}/pipe")
+ end
+ end
+
describe '#download_or_copy_upload' do
let(:upload) { instance_double(Upload, local?: local) }
let(:uploader) { instance_double(ImportExportUploader, path: :path, url: :url, upload: upload) }
@@ -302,6 +316,7 @@ RSpec.describe Gitlab::ImportExport::CommandLineUtil, feature_category: :importe
it_behaves_like 'deletes symlinks', :tar_czf, :untar_zxf
it_behaves_like 'handles shared hard links', :tar_czf, :untar_zxf
+ it_behaves_like 'deletes pipes', :tar_czf, :untar_zxf
it 'has the right mask for project.json' do
subject.untar_zxf(archive: tar_archive_fixture, dir: target_dir)
@@ -321,6 +336,7 @@ RSpec.describe Gitlab::ImportExport::CommandLineUtil, feature_category: :importe
it_behaves_like 'deletes symlinks', :tar_cf, :untar_xf
it_behaves_like 'handles shared hard links', :tar_cf, :untar_xf
+ it_behaves_like 'deletes pipes', :tar_czf, :untar_zxf
it 'extracts archive without decompression' do
filename = 'archive.tar.gz'