Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.18 KB | None | 0 0
  1. Begin tests/external_facts/structured_executable_facts.rb
  2.  
  3. executable external facts can return structured data
  4.  
  5. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:52$ facter kernelmajversion
  6. 3.10
  7.  
  8. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.08 seconds
  9.  
  10. * Agent j9u4iawal8vmjbv.delivery.puppetlabs.net: setup default external facts directory (facts.d)
  11.  
  12. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:52$ mkdir -p '/opt/puppetlabs/facter/facts.d'
  13.  
  14. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.03 seconds
  15.  
  16. * Agent j9u4iawal8vmjbv.delivery.puppetlabs.net: create an executable yaml fact in default facts.d
  17. localhost $ scp /var/folders/3r/k7hzxdmn0ps9bdqd623lpcmh0000gq/T/beaker20161020-62731-1yvn2yr centos7-64-1:/opt/puppetlabs/facter/facts.d/yaml_fact.sh {:ignore => }
  18.  
  19. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:52$ chmod +x '/opt/puppetlabs/facter/facts.d/yaml_fact.sh'
  20.  
  21. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.02 seconds
  22.  
  23. * YAML output should produce a structured fact
  24.  
  25. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:52$ facter yaml_fact
  26. [
  27. "one",
  28. "two",
  29. "three"
  30. ]
  31.  
  32. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.07 seconds
  33.  
  34. * Agent j9u4iawal8vmjbv.delivery.puppetlabs.net: create an executable json fact in default facts.d
  35. localhost $ scp /var/folders/3r/k7hzxdmn0ps9bdqd623lpcmh0000gq/T/beaker20161020-62731-4w4fyh centos7-64-1:/opt/puppetlabs/facter/facts.d/json_fact.sh {:ignore => }
  36.  
  37. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:53$ chmod +x '/opt/puppetlabs/facter/facts.d/json_fact.sh'
  38.  
  39. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.06 seconds
  40.  
  41. * JSON output should produce a structured fact
  42.  
  43. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:53$ facter json_fact
  44. {
  45. element => 1
  46. }
  47.  
  48. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.07 seconds
  49.  
  50. * Agent j9u4iawal8vmjbv.delivery.puppetlabs.net: create an executable key-value fact in default facts.d
  51. localhost $ scp /var/folders/3r/k7hzxdmn0ps9bdqd623lpcmh0000gq/T/beaker20161020-62731-1tgcs0d centos7-64-1:/opt/puppetlabs/facter/facts.d/kv_fact.sh {:ignore => }
  52.  
  53. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:53$ chmod +x '/opt/puppetlabs/facter/facts.d/kv_fact.sh'
  54.  
  55. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.02 seconds
  56.  
  57. * output that is neither yaml nor json should not produce a structured fact
  58.  
  59. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:53$ facter kv_fact
  60. one
  61.  
  62. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.07 seconds
  63. Begin teardown
  64.  
  65. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) 09:21:53$ rm -rf '/opt/puppetlabs/facter/facts.d'
  66.  
  67. j9u4iawal8vmjbv.delivery.puppetlabs.net (centos7-64-1) executed in 0.02 seconds
  68. End teardown
  69. tests/external_facts/structured_executable_facts.rb passed in 0.70 seconds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement