Server IP : 85.214.239.14 / Your IP : 18.117.94.180 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/root/proc/self/root/proc/2/cwd/usr/share/augeas/lenses/dist/tests/ |
Upload File : |
module Test_Trapperkeeper = (* Variable: config *) let config = " # This is a comment webserver: { bar: { # A comment host: localhost port= 9000 default-server: true } foo: { host: localhost port = 10000 } } jruby-puppet: { # This setting determines where JRuby will look for gems. It is also # used by the `puppetserver gem` command line tool. gem-home: /var/lib/puppet/jruby-gems # (optional) path to puppet conf dir; if not specified, will use the puppet default master-conf-dir: /etc/puppet # (optional) path to puppet var dir; if not specified, will use the puppet default master-var-dir: /var/lib/puppet # (optional) maximum number of JRuby instances to allow; defaults to <num-cpus>+2 #max-active-instances: 1 } # CA-related settings certificate-authority: { # settings for the certificate_status HTTP endpoint certificate-status: { # this setting contains a list of client certnames who are whitelisted to # have access to the certificate_status endpoint. Any requests made to # this endpoint that do not present a valid client cert mentioned in # this list will be denied access. client-whitelist: [] } } os-settings: { ruby-load-path: [/usr/lib/ruby/vendor_ruby, /home/foo/ruby ] } \n" (* Test: Trapperkeeper.lns Test full config file *) test Trapperkeeper.lns get config = { } { "#comment" = "This is a comment" } { "@hash" = "webserver" { "@hash" = "bar" { "#comment" = "A comment" } { "@simple" = "host" { "@value" = "localhost" } } { "@simple" = "port" { "@value" = "9000" } } { "@simple" = "default-server" { "@value" = "true" } } } { } { "@hash" = "foo" { "@simple" = "host" { "@value" = "localhost" } } { "@simple" = "port" { "@value" = "10000" } } } } { } { "@hash" = "jruby-puppet" { "#comment" = "This setting determines where JRuby will look for gems. It is also" } { "#comment" = "used by the `puppetserver gem` command line tool." } { "@simple" = "gem-home" { "@value" = "/var/lib/puppet/jruby-gems" } } { } { "#comment" = "(optional) path to puppet conf dir; if not specified, will use the puppet default" } { "@simple" = "master-conf-dir" { "@value" = "/etc/puppet" } } { } { "#comment" = "(optional) path to puppet var dir; if not specified, will use the puppet default" } { "@simple" = "master-var-dir" { "@value" = "/var/lib/puppet" } } { } { "#comment" = "(optional) maximum number of JRuby instances to allow; defaults to <num-cpus>+2" } { "#comment" = "max-active-instances: 1" } } { } { } { "#comment" = "CA-related settings" } { "@hash" = "certificate-authority" { "#comment" = "settings for the certificate_status HTTP endpoint" } { "@hash" = "certificate-status" { "#comment" = "this setting contains a list of client certnames who are whitelisted to" } { "#comment" = "have access to the certificate_status endpoint. Any requests made to" } { "#comment" = "this endpoint that do not present a valid client cert mentioned in" } { "#comment" = "this list will be denied access." } { "@array" = "client-whitelist" } } } { } { "@hash" = "os-settings" { "@array" = "ruby-load-path" { "1" = "/usr/lib/ruby/vendor_ruby" } { "2" = "/home/foo/ruby" } } } { } (* Test: Trapperkeeper.lns Should parse an empty file *) test Trapperkeeper.lns get "\n" = {} (* Test: Trapperkeeper.lns Values can be quoted *) test Trapperkeeper.lns get "os-settings: { ruby-load-paths: [\"/usr/lib/ruby/site_ruby/1.8\"] }\n" = { "@hash" = "os-settings" { "@array" = "ruby-load-paths" { "1" = "/usr/lib/ruby/site_ruby/1.8" } } } (* Test: Trapperkeeper.lns Keys can be quoted *) test Trapperkeeper.lns get "test: { \"x\": true }\n" = { "@hash" = "test" { "@simple" = "x" { "@value" = "true" } } } (* Test: Trapperkeeper.lns Keys can contain / (GH #7) *) test Trapperkeeper.lns get "test: { \"x/y\" : z }\n" = { "@hash" = "test" { "@simple" = "x/y" { "@value" = "z" } } }