diff --git a/package/yast2-ftp-server.changes b/package/yast2-ftp-server.changes index 9eef296..3986fc8 100644 --- a/package/yast2-ftp-server.changes +++ b/package/yast2-ftp-server.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 23 09:02:55 UTC 2020 - Josef Reidinger + +- Fix return code of CLI "show" command (bsc#1143193) +- 4.2.4 + ------------------------------------------------------------------- Mon Dec 30 16:11:40 UTC 2019 - Josef Reidinger diff --git a/package/yast2-ftp-server.spec b/package/yast2-ftp-server.spec index 566560f..4c592ab 100644 --- a/package/yast2-ftp-server.spec +++ b/package/yast2-ftp-server.spec @@ -17,7 +17,7 @@ Name: yast2-ftp-server -Version: 4.2.3 +Version: 4.2.4 Release: 0 Summary: YaST2 - FTP configuration License: GPL-2.0-only @@ -27,14 +27,14 @@ Url: https://github.com/yast/yast-ftp-server Source0: %{name}-%{version}.tar.bz2 BuildRequires: update-desktop-files -# Yast2::Systemd::Service -BuildRequires: yast2 >= 4.1.3 +# Yast2::CommandLine readonly parameter +BuildRequires: yast2 >= 4.2.57 BuildRequires: yast2-devtools >= 4.2.2 BuildRequires: rubygem(%rb_default_ruby_abi:rspec) BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) -# Yast2::Systemd::Service -Requires: yast2 >= 4.1.3 +# Yast2::CommandLine readonly parameter +Requires: yast2 >= 4.2.57 Requires: yast2-ruby-bindings >= 1.0.0 BuildArch: noarch diff --git a/src/lib/y2ftp/clients/ftp_server.rb b/src/lib/y2ftp/clients/ftp_server.rb index 3238aaf..0c155b3 100644 --- a/src/lib/y2ftp/clients/ftp_server.rb +++ b/src/lib/y2ftp/clients/ftp_server.rb @@ -55,10 +55,11 @@ def run "finish" => fun_ref(Yast::FtpServer.method(:Write), "boolean ()"), "actions" => { "show" => { - "handler" => fun_ref(method(:FTPdCMDShow), "boolean (map)"), + "handler" => fun_ref(method(:FTPdCMDShow), "boolean (map)"), # TRANSLATORS: CommandLine help - "help" => _("Display settings"), - "example" => ["show"] + "help" => _("Display settings"), + "example" => ["show"], + "readonly" => true }, "startup" => { "handler" => fun_ref(method(:FTPdCMDStartup), "boolean (map)"), @@ -543,7 +544,7 @@ def FTPdCMDShow(_options) end CommandLine.Print("") - false + true end def FTPdCMDStartup(options) diff --git a/test/spec_helper.rb b/test/spec_helper.rb index 5e61e9e..6803485 100644 --- a/test/spec_helper.rb +++ b/test/spec_helper.rb @@ -20,6 +20,10 @@ SRC_PATH = File.expand_path("../src", __dir__) ENV["Y2DIR"] = SRC_PATH +# localization agnostic tests +ENV["LC_ALL"] = "en_US.utf-8" +ENV["LANG"] = "en_US.utf-8" + require "yast" # stub module to prevent its Import diff --git a/test/y2ftp/clients/ftp_server_test.rb b/test/y2ftp/clients/ftp_server_test.rb index 8d86e95..8eaa64b 100644 --- a/test/y2ftp/clients/ftp_server_test.rb +++ b/test/y2ftp/clients/ftp_server_test.rb @@ -26,6 +26,8 @@ subject { described_class.new } describe "#FTPdCMDShow" do + let(:anon_authen) { "0" } + before do allow(Yast::FtpServer).to receive(:EDIT_SETTINGS).and_return("AnonAuthen" => anon_authen) @@ -71,5 +73,9 @@ subject.FTPdCMDShow({}) end end + + it "returns true" do + expect(subject.FTPdCMDShow({})).to eq true + end end end