Sha256: 7d7a82051443263eceaed50455030b8e11bff0091cfaf463a4a704a2383c8e0a
Contents?: true
Size: 1.07 KB
Versions: 6
Compression:
Stored size: 1.07 KB
Contents
# encoding: utf-8 require_relative "../spec_helper" require "logstash/outputs/s3" require "logstash/codecs/line" require "stud/temporary" describe "Restore from crash", :integration => true do include_context "setup plugin" let(:options) { main_options.merge({ "restore" => true }) } let(:number_of_files) { 5 } let(:dummy_content) { "foobar\n" * 100 } before do clean_remote_files(prefix) # Use the S3 factory to create mutliples files with dummy content factory = LogStash::Outputs::S3::TemporaryFileFactory.new(prefix, tags, "none", temporary_directory) # Creating a factory always create a file factory.current.write(dummy_content) factory.current.fsync (number_of_files - 1).times do factory.rotate! factory.current.write(dummy_content) factory.current.fsync end end it "uploads the file to the bucket" do subject.register try(20) do expect(bucket_resource.objects(:prefix => prefix).count).to eq(number_of_files) expect(Dir.glob(File.join(temporary_directory, "*")).size).to eq(0) end end end
Version data entries
6 entries across 6 versions & 1 rubygems