Created
October 20, 2016 16:44
-
-
Save Magisus/0d19ccae4c9f7ce6f9e3afa823af5e86 to your computer and use it in GitHub Desktop.
Structured executable fact tests, Centos 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Begin tests/external_facts/structured_executable_facts.rb | |
executable external facts can return structured data | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:52$ facter kernelmajversion | |
3.10 | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.08 seconds | |
* Agent j9u4iawal8vmjbv.delivery.puppetlabs.net: setup default external facts directory (facts.d) | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:52$ mkdir -p '/opt/puppetlabs/facter/facts.d' | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.03 seconds | |
* Agent j9u4iawal8vmjbv.delivery.puppetlabs.net: create an executable yaml fact in default facts.d | |
localhost $ scp /var/folders/3r/k7hzxdmn0ps9bdqd623lpcmh0000gq/T/beaker20161020-62731-1yvn2yr centos7-64-1:/opt/puppetlabs/facter/facts.d/yaml_fact.sh {:ignore => } | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:52$ chmod +x '/opt/puppetlabs/facter/facts.d/yaml_fact.sh' | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.02 seconds | |
* YAML output should produce a structured fact | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:52$ facter yaml_fact | |
[ | |
"one", | |
"two", | |
"three" | |
] | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.07 seconds | |
* Agent j9u4iawal8vmjbv.delivery.puppetlabs.net: create an executable json fact in default facts.d | |
localhost $ scp /var/folders/3r/k7hzxdmn0ps9bdqd623lpcmh0000gq/T/beaker20161020-62731-4w4fyh centos7-64-1:/opt/puppetlabs/facter/facts.d/json_fact.sh {:ignore => } | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:53$ chmod +x '/opt/puppetlabs/facter/facts.d/json_fact.sh' | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.06 seconds | |
* JSON output should produce a structured fact | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:53$ facter json_fact | |
{ | |
element => 1 | |
} | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.07 seconds | |
* Agent j9u4iawal8vmjbv.delivery.puppetlabs.net: create an executable key-value fact in default facts.d | |
localhost $ scp /var/folders/3r/k7hzxdmn0ps9bdqd623lpcmh0000gq/T/beaker20161020-62731-1tgcs0d centos7-64-1:/opt/puppetlabs/facter/facts.d/kv_fact.sh {:ignore => } | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:53$ chmod +x '/opt/puppetlabs/facter/facts.d/kv_fact.sh' | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.02 seconds | |
* output that is neither yaml nor json should not produce a structured fact | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:53$ facter kv_fact | |
one | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.07 seconds | |
Begin teardown | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:53$ rm -rf '/opt/puppetlabs/facter/facts.d' | |
j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.02 seconds | |
End teardown | |
tests/external_facts/structured_executable_facts.rb passed in 0.70 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment