[Pkg-puppet-devel] [facter] 60/180: (FACT-451) Add Cumulus Linux distro to Debian OS family

Stig Sandbeck Mathisen ssm at debian.org
Mon Jun 30 15:06:31 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 919034f4de449bd56f60de6e7f748046aede76c0
Author: Leslie Carr <geekgirl at gmail.com>
Date:   Mon Mar 31 13:18:43 2014 -0700

    (FACT-451) Add Cumulus Linux distro to Debian OS family
    
    Cumulus Linux should report Debian for the osfamily fact.
    
    Conflicts:
    	lib/facter/osfamily.rb
    	spec/unit/osfamily_spec.rb
---
 lib/facter/osfamily.rb     |  2 +-
 spec/unit/osfamily_spec.rb | 59 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 1 deletion(-)

diff --git a/lib/facter/osfamily.rb b/lib/facter/osfamily.rb
index 6162ef8..f7008c1 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 "Ubuntu", "Debian"
+    when "Ubuntu", "Debian", "CumulusLinux"
       "Debian"
     when "SLES", "SLED", "OpenSuSE", "SuSE"
       "Suse"
diff --git a/spec/unit/osfamily_spec.rb b/spec/unit/osfamily_spec.rb
new file mode 100644
index 0000000..d0a1210
--- /dev/null
+++ b/spec/unit/osfamily_spec.rb
@@ -0,0 +1,59 @@
+#! /usr/bin/env ruby
+
+require 'spec_helper'
+
+describe "OS Family fact" do
+
+  {
+    'Archlinux'    => 'Archlinux',
+    'SmartOS'      => 'Solaris',
+    'OpenIndiana'  => 'Solaris',
+    'OmniOS'       => 'Solaris',
+    'Nexenta'      => 'Solaris',
+    'Solaris'      => 'Solaris',
+    'Ubuntu'       => 'Debian',
+    'Debian'       => 'Debian',
+    'CumulusLinux' => 'Debian',
+    'Gentoo'       => 'Gentoo',
+    'Fedora'       => 'RedHat',
+    'Amazon'       => 'RedHat',
+    'OracleLinux'  => 'RedHat',
+    'OVS'          => 'RedHat',
+    'OEL'          => 'RedHat',
+    'CentOS'       => 'RedHat',
+    'SLC'          => 'RedHat',
+    'Scientific'   => 'RedHat',
+    'CloudLinux'   => 'RedHat',
+    'PSBM'         => 'RedHat',
+    'Ascendos'     => 'RedHat',
+    'XenServer'    => 'RedHat',
+    'RedHat'       => 'RedHat',
+    'SLES'         => 'Suse',
+    'SLED'         => 'Suse',
+    'OpenSuSE'     => 'Suse',
+    'SuSE'         => 'Suse',
+  }.each do |os,family|
+    it "should return #{family} on operatingsystem #{os}" do
+      Facter.fact(:operatingsystem).stubs(:value).returns os
+      Facter.fact(:osfamily).value.should == family
+    end
+  end
+
+  [
+    'MeeGo',
+    'VMWareESX',
+    'Bluewhite64',
+    'Slamd64',
+    'Slackware',
+    'Alpine',
+    'ESXi',
+    'windows',
+    'HP-UX'
+  ].each do |os|
+    it "should return the kernel fact on operatingsystem #{os}" do
+      Facter.fact(:operatingsystem).stubs(:value).returns os
+      Facter.fact(:kernel).stubs(:value).returns 'random_kernel_fact'
+      Facter.fact(:osfamily).value.should == 'random_kernel_fact'
+    end
+  end
+end

-- 
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