Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Yast2::Systemd::UnitProperties#static?
- Loading branch information
Showing
3 changed files
with
252 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
Type=simple | ||
Restart=no | ||
NotifyAccess=none | ||
RestartUSec=100ms | ||
TimeoutStartUSec=1min 30s | ||
TimeoutStopUSec=1min 30s | ||
RuntimeMaxUSec=infinity | ||
WatchdogUSec=0 | ||
WatchdogTimestampMonotonic=0 | ||
PermissionsStartOnly=no | ||
RootDirectoryStartOnly=no | ||
RemainAfterExit=no | ||
GuessMainPID=yes | ||
MainPID=0 | ||
ControlPID=0 | ||
FileDescriptorStoreMax=0 | ||
NFileDescriptorStore=0 | ||
StatusErrno=0 | ||
Result=success | ||
UID=[not set] | ||
GID=[not set] | ||
NRestarts=0 | ||
ExecMainStartTimestampMonotonic=0 | ||
ExecMainExitTimestampMonotonic=0 | ||
ExecMainPID=0 | ||
ExecMainCode=0 | ||
ExecMainStatus=0 | ||
ExecStart={ path=/usr/sbin/in.tftpd ; argv[]=/usr/sbin/in.tftpd -u $TFTP_USER -s $TFTP_DIRECTORY $TFTP_OPTIONS ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 } | ||
Slice=system.slice | ||
MemoryCurrent=[not set] | ||
CPUUsageNSec=[not set] | ||
TasksCurrent=[not set] | ||
IPIngressBytes=18446744073709551615 | ||
IPIngressPackets=18446744073709551615 | ||
IPEgressBytes=18446744073709551615 | ||
IPEgressPackets=18446744073709551615 | ||
Delegate=no | ||
CPUAccounting=no | ||
CPUWeight=[not set] | ||
StartupCPUWeight=[not set] | ||
CPUShares=[not set] | ||
StartupCPUShares=[not set] | ||
CPUQuotaPerSecUSec=infinity | ||
IOAccounting=no | ||
IOWeight=[not set] | ||
StartupIOWeight=[not set] | ||
BlockIOAccounting=no | ||
BlockIOWeight=[not set] | ||
StartupBlockIOWeight=[not set] | ||
MemoryAccounting=no | ||
MemoryLow=0 | ||
MemoryHigh=infinity | ||
MemoryMax=infinity | ||
MemorySwapMax=infinity | ||
MemoryLimit=infinity | ||
DevicePolicy=closed | ||
TasksAccounting=yes | ||
TasksMax=4915 | ||
IPAccounting=no | ||
EnvironmentFile=/etc/sysconfig/tftp (ignore_errors=no) | ||
UMask=0022 | ||
LimitCPU=infinity | ||
LimitCPUSoft=infinity | ||
LimitFSIZE=infinity | ||
LimitFSIZESoft=infinity | ||
LimitDATA=infinity | ||
LimitDATASoft=infinity | ||
LimitSTACK=infinity | ||
LimitSTACKSoft=8388608 | ||
LimitCORE=infinity | ||
LimitCORESoft=infinity | ||
LimitRSS=infinity | ||
LimitRSSSoft=infinity | ||
LimitNOFILE=4096 | ||
LimitNOFILESoft=1024 | ||
LimitAS=infinity | ||
LimitASSoft=infinity | ||
LimitNPROC=63322 | ||
LimitNPROCSoft=63322 | ||
LimitMEMLOCK=16777216 | ||
LimitMEMLOCKSoft=16777216 | ||
LimitLOCKS=infinity | ||
LimitLOCKSSoft=infinity | ||
LimitSIGPENDING=63322 | ||
LimitSIGPENDINGSoft=63322 | ||
LimitMSGQUEUE=819200 | ||
LimitMSGQUEUESoft=819200 | ||
LimitNICE=0 | ||
LimitNICESoft=0 | ||
LimitRTPRIO=0 | ||
LimitRTPRIOSoft=0 | ||
LimitRTTIME=infinity | ||
LimitRTTIMESoft=infinity | ||
OOMScoreAdjust=0 | ||
Nice=0 | ||
IOSchedulingClass=0 | ||
IOSchedulingPriority=0 | ||
CPUSchedulingPolicy=0 | ||
CPUSchedulingPriority=0 | ||
TimerSlackNSec=50000 | ||
CPUSchedulingResetOnFork=no | ||
NonBlocking=no | ||
StandardInput=socket | ||
StandardInputData= | ||
StandardOutput=inherit | ||
StandardError=inherit | ||
TTYReset=no | ||
TTYVHangup=no | ||
TTYVTDisallocate=no | ||
SyslogPriority=30 | ||
SyslogLevelPrefix=yes | ||
SyslogLevel=6 | ||
SyslogFacility=3 | ||
LogLevelMax=-1 | ||
SecureBits=0 | ||
CapabilityBoundingSet=cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_chroot cap_sys_ptrace cap_sys_pacct cap_sys_admin cap_sys_boot cap_sys_nice cap_sys_resource cap_sys_time cap_sys_tty_config cap_lease cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin cap_syslog cap_wake_alarm cap_block_suspend | ||
AmbientCapabilities= | ||
DynamicUser=no | ||
RemoveIPC=no | ||
MountFlags= | ||
PrivateTmp=no | ||
PrivateDevices=yes | ||
ProtectKernelTunables=no | ||
ProtectKernelModules=no | ||
ProtectControlGroups=no | ||
PrivateNetwork=no | ||
PrivateUsers=no | ||
ProtectHome=no | ||
ProtectSystem=no | ||
SameProcessGroup=no | ||
UtmpMode=init | ||
IgnoreSIGPIPE=yes | ||
NoNewPrivileges=no | ||
SystemCallErrorNumber=0 | ||
LockPersonality=no | ||
RuntimeDirectoryPreserve=no | ||
RuntimeDirectoryMode=0755 | ||
StateDirectoryMode=0755 | ||
CacheDirectoryMode=0755 | ||
LogsDirectoryMode=0755 | ||
ConfigurationDirectoryMode=0755 | ||
MemoryDenyWriteExecute=no | ||
RestrictRealtime=no | ||
RestrictNamespaces=no | ||
MountAPIVFS=no | ||
KeyringMode=private | ||
KillMode=control-group | ||
KillSignal=15 | ||
SendSIGKILL=yes | ||
SendSIGHUP=no | ||
Id=tftp.service | ||
Names=tftp.service | ||
Requires=sysinit.target system.slice | ||
Wants=network.target | ||
Conflicts=shutdown.target | ||
Before=shutdown.target | ||
After=basic.target network.target sysinit.target system.slice | ||
Description=Tftp Server | ||
LoadState=loaded | ||
ActiveState=inactive | ||
SubState=dead | ||
FragmentPath=/usr/lib/systemd/system/tftp.service | ||
UnitFileState=static | ||
UnitFilePreset=disabled | ||
StateChangeTimestampMonotonic=0 | ||
InactiveExitTimestampMonotonic=0 | ||
ActiveEnterTimestampMonotonic=0 | ||
ActiveExitTimestampMonotonic=0 | ||
InactiveEnterTimestampMonotonic=0 | ||
CanStart=yes | ||
CanStop=yes | ||
CanReload=no | ||
CanIsolate=no | ||
StopWhenUnneeded=no | ||
RefuseManualStart=no | ||
RefuseManualStop=no | ||
AllowIsolate=no | ||
DefaultDependencies=yes | ||
OnFailureJobMode=replace | ||
IgnoreOnIsolate=no | ||
NeedDaemonReload=no | ||
JobTimeoutUSec=infinity | ||
JobRunningTimeoutUSec=infinity | ||
JobTimeoutAction=none | ||
ConditionResult=no | ||
AssertResult=no | ||
ConditionTimestampMonotonic=0 | ||
AssertTimestampMonotonic=0 | ||
Transient=no | ||
Perpetual=no | ||
StartLimitIntervalUSec=10s | ||
StartLimitBurst=5 | ||
StartLimitAction=none | ||
FailureAction=none | ||
SuccessAction=none | ||
CollectMode=inactive |
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,52 @@ | ||
#!/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" | ||
|
||
describe Yast2::Systemd::UnitProperties do | ||
include SystemdServiceStubs | ||
|
||
describe "#static?" do | ||
subject(:properties) { described_class.new(service, nil) } | ||
let(:service) { Yast2::Systemd::Service.build(service_name) } | ||
|
||
before do | ||
stub_services(service: service_name) | ||
end | ||
|
||
context "when service is static" do | ||
let(:service_name) { "tftp" } | ||
|
||
it "returns true" do | ||
expect(properties.static?).to eq(true) | ||
end | ||
end | ||
|
||
context "when service is not static" do | ||
let(:service_name) { "sshd" } | ||
|
||
it "returns false" do | ||
expect(properties.static?).to eq(false) | ||
end | ||
end | ||
end | ||
end |