[Pkg-puppet-devel] [facter] 140/180: adding tests for LinuxMint facts
Stig Sandbeck Mathisen
ssm at debian.org
Mon Jun 30 15:06:41 UTC 2014
This is an automated email from the git hooks/post-receive script.
ssm pushed a commit to branch master
in repository facter.
commit 7dd4e531f059f3973177a4c41dff758de91b7e0d
Author: Spencer Krum <nibz at cat.pdx.edu>
Date: Fri Jun 28 14:47:52 2013 -0700
adding tests for LinuxMint facts
This commit cherry-picks ec6aed48
Conflicts:
spec/unit/operatingsystemrelease_spec.rb
spec/unit/osfamily_spec.rb
---
lib/facter/operatingsystemrelease.rb | 2 --
lib/facter/osfamily.rb | 2 +-
spec/unit/operatingsystem_spec.rb | 7 +++++++
spec/unit/operatingsystemrelease_spec.rb | 1 +
spec/unit/osfamily_spec.rb | 1 +
5 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/lib/facter/operatingsystemrelease.rb b/lib/facter/operatingsystemrelease.rb
index 5927c44..67447b0 100644
--- a/lib/facter/operatingsystemrelease.rb
+++ b/lib/facter/operatingsystemrelease.rb
@@ -90,8 +90,6 @@ confine :operatingsystem => 'CumulusLinux'
end
end
-
-
Facter.add(:operatingsystemrelease) do
confine :operatingsystem => %w{SLES SLED OpenSuSE}
setcode do
diff --git a/lib/facter/osfamily.rb b/lib/facter/osfamily.rb
index f39633d..15925d3 100644
--- a/lib/facter/osfamily.rb
+++ b/lib/facter/osfamily.rb
@@ -18,7 +18,7 @@ Facter.add(:osfamily) do
case Facter.value(:operatingsystem)
when "RedHat", "Fedora", "CentOS", "Scientific", "SLC", "Ascendos", "CloudLinux", "PSBM", "OracleLinux", "OVS", "OEL", "Amazon", "XenServer"
"RedHat"
- when "LinuxMint", "Ubuntu", "Debian", "CumulusLinux"
+ when "LinuxMint", "Ubuntu", "Debian", "CumulusLinux"
"Debian"
when "SLES", "SLED", "OpenSuSE", "SuSE"
"Suse"
diff --git a/spec/unit/operatingsystem_spec.rb b/spec/unit/operatingsystem_spec.rb
index 3e066aa..370e72e 100755
--- a/spec/unit/operatingsystem_spec.rb
+++ b/spec/unit/operatingsystem_spec.rb
@@ -90,6 +90,13 @@ describe "Operating System fact" do
Facter.fact(:operatingsystem).value.should == "Ubuntu"
end
+ it "on LinuxMint should use the lsbdistid fact" do
+ FileUtils.stubs(:exists?).with("/etc/debian_version").returns true
+
+ Facter.stubs(:value).with(:lsbdistid).returns("LinuxMint")
+ Facter.fact(:operatingsystem).value.should == "LinuxMint"
+ end
+
end
diff --git a/spec/unit/operatingsystemrelease_spec.rb b/spec/unit/operatingsystemrelease_spec.rb
index 1492c5b..3f161e6 100755
--- a/spec/unit/operatingsystemrelease_spec.rb
+++ b/spec/unit/operatingsystemrelease_spec.rb
@@ -17,6 +17,7 @@ describe "Operating System Release fact" do
"OpenWrt" => "/etc/openwrt_version",
"CentOS" => "/etc/redhat-release",
"RedHat" => "/etc/redhat-release",
+ "LinuxMint" => "/etc/linuxmint/info",
"Scientific" => "/etc/redhat-release",
"Fedora" => "/etc/fedora-release",
"MeeGo" => "/etc/meego-release",
diff --git a/spec/unit/osfamily_spec.rb b/spec/unit/osfamily_spec.rb
index 195296f..1bdf9d7 100644
--- a/spec/unit/osfamily_spec.rb
+++ b/spec/unit/osfamily_spec.rb
@@ -13,6 +13,7 @@ describe "OS Family fact" do
'Solaris' => 'Solaris',
'Ubuntu' => 'Debian',
'Debian' => 'Debian',
+ 'LinuxMint' => 'Debian',
'Gentoo' => 'Gentoo',
'Fedora' => 'RedHat',
'Amazon' => 'RedHat',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git
More information about the Pkg-puppet-devel
mailing list