Skip to content

Commit a575168

Browse files
authored
Merge pull request #529 from jcpunk/service-cpu-schedule
Add `CPUSchedulingPolicy` for service entries
2 parents a7cf607 + b276936 commit a575168

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

REFERENCE.md

+1
Original file line numberDiff line numberDiff line change
@@ -3269,6 +3269,7 @@ Struct[{
32693269
Optional['KillSignal'] => Pattern[/^SIG[A-Z]+$/],
32703270
Optional['KillMode'] => Enum['control-group', 'mixed', 'process', 'none'],
32713271
Optional['Nice'] => Variant[String[0,0],Integer[-20,19]],
3272+
Optional['CPUSchedulingPolicy'] => Enum['','batch','fifo','idle','other','rr'],
32723273
Optional['IOSchedulingClass'] => Enum['','realtime','best-effort','idle'],
32733274
Optional['IOSchedulingPriority'] => Variant[String[0,0],Integer[0,7]],
32743275
Optional['SyslogIdentifier'] => String,

spec/type_aliases/systemd_unit_service_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@
7676
it { is_expected.to allow_value({ 'Nice' => 19 }) }
7777
it { is_expected.not_to allow_value({ 'Nice' => '0' }) }
7878

79+
it { is_expected.to allow_value({ 'CPUSchedulingPolicy' => 'idle' }) }
80+
it { is_expected.to allow_value({ 'CPUSchedulingPolicy' => '' }) }
81+
it { is_expected.not_to allow_value({ 'CPUSchedulingPolicy' => 'best-effort' }) }
82+
7983
it { is_expected.to allow_value({ 'IOSchedulingClass' => 'best-effort' }) }
8084
it { is_expected.to allow_value({ 'IOSchedulingClass' => '' }) }
8185
it { is_expected.not_to allow_value({ 'IOSchedulingClass' => 'random' }) }

types/unit/service.pp

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
Optional['KillSignal'] => Pattern[/^SIG[A-Z]+$/],
2828
Optional['KillMode'] => Enum['control-group', 'mixed', 'process', 'none'],
2929
Optional['Nice'] => Variant[String[0,0],Integer[-20,19]],
30+
Optional['CPUSchedulingPolicy'] => Enum['','batch','fifo','idle','other','rr'],
3031
Optional['IOSchedulingClass'] => Enum['','realtime','best-effort','idle'],
3132
Optional['IOSchedulingPriority'] => Variant[String[0,0],Integer[0,7]],
3233
Optional['SyslogIdentifier'] => String,

0 commit comments

Comments
 (0)