summaryrefslogtreecommitdiff
path: root/spec/unit/plugins/freebsd
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-01-08 13:51:41 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2014-01-08 13:51:41 -0800
commit75936c439e1383ac176114111755f7acde4d1fe8 (patch)
tree8849c20982ef67a9401dfaa6b934b95eacedd281 /spec/unit/plugins/freebsd
parentae86c3f97b2ea699d5e81ec459653398eef12561 (diff)
downloadohai-75936c439e1383ac176114111755f7acde4d1fe8.tar.gz
fix hostname plugin + add machinename variable
- removes :sigar platform that isn't a platform - aix and hpux fall back to sigar/default behavior - adds machinename attribute for raw output of 'hostname' command with no DNS trickery
Diffstat (limited to 'spec/unit/plugins/freebsd')
-rw-r--r--spec/unit/plugins/freebsd/hostname_spec.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/unit/plugins/freebsd/hostname_spec.rb b/spec/unit/plugins/freebsd/hostname_spec.rb
index cb71b230..9e5e5a4c 100644
--- a/spec/unit/plugins/freebsd/hostname_spec.rb
+++ b/spec/unit/plugins/freebsd/hostname_spec.rb
@@ -6,9 +6,9 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,9 +25,12 @@ describe Ohai::System, "FreeBSD hostname plugin" do
@plugin.stub(:collect_os).and_return(:freebsd)
@plugin.stub(:shell_out).with("hostname -s").and_return(mock_shell_out(0, "katie", ""))
@plugin.stub(:shell_out).with("hostname -f").and_return(mock_shell_out(0, "katie.bethell", ""))
+ @plugin.stub(:shell_out).with("hostname").and_return(mock_shell_out(0, "katie.local", ""))
end
it_should_check_from("freebsd::hostname", "hostname", "hostname -s", "katie")
-
+
it_should_check_from("freebsd::hostname", "fqdn", "hostname -f", "katie.bethell")
+
+ it_should_check_from("freebsd::hostname", "machinename", "hostname", "katie.local")
end