forked from elastic/logstash
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: logstash-keystore failing with an error (elastic#12784)
* Fix: missing password dependency require which causes `bin/logstash-keystore` to fail with an error: ``` ERROR: Failed to load settings file from "path.settings". Aborting... path.setting=/logstash-7.12.0/config, exception=NameError, message=>uninitialized constant LogStash::Util::Password ``` * Fix: review all LS parts depending on Password * Test: bin/logstash-keystore create/list
- Loading branch information
Showing
6 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
services: | ||
- logstash |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Licensed to Elasticsearch B.V. under one or more contributor | ||
# license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright | ||
# ownership. Elasticsearch B.V. licenses this file to you under | ||
# the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
require_relative "../../framework/fixture" | ||
require_relative "../../framework/settings" | ||
require_relative "../../services/logstash_service" | ||
# require_relative "../../framework/helpers" | ||
require "logstash/devutils/rspec/spec_helper" | ||
require "stud/temporary" | ||
require "fileutils" | ||
require "open3" | ||
|
||
describe "CLI > logstash-keystore" do | ||
|
||
before(:all) do | ||
@fixture = Fixture.new(__FILE__) | ||
@logstash = @fixture.get_service("logstash") | ||
end | ||
|
||
context 'create' do | ||
|
||
before do | ||
FileUtils.rm_f File.join(@logstash.logstash_home, 'config', 'logstash.keystore') | ||
end | ||
|
||
it "works" do | ||
keystore_list = @logstash.run_cmd(['bin/logstash-keystore', 'create'], true, 'LOGSTASH_KEYSTORE_PASS' => 'PaSSWD') | ||
expect(keystore_list.stderr_and_stdout).to_not match(/ERROR/) | ||
expect(keystore_list.stderr_and_stdout).to include('Created Logstash keystore') | ||
end | ||
|
||
end | ||
|
||
context 'list' do | ||
|
||
before do | ||
keystore = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "fixtures", "logstash.keystore")) | ||
FileUtils.cp keystore, File.join(@logstash.logstash_home, 'config') | ||
end | ||
|
||
after do | ||
FileUtils.rm_f File.join(@logstash.logstash_home, 'config', 'logstash.keystore') | ||
end | ||
|
||
it "works" do | ||
keystore_list = @logstash.run_cmd(['bin/logstash-keystore', 'list'], true, 'LOGSTASH_KEYSTORE_PASS' => 'PaSSWD') | ||
expect(keystore_list.stderr_and_stdout).to_not match(/ERROR/) | ||
expect(keystore_list.stderr_and_stdout).to include('foo') # contains foo: bar | ||
end | ||
|
||
end | ||
|
||
end |