1 module Test_Trapperkeeper =
21 # This setting determines where JRuby will look for gems. It is also
22 # used by the `puppetserver gem` command line tool.
23 gem-home: /var/lib/puppet/jruby-gems
25 # (optional) path to puppet conf dir; if not specified, will use the puppet default
26 master-conf-dir: /etc/puppet
28 # (optional) path to puppet var dir; if not specified, will use the puppet default
29 master-var-dir: /var/lib/puppet
31 # (optional) maximum number of JRuby instances to allow; defaults to <num-cpus>+2
32 #max-active-instances: 1
37 certificate-authority: {
39 # settings for the certificate_status HTTP endpoint
42 # this setting contains a list of client certnames who are whitelisted to
43 # have access to the certificate_status endpoint. Any requests made to
44 # this endpoint that do not present a valid client cert mentioned in
45 # this list will be denied access.
51 ruby-load-path: [/usr/lib/ruby/vendor_ruby, /home/foo/ruby ]
55 (* Test: Trapperkeeper.lns
56 Test full config file *)
57 test Trapperkeeper.lns get config =
59 { "#comment" = "This is a comment" }
60 { "@hash" = "webserver"
62 { "#comment" = "A comment" }
63 { "@simple" = "host" { "@value" = "localhost" } }
64 { "@simple" = "port" { "@value" = "9000" } }
65 { "@simple" = "default-server" { "@value" = "true" } }
69 { "@simple" = "host" { "@value" = "localhost" } }
70 { "@simple" = "port" { "@value" = "10000" } }
74 { "@hash" = "jruby-puppet"
75 { "#comment" = "This setting determines where JRuby will look for gems. It is also" }
76 { "#comment" = "used by the `puppetserver gem` command line tool." }
77 { "@simple" = "gem-home" { "@value" = "/var/lib/puppet/jruby-gems" } }
79 { "#comment" = "(optional) path to puppet conf dir; if not specified, will use the puppet default" }
80 { "@simple" = "master-conf-dir" { "@value" = "/etc/puppet" } }
82 { "#comment" = "(optional) path to puppet var dir; if not specified, will use the puppet default" }
83 { "@simple" = "master-var-dir" { "@value" = "/var/lib/puppet" } }
85 { "#comment" = "(optional) maximum number of JRuby instances to allow; defaults to <num-cpus>+2" }
86 { "#comment" = "max-active-instances: 1" }
90 { "#comment" = "CA-related settings" }
91 { "@hash" = "certificate-authority"
92 { "#comment" = "settings for the certificate_status HTTP endpoint" }
93 { "@hash" = "certificate-status"
94 { "#comment" = "this setting contains a list of client certnames who are whitelisted to" }
95 { "#comment" = "have access to the certificate_status endpoint. Any requests made to" }
96 { "#comment" = "this endpoint that do not present a valid client cert mentioned in" }
97 { "#comment" = "this list will be denied access." }
98 { "@array" = "client-whitelist" }
102 { "@hash" = "os-settings"
103 { "@array" = "ruby-load-path"
104 { "1" = "/usr/lib/ruby/vendor_ruby" }
105 { "2" = "/home/foo/ruby" }
111 (* Test: Trapperkeeper.lns
112 Should parse an empty file *)
113 test Trapperkeeper.lns get "\n" = {}
115 (* Test: Trapperkeeper.lns
116 Values can be quoted *)
117 test Trapperkeeper.lns get "os-settings: {
118 ruby-load-paths: [\"/usr/lib/ruby/site_ruby/1.8\"]
120 { "@hash" = "os-settings"
121 { "@array" = "ruby-load-paths"
122 { "1" = "/usr/lib/ruby/site_ruby/1.8" }
126 (* Test: Trapperkeeper.lns
127 Keys can be quoted *)
128 test Trapperkeeper.lns get "test: {
132 { "@simple" = "x" { "@value" = "true" } } }
134 (* Test: Trapperkeeper.lns
135 Keys can contain / (GH #7)
137 test Trapperkeeper.lns get "test: {
141 { "@simple" = "x/y" { "@value" = "z" } } }