[yast-commit] [ci_new_pac] JFYI yast2-ftp-server -> sle12
Script 'mail_helper' called by bg Hello packager, This is just FYI. Your package was checked in in distribution "sle12" by autobuild-member: bg. Here comes the log... ---------------------------%<------------------------------ Hi, here is the log from ci_new_pac /mounts/work_src_done/SLE12/yast2-ftp-server -> sle12 ## BNC# 888287 : "yast2 ftp-server sets syslog_enable=NO by default" (ASSIGNED/) Changes: -------- --- /work/SRC/SUSE:SLE-12:GA/yast2-ftp-server/yast2-ftp-server.changes 2014-07-30 14:48:57.000000000 +0200 +++ /mounts/work_src_done/SLE12/yast2-ftp-server/yast2-ftp-server.changes 2014-08-22 16:34:53.000000000 +0200 @@ -1,0 +2,12 @@ +Wed Aug 20 09:25:51 UTC 2014 - cwh@suse.com + +- Using different defaults about logging for vsftpd/pure-ftpd (bnc#888287) +- Setting xferlog_enable = YES instead of syslog_enable +- 3.1.3 + +------------------------------------------------------------------- +Fri Aug 1 12:51:37 UTC 2014 - mvidner@suse.com + +- Enabled YARD docs, documented the basics of FtpServer. + +------------------------------------------------------------------- calling whatdependson for sle12-i586 Packages directly triggered for rebuild: - yast2-ftp-server - yast2-schema ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/SUSE:SLE-12:GA/yast2-ftp-server (Old) and /mounts/work_src_done/SLE12/yast2-ftp-server (BS:build ID:43062 MAIL:yast-commit@opensuse.org) (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-ftp-server", Maintainer is "yast-commit@opensuse.org" Old: ---- yast2-ftp-server-3.1.2.tar.bz2 New: ---- yast2-ftp-server-3.1.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-ftp-server.spec ++++++ --- /var/tmp/diff_new_pack.M86W4x/_old 2014-08-25 15:36:32.000000000 +0200 +++ /var/tmp/diff_new_pack.M86W4x/_new 2014-08-25 15:36:32.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-ftp-server -Version: 3.1.2 +Version: 3.1.3 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-ftp-server-3.1.2.tar.bz2 -> yast2-ftp-server-3.1.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ftp-server-3.1.2/package/yast2-ftp-server.changes new/yast2-ftp-server-3.1.3/package/yast2-ftp-server.changes --- old/yast2-ftp-server-3.1.2/package/yast2-ftp-server.changes 2014-07-30 11:24:53.000000000 +0200 +++ new/yast2-ftp-server-3.1.3/package/yast2-ftp-server.changes 2014-08-22 16:31:01.000000000 +0200 @@ -1,4 +1,16 @@ ------------------------------------------------------------------- +Wed Aug 20 09:25:51 UTC 2014 - cwh@suse.com + +- Using different defaults about logging for vsftpd/pure-ftpd (bnc#888287) +- Setting xferlog_enable = YES instead of syslog_enable +- 3.1.3 + +------------------------------------------------------------------- +Fri Aug 1 12:51:37 UTC 2014 - mvidner@suse.com + +- Enabled YARD docs, documented the basics of FtpServer. + +------------------------------------------------------------------- Wed Jul 30 09:35:28 CEST 2014 - schubi@suse.de - Taking vsftpd ftp-server default in autoyast configuration module diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ftp-server-3.1.2/package/yast2-ftp-server.spec new/yast2-ftp-server-3.1.3/package/yast2-ftp-server.spec --- old/yast2-ftp-server-3.1.2/package/yast2-ftp-server.spec 2014-07-30 11:24:53.000000000 +0200 +++ new/yast2-ftp-server-3.1.3/package/yast2-ftp-server.spec 2014-08-22 16:31:01.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-ftp-server -Version: 3.1.2 +Version: 3.1.3 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ftp-server-3.1.2/src/include/ftp-server/complex.rb new/yast2-ftp-server-3.1.3/src/include/ftp-server/complex.rb --- old/yast2-ftp-server-3.1.2/src/include/ftp-server/complex.rb 2014-07-30 11:24:53.000000000 +0200 +++ new/yast2-ftp-server-3.1.3/src/include/ftp-server/complex.rb 2014-08-22 16:31:01.000000000 +0200 @@ -254,7 +254,6 @@ # @return `abort if aborted and `next otherwise def ReadDialog Wizard.RestoreHelp(Ops.get_string(@HELPS, "read", "")) - # FtpServer::AbortFunction = PollAbort; result = ReadFTPService() return :abort if !result return :abort if !Confirm.MustBeRoot @@ -272,7 +271,6 @@ # @return `abort if aborted and `next otherwise def WriteDialog Wizard.RestoreHelp(Ops.get_string(@HELPS, "write", "")) - # FtpServer::AbortFunction = PollAbort; ret = FtpServer.Write ret ? :next : :abort end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ftp-server-3.1.2/src/include/ftp-server/write_load.rb new/yast2-ftp-server-3.1.3/src/include/ftp-server/write_load.rb --- old/yast2-ftp-server-3.1.2/src/include/ftp-server/write_load.rb 2014-07-30 11:24:53.000000000 +0200 +++ new/yast2-ftp-server-3.1.3/src/include/ftp-server/write_load.rb 2014-08-22 16:31:01.000000000 +0200 @@ -471,11 +471,20 @@ port_range != nil ? Builtins.splitstring(port_range, ":") : nil end - # Function return init value for UI widgets - # and prepare internal data structure for writing - # to config file - # Example: ValueUI("ChrootEnabled") => "yes"/"no" - + # Convert between the UI (yast), and system (vsftpd, pure_ftpd) settings. + # + # The system settings are multiplexed by + # {FtpServerClass#vsftpd_edit vsftpd_edit}: + # {FtpServerClass#VS_SETTINGS VS_SETTINGS} (for vsftpd_edit == true) or + # {FtpServerClass#PURE_SETTINGS PURE_SETTINGS} (for vsftpd_edit == false). + # + # @param [String] key + # in the {FtpServerClass#EDIT_SETTINGS EDIT_SETTINGS} vocabulary + # @param write + # - true: write to system settings from UI settings + # ({FtpServerClass#EDIT_SETTINGS EDIT_SETTINGS}) + # - false: read the UI settings from the system settings + # @return [String] the UI value (for read) or nil (for write) def ValueUI(key, write) ports = [] authentic = 0 @@ -510,32 +519,16 @@ when "VerboseLogging" if @vsftpd_edit if write - Ops.set( - @VS_SETTINGS, - "log_ftp_protocol", - Ops.get(@EDIT_SETTINGS, "VerboseLogging") - ) - Ops.set( - @VS_SETTINGS, - "syslog_enable", - Ops.get(@EDIT_SETTINGS, "VerboseLogging") - ) + @VS_SETTINGS["log_ftp_protocol"] = @EDIT_SETTINGS["VerboseLogging"] + @VS_SETTINGS["xferlog_enable"] = @EDIT_SETTINGS["VerboseLogging"] else - return Builtins.haskey(@VS_SETTINGS, "log_ftp_protocol") ? - Builtins.toupper(Ops.get(@VS_SETTINGS, "log_ftp_protocol")) : - Ops.get(@DEFAULT_CONFIG, "VerboseLogging") + return (@VS_SETTINGS["log_ftp_protocol"] || @DEFAULT_CONFIG["log_ftp_protocol"]).upcase end else if write - Ops.set( - @PURE_SETTINGS, - "VerboseLog", - Ops.get(@EDIT_SETTINGS, "VerboseLogging") - ) + @PURE_SETTINGS["VerboseLog"] = @EDIT_SETTINGS["VerboseLogging"] else - return Builtins.haskey(@PURE_SETTINGS, "VerboseLog") ? - Builtins.toupper(Ops.get(@PURE_SETTINGS, "VerboseLog")) : - Ops.get(@DEFAULT_CONFIG, "VerboseLogging") + return (@PURE_SETTINGS["VerboseLog"] || @DEFAULT_CONFIG["VerboseLogging"]).upcase end end when "FtpDirLocal" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ftp-server-3.1.2/src/modules/FtpServer.rb new/yast2-ftp-server-3.1.3/src/modules/FtpServer.rb --- old/yast2-ftp-server-3.1.2/src/modules/FtpServer.rb 2014-07-30 11:24:53.000000000 +0200 +++ new/yast2-ftp-server-3.1.3/src/modules/FtpServer.rb 2014-08-22 16:31:01.000000000 +0200 @@ -1,17 +1,20 @@ # encoding: utf-8 -# File: modules/FtpServer.ycp -# Package: Configuration of FtpServer -# Summary: FtpServer settings, input and output functions -# Authors: Jozef Uhliarik <juhliarik@suse.cz> -# -# $Id: FtpServer.ycp 27914 2006-02-13 14:32:08Z juhliarik $ -# -# Representation of the configuration of FtpServer. -# Input and output routines. require "yast" module Yast + # Configure **both** [vsftpd][v] and [pure-ftpd][p] in a single class. + # + # [v]: https://security.appspot.com/vsftpd.html + # [p]: http://www.pureftpd.org/ + # + # For the configuration we have 3 vocabularies, + # mapped by {FtpServerWriteLoadInclude#ValueUI}. + # + # - pure-ftpd uses CamelCase keys + # - vsftpd uses snake_case keys + # - yast uses CamelCase keys which are almost(!!1!) + # the same as for pure-ftpd. class FtpServerClass < Module def main Yast.import "UI" @@ -155,11 +158,6 @@ @pure_ftpd_xinet_conf = [] - - # list of keys from map DEFAULT_CONFIG - # - # global list <string> - @UI_keys = [ "ChrootEnable", "VerboseLogging", @@ -194,13 +192,10 @@ "EnableUpload" ] - # map of deafult values for options in UI - # - # global map <string, string > - @DEFAULT_CONFIG = { "ChrootEnable" => "NO", - "VerboseLogging" => "NO", + "VerboseLogging" => "NO", # Default value for pure-ftpd. + "log_ftp_protocol" => "YES", # Default value for vsftp (bnc#888287). "FtpDirLocal" => "", #if empty doesn't write this options via SCR "FtpDirAnon" => "", #if empty doesn't write this options via SCR "Umask" => "", @@ -233,35 +228,17 @@ "EnableUpload" => "NO" } - # map <string, string > of pure-ftpd settings - # @PURE_SETTINGS = {} - - - # map <string, string > of vsftpd settings - # @VS_SETTINGS = {} - - # map <string, string > of vsftpd settings - # @EDIT_SETTINGS = {} - - Yast.include self, "ftp-server/write_load.rb" - - - @ftps = true # Write only, used during autoinstallation. # Don't run services and SuSEconfig, it's all done at one place. @write_only = false - - # Abort function - # return boolean return true if abort - @AbortFunction = fun_ref(method(:Modified), "boolean ()") end # Read current pure-ftpd configuration @@ -270,7 +247,6 @@ def ReadPUREFTPDSettings Builtins.foreach(SCR.Dir(path(".pure-ftpd"))) do |key| val = Convert.to_string(SCR.Read(Builtins.add(path(".pure-ftpd"), key))) - #string val = (string) select((list <string>) SCR::Read(add(.pure-ftpd, key)), 0, ""); Ops.set(@PURE_SETTINGS, key, val) if val != nil end @@ -281,18 +257,15 @@ ) Builtins.y2milestone("---------------------------------------------") - true end # Read current vsftpd configuration # # @return [Boolean] successfull - def ReadVSFTPDSettings Builtins.foreach(SCR.Dir(path(".vsftpd"))) do |key| val = Convert.to_string(SCR.Read(Builtins.add(path(".vsftpd"), key))) - #string val = (string) select((list <string>) SCR::Read(add(.pure-ftpd, key)), 0, ""); Ops.set(@VS_SETTINGS, key, val) if val != nil end Builtins.y2milestone("-------------VS_SETTINGS-------------------") @@ -302,7 +275,6 @@ ) Builtins.y2milestone("---------------------------------------------") - true end @@ -311,8 +283,6 @@ # existing upload file and permissions # # @return [Boolean] successfull - - def ReadVSFTPDUpload result = false command = "" @@ -334,7 +304,6 @@ result = false end if result - #Popup::Message("Work ReadVSFTPDUpload"); @create_upload_dir = true permissions = Builtins.substring( Builtins.tostring(Ops.get(options, "stdout")), @@ -346,10 +315,8 @@ if Ops.less_than(Builtins.size(w), 3) || Ops.less_than(Builtins.size(r), 3) @upload_good_permission = false - #Popup::Message("good permissions"); else @upload_good_permission = true - #Popup::Message("wrong permissions"); end end end @@ -362,8 +329,6 @@ # checking permissions for upload # # @return [Boolean] successfull - - def ReadPermisionUplaod result = false command = "" @@ -388,7 +353,6 @@ Ops.subtract(Builtins.size(directories), 1), "" ) - #Popup::Message(upload_dir); directory = Ops.add( "/", Builtins.mergestring( @@ -399,7 +363,6 @@ "/" ) ) - #Popup::Message(directory); else @pure_ftp_allowed_permissios_upload = -1 end @@ -435,13 +398,10 @@ if Ops.less_than(Builtins.size(w), 3) || Ops.less_than(Builtins.size(r), 3) @pure_ftp_allowed_permissios_upload = 0 - #Popup::Message("good permissions"); else @pure_ftp_allowed_permissios_upload = 1 - #Popup::Message("wrong permissions"); end end - #Popup::Message(tostring(pure_ftp_allowed_permissios_upload)); end result end @@ -450,11 +410,10 @@ # to temporary structure # # @return [Boolean] successfull - def InitEDIT_SETTINGS Builtins.foreach(@UI_keys) do |key| val = ValueUI(key, false) - Ops.set(@EDIT_SETTINGS, key, val) if val != nil #if (val == nil) Popup::Message(key);; + Ops.set(@EDIT_SETTINGS, key, val) if val != nil end Builtins.y2milestone("-------------EDIT_SETTINGS-------------------") @@ -553,12 +512,10 @@ end - # Remap UI pure-ftpd or vsftpd configuration # to write structure for SCR # # @return [Boolean] successfull - def WriteToSETTINGS Builtins.foreach(@UI_keys) { |key| ValueUI(key, true) } @@ -575,23 +532,9 @@ true end - - # Restart daemon apply changes - # only if daemon running... - # - # @return [Boolean] successfull - #boolean ApplyChanges () { - - - - - #} - - # Write firewall configuration # # @return [Boolean] successfull - def WriteFirewallSettings port_range = "" active_port = "" @@ -635,7 +578,6 @@ # @param [String] key of EDIT_SETTINGS map # @param [String] value of "key" EDIT_SETTINGS map # @return [Boolean] successfull - def WriteToEditMap(key, value) Ops.set(@EDIT_SETTINGS, key, value) true @@ -782,8 +724,6 @@ else result = false end - - #Popup::Message(command); else result = true end @@ -819,26 +759,15 @@ result end + # read value from PURE_EDIT_SETTINGS # # @param [String] key for edit map (ID of option) # @return [String] value of key from edit map - def ValueUIEdit(key) Ops.get(@EDIT_SETTINGS, key) end - # * Abort function - # * @return boolean return true if abort - # * - # global define boolean Abort() ``{ - # if(AbortFunction != nil) - # { - # return AbortFunction () == true; - # } - # return false; - # } - # Returns whether the configuration has been modified. # # @return [Boolean] modified @@ -846,17 +775,15 @@ @modified end - # Function set modified variable. + # Function set {#modified} variable. # - # @param boolean modified + # @param [Boolean] set_modified def SetModified(set_modified) @modified = set_modified nil end - - # Returns a confirmation popup dialog whether user wants to really abort. # # @return [Boolean] result of Popup::ReallyAbort(GetModified() @@ -875,8 +802,6 @@ false end - - # Data was modified? # @return true if modified def Modified @@ -884,8 +809,6 @@ @modified end - - # Read all FtpServer settings # @return true on success def Read @@ -1096,8 +1019,6 @@ result end - - # Dump the FtpServer settings to a single map # (For use by autoinstallation.) # @return [Hash] Dumped settings (later acceptable by Import ()) @@ -1151,8 +1072,6 @@ _S end - - # Create a textual summary and a list of unconfigured cards # @return summary of the current configuration def Summary @@ -1174,12 +1093,6 @@ _S end - # Create an overview table with all configured cards - # @return table items - def Overview - [] - end - #zzz # Return packages needed to be installed and removed during # Autoinstallation to insure module has all needed software @@ -1193,42 +1106,79 @@ end end + # This helper allows YARD to extract DSL-defined attributes. + # Unfortunately YARD has problems with the Capitalized ones, + # so those must be done manually. + # @!macro [attach] publish_variable + # @!attribute $1 + # @return [$2] + def self.publish_variable(name, type) + publish :variable => name, :type => type + end + publish :function => :SetModified, :type => "void (boolean)" publish :function => :Modified, :type => "boolean ()" publish :function => :WriteToEditMap, :type => "boolean (string, string)" publish :function => :WriteSettings, :type => "boolean ()" publish :function => :WriteUpload, :type => "boolean ()" publish :function => :WriteXinetd, :type => "boolean ()" - publish :variable => :modified, :type => "boolean" - publish :variable => :proposal_valid, :type => "boolean" - publish :variable => :vsftpd_edit, :type => "boolean" - publish :variable => :vsftpd_installed, :type => "boolean" - publish :variable => :pureftpd_installed, :type => "boolean" - publish :variable => :vsftpd_xined_id, :type => "integer" - publish :variable => :pureftpd_xined_id, :type => "integer" - publish :variable => :start_xinetd, :type => "boolean" - publish :variable => :pure_ftp_xinetd_running, :type => "boolean" - publish :variable => :vsftp_xinetd_running, :type => "boolean" - publish :variable => :stop_daemon_xinetd, :type => "boolean" - publish :variable => :create_upload_dir, :type => "boolean" - publish :variable => :upload_good_permission, :type => "boolean" - publish :variable => :pure_ftp_allowed_permissios_upload, :type => "integer" - publish :variable => :change_permissions, :type => "boolean" - publish :variable => :anon_homedir, :type => "string" - publish :variable => :anon_uid, :type => "integer" - publish :variable => :pure_ftpd_xinet_conf, :type => "list <string>" + publish_variable :modified, "boolean" + publish_variable :proposal_valid, "boolean" + publish_variable :vsftpd_edit, "boolean" + publish_variable :vsftpd_installed, "boolean" + publish_variable :pureftpd_installed, "boolean" + publish_variable :vsftpd_xined_id, "integer" + publish_variable :pureftpd_xined_id, "integer" + publish_variable :start_xinetd, "boolean" + publish_variable :pure_ftp_xinetd_running, "boolean" + publish_variable :vsftp_xinetd_running, "boolean" + publish_variable :stop_daemon_xinetd, "boolean" + publish_variable :create_upload_dir, "boolean" + publish_variable :upload_good_permission, "boolean" + publish_variable :pure_ftp_allowed_permissios_upload, "integer" + publish_variable :change_permissions, "boolean" + publish_variable :anon_homedir, "string" + publish_variable :anon_uid, "integer" + publish_variable :pure_ftpd_xinet_conf, "list <string>" + + # @attribute [r] UI_keys + # @return [Array<String>] + # A list of setting keys yast cares about, + # in the {#EDIT_SETTINGS} vocabulary. + # It should be made a constant. publish :variable => :UI_keys, :type => "list <string>" + + # @attribute DEFAULT_CONFIG + # @return [Hash<String,String>] + # Defaults for {#EDIT_SETTINGS} in case the value is not found + # in the system settings. publish :variable => :DEFAULT_CONFIG, :type => "map <string, string>" + + # @attribute PURE_SETTINGS + # @return [Hash<String,String>] + # Uses CamelCase, {FtpServerWriteLoadInclude#ValueUI ValueUI} maps it + # to {#EDIT_SETTINGS} and {#DEFAULT_CONFIG}. publish :variable => :PURE_SETTINGS, :type => "map <string, string>" + + # @attribute VS_SETTINGS + # @return [Hash<String,String>] + # Uses snake_case, {FtpServerWriteLoadInclude#ValueUI ValueUI} maps it + # to {#EDIT_SETTINGS} and {#DEFAULT_CONFIG}. publish :variable => :VS_SETTINGS, :type => "map <string, string>" + + # @attribute EDIT_SETTINGS + # @return [Hash<String,String>] + # Uses CamelCase with similar but not the same keys as {#PURE_SETTINGS}. + # {FtpServerWriteLoadInclude#ValueUI ValueUI} maps it to {#PURE_SETTINGS} + # and {#VS_SETTINGS}. publish :variable => :EDIT_SETTINGS, :type => "map <string, string>" + publish :function => :PureSettingsForXinetd, :type => "string ()" publish :function => :WriteStartViaXinetd, :type => "boolean (boolean, boolean)" publish :function => :ValueUI, :type => "string (string, boolean)" publish :function => :ValueUIEdit, :type => "string (string)" - publish :variable => :ftps, :type => "boolean" - publish :variable => :write_only, :type => "boolean" - publish :variable => :AbortFunction, :type => "boolean ()" + publish_variable :ftps, "boolean" + publish_variable :write_only, "boolean" publish :function => :GetModified, :type => "boolean ()" publish :function => :Abort, :type => "boolean ()" publish :function => :PollAbort, :type => "boolean ()" @@ -1239,7 +1189,6 @@ publish :function => :Export, :type => "map ()" publish :function => :OptionsSummary, :type => "string ()" publish :function => :Summary, :type => "string ()" - publish :function => :Overview, :type => "list ()" publish :function => :AutoPackages, :type => "map ()" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ftp-server-3.1.2/test/verbose_logging_test.rb new/yast2-ftp-server-3.1.3/test/verbose_logging_test.rb --- old/yast2-ftp-server-3.1.2/test/verbose_logging_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-ftp-server-3.1.3/test/verbose_logging_test.rb 2014-08-22 16:31:01.000000000 +0200 @@ -0,0 +1,126 @@ +#! /usr/bin/env rspec + +ENV["Y2DIR"] = File.expand_path("../../src", __FILE__) + +require "yast" + +Yast.import "FtpServer" + +VS_CONFIG_PATH = Yast::Path.new(".vsftpd") +PURE_CONFIG_PATH = Yast::Path.new(".pure-ftpd") + +def mock_config(config_path, map) + allow(Yast::SCR).to receive(:Dir).with(config_path).and_return(map.keys) + map.each_pair do |key, value| + allow(Yast::SCR).to receive(:Read).with(config_path + key).and_return(value) + end +end + +VS_SETTINGS = { + "write_enable" => "NO", + "dirmessage_enable" => "YES", + "nopriv_user" => "ftpsecure", + "local_enable" => "YES", + "anonymous_enable" => "YES", + "anon_world_readable_only" => "YES", + "syslog_enable" => "YES", + "connect_from_port_20" => "YES", + "ascii_upload_enable" => "YES", + "pam_service_name" => "vsftpd", + "listen" => "NO", + "listen_ipv6" => "YES", + "ssl_enable" => "NO", + "pasv_min_port" => "30000", + "pasv_max_port" => "30100" +} + +PURE_SETTINGS = { + "AllowAnonymousFXP" => "no", + "AllowDotFiles" => "yes", + "AllowUserFXP" => "no", + "AnonymousCanCreateDirs" => "no", + "AnonymousCantUpload" => "yes", + "AnonymousOnly" => "yes", + "AntiWarez" => "yes", + "AutoRename" => "yes", + "BrokenClientsCompatibility" => "no", + "ChrootEveryone" => "yes", + "CustomerProof" => "yes", + "Daemonize" => "no", + "DisplayDotFiles" => "yes", + "DontResolve" => "yes", + "LimitRecursion" => "10000 8", + "MaxClientsNumber" => "10", + "MaxClientsPerIP" => "3", + "MaxDiskUsage" => "99", + "MaxIdleTime" => "15", + "MaxLoad" => "4", + "MinUID" => "40", + "NoAnonymous" => "no", + "NoRename" => "yes", + "PAMAuthentication" => "yes", + "PassivePortRange" => "30000 30100", + "ProhibitDotFilesRead" => "no", + "ProhibitDotFilesWrite" => "yes", + "SyslogFacility" => "ftp", + "VerboseLog" => "no" +} + +describe "Yast::FtpServer" do + describe "#ValueUI" do + context "'VerboseLogging' when getting vsftpd settings" do + before do + Yast::FtpServer.vsftpd_edit = true + end + + it "returns default value 'YES' if 'log_ftp_protocol' missing in config file" do + mock_config(VS_CONFIG_PATH, VS_SETTINGS) + Yast::FtpServer.ReadVSFTPDSettings() + + expect(Yast::FtpServer.ValueUI("VerboseLogging", false)).to eql "YES" + end + + it "returns value from config file 'NO' if 'log_ftp_protocol = NO' in config file" do + mock_config(VS_CONFIG_PATH, VS_SETTINGS.merge("log_ftp_protocol" => "NO")) + Yast::FtpServer.ReadVSFTPDSettings() + + expect(Yast::FtpServer.ValueUI("VerboseLogging", false)).to eql "NO" + end + + it "returns value from config file 'YES' if 'log_ftp_protocol = YES' in config file" do + mock_config(VS_CONFIG_PATH, VS_SETTINGS.merge("log_ftp_protocol" => "YES")) + Yast::FtpServer.ReadVSFTPDSettings() + + expect(Yast::FtpServer.ValueUI("VerboseLogging", false)).to eql "YES" + end + end + + context "'VerboseLogging' when getting pure-ftpd settings" do + before do + Yast::FtpServer.vsftpd_edit = false + end + + it "returns default value 'NO' if config file empty" do + mock_config(PURE_CONFIG_PATH, {}) + Yast::FtpServer.ReadPUREFTPDSettings() + + expect(Yast::FtpServer.ValueUI("VerboseLogging", false)).to eql "NO" + end + + it "returns value from config file 'NO' if 'VerboseLog = no' in config file" do + mock_config(PURE_CONFIG_PATH, PURE_SETTINGS) + Yast::FtpServer.ReadPUREFTPDSettings() + + expect(Yast::FtpServer.ValueUI("VerboseLogging", false)).to eql "NO" + end + + it "returns value from config file 'YES' if 'VerboseLog = yes' in config file" do + mock_config(PURE_CONFIG_PATH, PURE_SETTINGS.merge("VerboseLog" => "YES")) + Yast::FtpServer.ReadPUREFTPDSettings() + + expect(Yast::FtpServer.ValueUI("VerboseLogging", false)).to eql "YES" + end + end + + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-ftp-server-3.1.2/.yardopts new/yast2-ftp-server-3.1.3/.yardopts --- old/yast2-ftp-server-3.1.2/.yardopts 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-ftp-server-3.1.3/.yardopts 2014-08-22 16:31:01.000000000 +0200 @@ -0,0 +1,6 @@ +--no-private +--protected +--markup markdown +--output-dir doc/autodocs +--readme README.md +src/**/*.rb continue with "q"... Checked in at Mon Aug 25 15:37:23 CEST 2014 by bg Remember to have fun... -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
bg