commit yast2-dhcp-server for openSUSE:Factory
Hello community, here is the log from the commit of package yast2-dhcp-server for openSUSE:Factory checked in at 2018-11-02 10:51:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-dhcp-server (Old) and /work/SRC/openSUSE:Factory/.yast2-dhcp-server.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-dhcp-server" Fri Nov 2 10:51:31 2018 rev:55 rq:642412 version:4.1.3 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-dhcp-server/yast2-dhcp-server.changes 2018-09-05 13:49:03.594308409 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-dhcp-server.new/yast2-dhcp-server.changes 2018-11-02 10:51:38.230275232 +0100 @@ -1,0 +2,12 @@ +Tue Oct 16 16:13:23 CEST 2018 - schubi@suse.de + +- Added license file to spec. + +------------------------------------------------------------------- +Tue Oct 9 14:53:26 CEST 2018 - schubi@suse.de + +- Adapting to new firewall API (bsc#1108942) +- 4.1.3 + +------------------------------------------------------------------- + Old: ---- yast2-dhcp-server-4.1.2.tar.bz2 New: ---- yast2-dhcp-server-4.1.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-dhcp-server.spec ++++++ --- /var/tmp/diff_new_pack.MKc9s3/_old 2018-11-02 10:51:38.726275173 +0100 +++ /var/tmp/diff_new_pack.MKc9s3/_new 2018-11-02 10:51:38.730275173 +0100 @@ -17,7 +17,7 @@ Name: yast2-dhcp-server -Version: 4.1.2 +Version: 4.1.3 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -38,6 +38,8 @@ BuildRequires: yast2-testsuite # Yast2::ServiceWidget BuildRequires: yast2 >= 4.1.0 +BuildRequires: rubygem(%rb_default_ruby_abi:rspec) +BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) Requires: bind-utils Requires: perl-Digest-SHA1 @@ -46,8 +48,9 @@ Requires: perl-gettext Requires: yast2-ldap Requires: yast2-perl-bindings -# Yast2::ServiceWidget -Requires: yast2 >= 4.1.0 +# firewalld_wrapper.rb +Requires: yast2 >= 4.1.22 + # DnsServerAPI::IsServiceConfigurableExternally Requires: yast2-dns-server >= 2.13.16 @@ -66,6 +69,9 @@ %prep %setup -n %{name}-%{version} +%check +rake test:unit + %build %yast_build @@ -84,6 +90,7 @@ %{yast_scrconfdir}/etc_dhcpd_conf.scr %{yast_agentdir}/ag_dhcpd_conf %doc %{yast_docdir} +%license COPYING %{yast_schemadir}/autoyast/rnc/dhcp-server.rnc %changelog ++++++ yast2-dhcp-server-4.1.2.tar.bz2 -> yast2-dhcp-server-4.1.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.1.2/package/yast2-dhcp-server.changes new/yast2-dhcp-server-4.1.3/package/yast2-dhcp-server.changes --- old/yast2-dhcp-server-4.1.2/package/yast2-dhcp-server.changes 2018-08-24 17:09:37.000000000 +0200 +++ new/yast2-dhcp-server-4.1.3/package/yast2-dhcp-server.changes 2018-10-16 17:43:37.000000000 +0200 @@ -1,4 +1,16 @@ ------------------------------------------------------------------- +Tue Oct 16 16:13:23 CEST 2018 - schubi@suse.de + +- Added license file to spec. + +------------------------------------------------------------------- +Tue Oct 9 14:53:26 CEST 2018 - schubi@suse.de + +- Adapting to new firewall API (bsc#1108942) +- 4.1.3 + +------------------------------------------------------------------- + Fri Aug 24 14:21:19 UTC 2018 - dgonzalez@suse.com - Display an information message instead of the service widget diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.1.2/package/yast2-dhcp-server.spec new/yast2-dhcp-server-4.1.3/package/yast2-dhcp-server.spec --- old/yast2-dhcp-server-4.1.2/package/yast2-dhcp-server.spec 2018-08-24 17:09:37.000000000 +0200 +++ new/yast2-dhcp-server-4.1.3/package/yast2-dhcp-server.spec 2018-10-16 17:43:37.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-dhcp-server -Version: 4.1.2 +Version: 4.1.3 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -29,10 +29,13 @@ BuildRequires: yast2-devtools >= 3.1.10 # Yast2::ServiceWidget BuildRequires: yast2 >= 4.1.0 +BuildRequires: rubygem(%rb_default_ruby_abi:rspec) +BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) Requires: perl-gettext yast2-perl-bindings bind-utils perl-X500-DN yast2-ldap perl-Digest-SHA1 perl-Parse-RecDescent -# Yast2::ServiceWidget -Requires: yast2 >= 4.1.0 +# firewalld_wrapper.rb +Requires: yast2 >= 4.1.22 + # DnsServerAPI::IsServiceConfigurableExternally Requires: yast2-dns-server >= 2.13.16 @@ -49,6 +52,9 @@ %prep %setup -n %{name}-%{version} +%check +rake test:unit + %build %yast_build @@ -68,5 +74,6 @@ %{yast_scrconfdir}/etc_dhcpd_conf.scr %{yast_agentdir}/ag_dhcpd_conf %doc %{yast_docdir} +%license COPYING %{yast_schemadir}/autoyast/rnc/dhcp-server.rnc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.1.2/src/include/dhcp-server/widgets.rb new/yast2-dhcp-server-4.1.3/src/include/dhcp-server/widgets.rb --- old/yast2-dhcp-server-4.1.2/src/include/dhcp-server/widgets.rb 2018-08-24 17:09:37.000000000 +0200 +++ new/yast2-dhcp-server-4.1.3/src/include/dhcp-server/widgets.rb 2018-10-16 17:43:37.000000000 +0200 @@ -10,11 +10,14 @@ require "yast2/system_service" require "cwm" require "cwm/service_widget" +require "y2firewall/helpers/interfaces" # Representation of the configuration of dhcp-server. # Input and output routines. module Yast module DhcpServerWidgetsInclude + include Y2Firewall::Helpers::Interfaces + def initialize_dhcp_server_widgets(include_target) textdomain "dhcp-server" @@ -27,7 +30,6 @@ Yast.import "LogView" Yast.import "Popup" Yast.import "TablePopup" - Yast.import "SuSEFirewall" Yast.import "Mode" end @@ -280,7 +282,7 @@ # Initialize the widget # @param [String] id any widget id def OpenFirewallInit(id) - enabled = SuSEFirewall.GetEnableService + enabled = firewalld.enabled? open = DhcpServer.GetOpenFirewall UI.ChangeWidget(Id(id), :Enabled, enabled) UI.ChangeWidget(Id(id), :Value, open) @@ -303,7 +305,7 @@ def OpenFirewallValidate(id, event) event = deep_copy(event) open = Convert.to_boolean(UI.QueryWidget(Id(id), :Value)) - enabled = SuSEFirewall.GetEnableService + enabled = firewalld.enabled? if enabled && !open # yes-no popup @@ -325,7 +327,7 @@ Builtins.foreach(@ifaces) do |ifcfg, interface| # interface is active if Ops.get_boolean(interface, "active", false) == true - if SuSEFirewall.GetZoneOfInterface(ifcfg) == nil + unless interface_zone(ifcfg) ifaces_not_in_fw = Builtins.add(ifaces_not_in_fw, ifcfg) end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.1.2/src/modules/DhcpServer.pm new/yast2-dhcp-server-4.1.3/src/modules/DhcpServer.pm --- old/yast2-dhcp-server-4.1.2/src/modules/DhcpServer.pm 2018-08-24 17:09:37.000000000 +0200 +++ new/yast2-dhcp-server-4.1.3/src/modules/DhcpServer.pm 2018-10-16 17:43:37.000000000 +0200 @@ -114,7 +114,7 @@ YaST::YCP::Import ("Popup"); YaST::YCP::Import ("Progress"); YaST::YCP::Import ("Report"); -YaST::YCP::Import ("SuSEFirewall"); +YaST::YCP::Import ("FirewalldWrapper"); YaST::YCP::Import ("DnsServerAPI"); ##------------------------------------------------------------------------- @@ -1496,7 +1496,7 @@ if (! Mode->test ()) { my $progress_orig = Progress->set (0); - SuSEFirewall->Read (); + FirewalldWrapper->read(); Progress->set ($progress_orig); } @@ -1514,11 +1514,11 @@ @allowed_interfaces = split (/ /, $ifaces_list); # if firewall is enabled - if (SuSEFirewall->GetEnableService()) { + if (FirewalldWrapper->is_enabled()) { foreach my $iface (@allowed_interfaces) { - my $iface_zone = SuSEFirewall->GetZoneOfInterface($iface); + my $iface_zone = FirewalldWrapper->zone_name_of_interface($iface); if (defined $iface_zone) { - $open_firewall = SuSEFirewall->IsServiceSupportedInZone("service:dhcp-server", $iface_zone); + $open_firewall = FirewalldWrapper->is_service_in_zone("dhcp", $iface_zone); } else { $open_firewall = 0; } @@ -1656,7 +1656,7 @@ my $ok = 1; - $modified = $modified || SuSEFirewall->GetModified (); + $modified = $modified || FirewalldWrapper->is_modified (); if (! $modified) { @@ -1713,20 +1713,20 @@ if (\@original_allowed_interfaces != \@allowed_interfaces) { # disabling on all interfaces my @all_ifaces; - foreach my $iface (@{SuSEFirewall->GetAllKnownInterfaces()}) { + foreach my $iface (@{FirewalldWrapper->all_known_interfaces() // []}) { push @all_ifaces, $iface->{'id'}; } - SuSEFirewall->SetServices (["service:dhcp-server"], \@all_ifaces, 0); + FirewalldWrapper->modify_interface_services (["dhcp"], \@all_ifaces, 0); if ($open_firewall) { # allowing on selected interfaces - SuSEFirewall->SetServices (["service:dhcp-server"], \@allowed_interfaces, 1); + FirewalldWrapper->modify_interface_services (["dhcp"], \@allowed_interfaces, 1); } } if (! Mode->test ()) { my $progress_orig = Progress->set (0); - SuSEFirewall->Write (); + FirewalldWrapper->write (); Progress->set ($progress_orig); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.1.2/src/modules/DhcpServerUI.rb new/yast2-dhcp-server-4.1.3/src/modules/DhcpServerUI.rb --- old/yast2-dhcp-server-4.1.2/src/modules/DhcpServerUI.rb 2018-08-24 17:09:37.000000000 +0200 +++ new/yast2-dhcp-server-4.1.3/src/modules/DhcpServerUI.rb 2018-10-16 17:43:37.000000000 +0200 @@ -22,7 +22,6 @@ Yast.import "Mode" Yast.import "Popup" Yast.import "Report" - Yast.import "SuSEFirewall" @current_entry_type = "" @current_entry_id = "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.1.2/test/widgets_test.rb new/yast2-dhcp-server-4.1.3/test/widgets_test.rb --- old/yast2-dhcp-server-4.1.2/test/widgets_test.rb 2018-08-24 17:09:37.000000000 +0200 +++ new/yast2-dhcp-server-4.1.3/test/widgets_test.rb 2018-10-16 17:43:37.000000000 +0200 @@ -6,6 +6,7 @@ class Test < Yast::Client def initialize Yast.include self, "dhcp-server/widgets.rb" + @ifaces = {"eth0" => {"active" => true}} end end end @@ -68,4 +69,46 @@ expect(subject.DNSZonesValidate("ddns_enable", {})).to eq true end end + + describe "#OpenFirewallValidate" do + context "firewall not enabled" do + it "returns true" do + expect(Y2Firewall::Firewalld.instance).to receive(:enabled?).and_return(false) + expect(Yast::Popup).not_to receive(:YesNo) + expect(Yast::Report).not_to receive(:Error) + expect(subject.OpenFirewallValidate("widget_id",0)).to eq true + end + end + + context "firewall enabled" do + before do + allow(Y2Firewall::Firewalld.instance).to receive(:enabled?).and_return(true) + end + + context "port is not opened" do + before do + allow(Yast::UI).to receive(:QueryWidget).with(Id("open_port"), :Value) + .and_return(false) + end + + it "asks for continuing" do + expect(Yast::Popup).to receive(:YesNo).and_return(true) + expect(subject.OpenFirewallValidate("open_port",0)).to eq true + end + end + + context "port is opened" do + before do + allow(Yast::UI).to receive(:QueryWidget).with(Id("open_port"), :Value) + .and_return(true) + end + + it "reports interfaces which are not mentioned in any firewall zone" do + expect(Y2Firewall::Firewalld.instance).to receive(:zones).and_return([]) + expect(Yast::Report).to receive(:Error) + expect(subject.OpenFirewallValidate("open_port",0)).to eq true + end + end + end + end end
participants (1)
-
root