Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/puppet/provider/service/systemd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
defaultfor 'os.name' => :ubuntu
notdefaultfor 'os.name' => :ubuntu, 'os.release.major' => ["10.04", "12.04", "14.04", "14.10"] # These are using upstart
defaultfor 'os.name' => :cumuluslinux, 'os.release.major' => %w[3 4]
defaultfor 'os.family' => :raspbian, 'os.release.major' => ["12"]

def self.instances
i = []
Expand Down
7 changes: 7 additions & 0 deletions spec/unit/provider/service/systemd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@
end
end

it "should be the default provider on raspbian12" do
allow(Facter).to receive(:value).with(:osfamily).and_return(:debian)
allow(Facter).to receive(:value).with(:operatingsystem).and_return(:raspbian)
allow(Facter).to receive(:value).with(:operatingsystemmajrelease).and_return("12")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puppet 8 (main) uses structured facts so these stubs need to be updated. Something like:

-    allow(Facter).to receive(:value).with(:osfamily).and_return(:debian)
-    allow(Facter).to receive(:value).with(:operatingsystem).and_return(:raspbian)
-    allow(Facter).to receive(:value).with(:operatingsystemmajrelease).and_return("12")
+    allow(Facter).to receive(:value).with(:os.family).and_return(:debian)
+    allow(Facter).to receive(:value).with(:os.name).and_return(:raspbian)
+    allow(Facter).to receive(:value).with(:os.release.major).and_return("12")

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaevans will you take care or have you given up (for whatever reason)?

expect(provider_class).to be_default
end

%i[enabled? daemon_reload? enable disable start stop status restart].each do |method|
it "should have a #{method} method" do
expect(provider).to respond_to(method)
Expand Down