From 6cf1c6960982ae705de1bc52aebea70412ee39a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz?= <1691872+dgdavid@users.noreply.github.com> Date: Tue, 14 Aug 2018 08:43:39 +0100 Subject: [PATCH] Use the new ServiceWidget (#26) * Drop TriggeredBy property from old testsuite * Bump version and update changes file * Use CWM::ServiceWidget instead ServiceStatus * Avoid DhcpServer Perl module to overlap with Yast2::SystemService Despite services will be managed by Yast2::SystemService from now on, it is necessary to keep the related Perl code for `auto` and `config` modes until them will be also managed from Ruby. * Update Yast2 required version * Use CWM::ServiceWidget also in the wizard dialogs (first run) * Update from code review * Bump version and update changes file * Manage the service status and start mode directly from Ruby code Using the `keep_state` option of Yast2::SystemService#save method. See commit 7acbe06. * Drop no longer necessaries `systemctl` commands from old testsuite * Update from code review --- package/yast2-dhcp-server.changes | 13 ++ package/yast2-dhcp-server.spec | 10 +- src/include/dhcp-server/dialogs.rb | 82 +++++++---- src/include/dhcp-server/dialogs2.rb | 38 +----- src/include/dhcp-server/widgets.rb | 79 +++-------- src/modules/DhcpServer.pm | 27 ---- test/dialog_test.rb | 127 ++++++++++++++++++ test/widgets_test.rb | 2 - testsuite/tests/Write.out | 20 --- testsuite/tests/YaPIAddDeclaration.out | 4 +- testsuite/tests/YaPIDeleteDeclartion.out | 8 +- .../tests/YaPISetDeclarationDirectives.out | 4 +- testsuite/tests/YaPISetDeclarationOptions.out | 4 +- testsuite/tests/YaPISetDeclarationParent.out | 4 +- 14 files changed, 229 insertions(+), 193 deletions(-) create mode 100644 test/dialog_test.rb diff --git a/package/yast2-dhcp-server.changes b/package/yast2-dhcp-server.changes index 026406d..6ad8637 100644 --- a/package/yast2-dhcp-server.changes +++ b/package/yast2-dhcp-server.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Aug 13 12:00:22 UTC 2018 - dgonzalez@suse.com + +- Use CWM::ServiceWidget to manage the service status + (part of fate#319428). +- 4.1.0 + +------------------------------------------------------------------- +Mon Aug 13 10:32:56 UTC 2018 - igonzalezsosa@suse.com + +- Fix package building with yast2 4.0.84 (bsc#1104644). +- 4.0.3 + ------------------------------------------------------------------- Fri Aug 3 09:39:35 UTC 2018 - igonzalezsosa@suse.com diff --git a/package/yast2-dhcp-server.spec b/package/yast2-dhcp-server.spec index 75fbf3d..375e2b8 100644 --- a/package/yast2-dhcp-server.spec +++ b/package/yast2-dhcp-server.spec @@ -17,7 +17,7 @@ Name: yast2-dhcp-server -Version: 4.0.2 +Version: 4.1.0 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -27,12 +27,12 @@ Group: System/YaST License: GPL-2.0 BuildRequires: perl-Digest-SHA1 perl-X500-DN perl-XML-Writer docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2-perl-bindings yast2-testsuite yast2-dns-server BuildRequires: yast2-devtools >= 3.1.10 -# UI::ServiceStatus -BuildRequires: yast2 >= 3.1.161 +# Yast2::ServiceWidget +BuildRequires: yast2 >= 4.1.0 Requires: perl-gettext yast2-perl-bindings bind-utils perl-X500-DN yast2-ldap perl-Digest-SHA1 perl-Parse-RecDescent -# UI::ServiceStatus -Requires: yast2 >= 3.1.161 +# Yast2::ServiceWidget +Requires: yast2 >= 4.1.0 # DnsServerAPI::IsServiceConfigurableExternally Requires: yast2-dns-server >= 2.13.16 diff --git a/src/include/dhcp-server/dialogs.rb b/src/include/dhcp-server/dialogs.rb index 20f8f8b..add3f78 100644 --- a/src/include/dhcp-server/dialogs.rb +++ b/src/include/dhcp-server/dialogs.rb @@ -10,8 +10,13 @@ # # Representation of the configuration of dhcp-server. # Input and output routines. + +require "yast2/popup" + module Yast module DhcpServerDialogsInclude + include Yast::Logger + def initialize_dhcp_server_dialogs(include_target) textdomain "dhcp-server" @@ -23,6 +28,7 @@ def initialize_dhcp_server_dialogs(include_target) Yast.import "Popup" Yast.import "Label" Yast.import "Confirm" + Yast.import "Mode" @functions = { :abort => fun_ref(method(:confirmAbort), "boolean ()") } end @@ -47,44 +53,66 @@ def ReadDialog end # Write settings dialog - # @return `abort if aborted and `next otherwise + # + # @return [Symbol] :next whether configuration is saved successfully + # :back if user decided to go back to change settings + # :abort otherwise def WriteDialog - Builtins.y2milestone("Running write dialog") - Wizard.RestoreHelp(Ops.get(@HELPS, "write", "")) - ret = DhcpServer.Write - if ret && restart_after_writing? - # Restart only if it's already running - DhcpServerUI.service.try_restart - end - # yes-no popup - if !ret && - Popup.YesNo( - _("Saving the configuration failed. Change the settings?") - ) - return :back - end - ret ? :next : :abort + help_text = @HELPS.fetch("write", "") + Wizard.RestoreHelp(help_text) + + return :next if write_settings + return :back if back_to_change_setting? + :abort end # Write settings without quitting def SaveAndRestart(event) - return nil unless CWM.validate_current_widgets(event) - CWM.save_current_widgets(event) + return nil unless validate_and_save_widgets(event) + + help_text = @HELPS.fetch("write", "") Wizard.CreateDialog - Wizard.RestoreHelp(Ops.get(@HELPS, "write", "")) - ret = DhcpServer.Write - if ret - # Restart only if it's already running - DhcpServerUI.service.try_restart if restart_after_writing? - else - Report.Error(_("Saving the configuration failed")) - end - UI.CloseDialog + Wizard.RestoreHelp(help_text) + Report.Error(_("Saving the configuration failed")) unless write_settings + Wizard.CloseDialog + + service_widget.refresh nil end + # Write DHCP server settings and save the service + # + # @note currently, the DhpcServer is a Perl module, reason why the write of + # settings is being performed in two separate steps. + # + # @return [Boolean] true if settings are saved successfully; false otherwise + def write_settings + DhcpServer.Write && dhcp_service.save(keep_state: Mode.auto) + end + + # Shows a popup asking to user if wants to change settings + # + # @return [Boolean] true if user decides to go back to change settings; false otherwise + def back_to_change_setting? + change_settings_message = _("Saving the configuration failed. Change the settings?") + Yast2::Popup.show(change_settings_message, headline: :warning, buttons: :yes_no) == :yes + end + + # Validates and saves CWM widgets + # + # @param [Hash] event map that triggered saving + # + # @return [Boolean] true when widgets pass the validaton; false otherwise + def validate_and_save_widgets(event) + return false unless CWM.validate_current_widgets(event) + + CWM.save_current_widgets(event) + + true + end + # Run main dialog # @return [Symbol] for wizard sequencer def OldMainDialog diff --git a/src/include/dhcp-server/dialogs2.rb b/src/include/dhcp-server/dialogs2.rb index b404aba..f7fefbe 100644 --- a/src/include/dhcp-server/dialogs2.rb +++ b/src/include/dhcp-server/dialogs2.rb @@ -80,7 +80,7 @@ def initialize_dhcp_server_dialogs2(include_target) @tabs = { "start_up" => { "contents" => VBox( - "service_status", + "service_widget", VSpacing(), "use_ldap", VSpacing(), @@ -97,7 +97,7 @@ def initialize_dhcp_server_dialogs2(include_target) # tree item "tree_item_label" => _("Start-Up"), "widget_names" => [ - "service_status", + "service_widget", "use_ldap", "expert_settings", "other_options", @@ -192,29 +192,7 @@ def initialize_dhcp_server_dialogs2(include_target) Builtins.union( @widgets, { - "auto_start_up" => CWMServiceStart.CreateAutoStartWidget( - { - "get_service_auto_start" => fun_ref( - method(:GetStartService), - "boolean ()" - ), - "set_service_auto_start" => fun_ref( - method(:SetStartService), - "void (boolean)" - ), - # radio button - "start_auto_button" => _("When &Booting"), - # radio button - "start_manual_button" => _("&Manually"), - "help" => Builtins.sformat( - CWMServiceStart.AutoStartHelpTemplate, - # part of help text - radio button label, NO SHORTCUT!!! - _("When Booting"), - # part of help text - radio button label, NO SHORTCUT!!! - _("Manually") - ) - } - ), + "auto_start_up" => service_widget.cwm_definition, "use_ldap" => CWMServiceStart.CreateLdapWidget( { "get_use_ldap" => fun_ref( @@ -2133,16 +2111,6 @@ def OtherOptionsStore(key, event) nil end - def GetStartService - DhcpServer.GetStartService - end - - def SetStartService(start) - DhcpServer.SetStartService(start) - - nil - end - # Common Config Dialog # @return [Symbol] for the wizard sequencer def CommonConfigDialog diff --git a/src/include/dhcp-server/widgets.rb b/src/include/dhcp-server/widgets.rb index c3b2632..1f06fd8 100644 --- a/src/include/dhcp-server/widgets.rb +++ b/src/include/dhcp-server/widgets.rb @@ -7,7 +7,9 @@ # Authors: Jiri Srain require "yast" -require "ui/service_status" +require "yast2/system_service" +require "cwm" +require "cwm/service_widget" # Representation of the configuration of dhcp-server. # Input and output routines. @@ -27,22 +29,20 @@ def initialize_dhcp_server_widgets(include_target) Yast.import "TablePopup" Yast.import "SuSEFirewall" Yast.import "Mode" - Yast.import "DhcpServerUI" end - # Widget to handle the status of the service + # Returns the service for DHCP # - # @return [::UI::ServiceStatus] nil if the service is not found (dhcp server - # not installed) - def status_widget - return @status_widget unless @status_widget.nil? - - service = DhcpServerUI.service - if service - @status_widget = ::UI::ServiceStatus.new(service, reload_flag_label: :restart) - else - nil - end + # @return [Yast2::SystemService] status service + def dhcp_service + @dhcp_service ||= Yast2::SystemService.find(DhcpServer.ServiceName) + end + + # Widget to define status and start mode of the service + # + # @return [::CWM::ServiceWidget] + def service_widget + @service_widget ||= ::CWM::ServiceWidget.new(dhcp_service) end # Function for deleting entry from section @@ -855,47 +855,15 @@ def AllSettingsButtonHandle(key, event) # Handle function for the 'Apply' button def handle_apply(_key, event) - event_id = event["ID"] - if event_id == "apply" - SaveAndRestart(event) - end - nil - end - - def init_service_status(_key) - # If UI::ServiceStatus is used, do not let DnsServer manage the service - # status, let the user decide - DhcpServer.SetWriteOnly(true) - nil - end + SaveAndRestart(event) if event["ID"] == "apply" - # Handle function for the ServiceStatus widget - def handle_service_status(_key, event) - event_id = event["ID"] - if status_widget.handle_input(event_id) == :enabled_flag - DhcpServer.SetModified - end nil end - # Store settings of the widget - # @param [String] id string widget id - # @param [Hash] event map event that caused storing process - def store_service_status(_key, _event) - DhcpServer.SetStartService(status_widget.enabled_flag?) - nil - end - - # Checks if the service must be restarted after saving - # @return [Boolean] - def restart_after_writing? - # If ServiceStatus is used, DhcpServer must be set to write-only - DhcpServer.GetWriteOnly() && status_widget && status_widget.reload_flag? - end - # Initialize widgets + # # Create description map and copy it into appropriate variable of the - # DhcpServer module + # DhcpServer module def InitWidgets options = [ "option subnet-mask", @@ -1326,16 +1294,9 @@ def InitWidgets # it needs the "dhcp-server" package already installed in the system # otherwise it crashes def InitServiceWidget - return if @widgets["service_status"] - - @widgets["service_status"] = { - "widget" => :custom, - "custom_widget" => status_widget.widget, - "help" => status_widget.help, - "init" => fun_ref(method(:init_service_status), "void (string)"), - "handle" => fun_ref(method(:handle_service_status), "symbol (string, map)"), - "store" => fun_ref(method(:store_service_status), "void (string, map)") - } + return if @widgets["service_widget"] + + @widgets["service_widget"] = service_widget.cwm_definition end end end diff --git a/src/modules/DhcpServer.pm b/src/modules/DhcpServer.pm index 1936923..c986236 100644 --- a/src/modules/DhcpServer.pm +++ b/src/modules/DhcpServer.pm @@ -1745,33 +1745,6 @@ sub Write { SCR->Write (".sysconfig.dhcpd.DHCPD_INTERFACE", $ifaces_list); SCR->Write (".sysconfig.dhcpd.DHCPD_OTHER_ARGS", $other_options); SCR->Write (".sysconfig.dhcpd", undef); - - - if ($start_service) - { - y2milestone ("Enabling the DHCP service"); - my $ret = 1; - if (! $write_only) - { - $ret = Service->Restart ($SERVICE); - } - Service->Enable ($SERVICE); - if (!$ret) - { - # error report - Report->Error (__("Error occurred while restarting the DHCP daemon.")); - $ok = 0; - } - } - else - { - y2milestone ("Disabling the DHCP service"); - if (! $write_only) - { - Service->Stop ($SERVICE); - } - Service->Disable ($SERVICE); - } Progress->NextStage (); diff --git a/test/dialog_test.rb b/test/dialog_test.rb new file mode 100644 index 0000000..1f1d69d --- /dev/null +++ b/test/dialog_test.rb @@ -0,0 +1,127 @@ +#!/usr/bin/env rspec +# encoding: utf-8 +# Copyright (c) [2018] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require_relative "test_helper" + +require "yast2/system_service" +require "cwm/service_widget" + +Yast.import "DhcpServer" + +describe "DhcpServerDialogsInclude" do + subject(:dialog) { TestDialog.new } + + class TestDialog + include Yast::I18n + include Yast::UIShortcuts + + def initialize + @HELPS = {} + Yast.include self, "dhcp-server/widgets.rb" + Yast.include self, "dhcp-server/dialogs.rb" + end + + def fun_ref(*args) + end + end + + let(:widget) { instance_double(::CWM::ServiceWidget, cwm_definition: {}) } + let(:service) { instance_double(Yast2::SystemService, save: true, currently_active?: true) } + + before do + allow(::CWM::ServiceWidget).to receive(:new).and_return(widget) + allow(Yast2::SystemService).to receive(:find).with("dhcpd").and_return(service) + end + + describe "#WriteDialog" do + let(:dhcp_configuration_written) { true } + + before do + allow(Yast::DhcpServer).to receive(:Write).and_return(dhcp_configuration_written) + end + + it "writes needed configuration" do + expect(Yast::DhcpServer).to receive(:Write) + + dialog.WriteDialog + end + + context "when configuration is written" do + it "saves the system service" do + expect(service).to receive(:save) + + dialog.WriteDialog + end + + it "returns :next" do + expect(dialog.WriteDialog).to eq(:next) + end + + context "and is in `auto` Mode" do + before do + allow(Yast::Mode).to receive(:auto).and_return(true) + end + + it "keeps current system status" do + expect(service).to receive(:save).with(hash_including(keep_state: true)) + + dialog.WriteDialog + end + end + end + + context "when the configuration is not written" do + before do + allow(Yast2::Popup).to receive(:show).and_return(change_settings) + end + + let(:change_settings) { :yes } + let(:dhcp_configuration_written) { false } + + it "does not save the system service" do + expect(service).to_not receive(:save) + + dialog.WriteDialog + end + + it "asks for changing the current settings" do + expect(Yast2::Popup).to receive(:show) + .with(instance_of(String), hash_including(buttons: :yes_no)) + + dialog.WriteDialog + end + + context "and user decides to change the current setting" do + it "returns :back" do + expect(dialog.WriteDialog).to eq(:back) + end + end + + context "and user decides to cancel" do + let(:change_settings) { :no } + + it "returns :abort" do + expect(subject.WriteDialog).to eq(:abort) + end + end + end + end +end diff --git a/test/widgets_test.rb b/test/widgets_test.rb index 9dede67..ad45891 100644 --- a/test/widgets_test.rb +++ b/test/widgets_test.rb @@ -10,8 +10,6 @@ def initialize end end - - describe "Yast::DhcpServerWidgetsInclude" do subject { Yast::Test.new } diff --git a/testsuite/tests/Write.out b/testsuite/tests/Write.out index b515440..8b124fe 100644 --- a/testsuite/tests/Write.out +++ b/testsuite/tests/Write.out @@ -3,16 +3,6 @@ Write .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" true Write .sysconfig.dhcpd.DHCPD_INTERFACE "" true Write .sysconfig.dhcpd.DHCPD_OTHER_ARGS "" true Write .sysconfig.dhcpd nil true -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled dhcpd.service " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password stop dhcpd.service " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled dhcpd.service " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled dhcpd.service " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password disable dhcpd.service " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled dhcpd.service " $["exit":0, "stderr":"", "stdout":""] Return true Dump =============================== Return nil @@ -22,14 +12,4 @@ Write .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "yes" true Write .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" true Write .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" true Write .sysconfig.dhcpd nil true -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled dhcpd.service " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password stop dhcpd.service " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled dhcpd.service " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled dhcpd.service " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password disable dhcpd.service " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"", "stdout":""] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled dhcpd.service " $["exit":0, "stderr":"", "stdout":""] Return true diff --git a/testsuite/tests/YaPIAddDeclaration.out b/testsuite/tests/YaPIAddDeclaration.out index 6ec1f34..45ae911 100644 --- a/testsuite/tests/YaPIAddDeclaration.out +++ b/testsuite/tests/YaPIAddDeclaration.out @@ -1,7 +1,7 @@ Dump ========================================================== Execute .target.bash_output "/bin/hostname --short" $["exit":0, "stderr":"localhost", "stdout":"localhost"] Execute .target.bash_output "/bin/hostname --fqdn" $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] +Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Read .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" Read .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" Read .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" @@ -14,7 +14,5 @@ Write .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" true Write .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" true Write .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" true Write .sysconfig.dhcpd nil true -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Return true Dump ========================================================== diff --git a/testsuite/tests/YaPIDeleteDeclartion.out b/testsuite/tests/YaPIDeleteDeclartion.out index 92d6dc2..575ff98 100644 --- a/testsuite/tests/YaPIDeleteDeclartion.out +++ b/testsuite/tests/YaPIDeleteDeclartion.out @@ -1,7 +1,7 @@ Dump ========================================================== Execute .target.bash_output "/bin/hostname --short" $["exit":0, "stderr":"localhost", "stdout":"localhost"] Execute .target.bash_output "/bin/hostname --fqdn" $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] +Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Read .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" Read .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" Read .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" @@ -14,13 +14,11 @@ Write .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" true Write .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" true Write .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" true Write .sysconfig.dhcpd nil true -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Return true Dump ========================================================== Execute .target.bash_output "/bin/hostname --short" $["exit":0, "stderr":"localhost", "stdout":"localhost"] Execute .target.bash_output "/bin/hostname --fqdn" $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] +Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Read .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" Read .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" Read .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" @@ -33,7 +31,5 @@ Write .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" true Write .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" true Write .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" true Write .sysconfig.dhcpd nil true -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Return true Dump ========================================================== diff --git a/testsuite/tests/YaPISetDeclarationDirectives.out b/testsuite/tests/YaPISetDeclarationDirectives.out index cb7172c..a4c34ef 100644 --- a/testsuite/tests/YaPISetDeclarationDirectives.out +++ b/testsuite/tests/YaPISetDeclarationDirectives.out @@ -1,7 +1,7 @@ Dump ========================================================== Execute .target.bash_output "/bin/hostname --short" $["exit":0, "stderr":"localhost", "stdout":"localhost"] Execute .target.bash_output "/bin/hostname --fqdn" $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] +Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Read .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" Read .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" Read .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" @@ -14,7 +14,5 @@ Write .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" true Write .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" true Write .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" true Write .sysconfig.dhcpd nil true -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Return true Dump ========================================================== diff --git a/testsuite/tests/YaPISetDeclarationOptions.out b/testsuite/tests/YaPISetDeclarationOptions.out index f7fd6e3..dfd23c6 100644 --- a/testsuite/tests/YaPISetDeclarationOptions.out +++ b/testsuite/tests/YaPISetDeclarationOptions.out @@ -1,7 +1,7 @@ Dump ========================================================== Execute .target.bash_output "/bin/hostname --short" $["exit":0, "stderr":"localhost", "stdout":"localhost"] Execute .target.bash_output "/bin/hostname --fqdn" $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] +Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Read .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" Read .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" Read .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" @@ -14,7 +14,5 @@ Write .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" true Write .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" true Write .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" true Write .sysconfig.dhcpd nil true -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Return true Dump ========================================================== diff --git a/testsuite/tests/YaPISetDeclarationParent.out b/testsuite/tests/YaPISetDeclarationParent.out index c3f7e14..c6068ac 100644 --- a/testsuite/tests/YaPISetDeclarationParent.out +++ b/testsuite/tests/YaPISetDeclarationParent.out @@ -1,7 +1,7 @@ Dump ========================================================== Execute .target.bash_output "/bin/hostname --short" $["exit":0, "stderr":"localhost", "stdout":"localhost"] Execute .target.bash_output "/bin/hostname --fqdn" $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] +Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Read .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" Read .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" Read .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" @@ -14,7 +14,5 @@ Write .sysconfig.dhcpd.DHCPD_RUN_CHROOTED "no" true Write .sysconfig.dhcpd.DHCPD_INTERFACE "eth0 eth2" true Write .sysconfig.dhcpd.DHCPD_OTHER_ARGS "-p 111" true Write .sysconfig.dhcpd nil true -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show dhcpd.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath --property=CanReload --property=TriggeredBy " $["exit":0, "stderr":"localhost", "stdout":"localhost"] Return true Dump ==========================================================