HEX
Server: Apache
System: Linux dinesh8189 5.15.98-grsec-sharedvalley-2.lc.el8.x86_64 #1 SMP Thu Mar 9 09:07:30 -03 2023 x86_64
User: cgmgerenciamento1 (814285)
PHP: 8.1.26
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //opt/puppetlabs/puppet/share/augeas/lenses/dist/tests/test_ethers.aug
(* Tests for the Ethers module *)

module Test_ethers =

(*
  let empty_entries = "# see man ethers for syntax\n"

  test Ethers.record get empty_entries =
    { "#comment" = "see man ethers for syntax" }
*)

  let three_entries = "54:52:00:01:00:01 192.168.1.1
# \tcomment\t
54:52:00:01:00:02 foo.example.com
00:16:3e:01:fe:03 bar
"

  test Ethers.lns get three_entries =
   { "1" { "mac" = "54:52:00:01:00:01" }
         { "ip" = "192.168.1.1" } }
   { "#comment" = "comment" }
   { "2" { "mac" = "54:52:00:01:00:02" }
         { "ip" = "foo.example.com" } }
   { "3" { "mac" = "00:16:3e:01:fe:03" }
         { "ip" = "bar" } }

  (* Deleting the 'ip' node violates the schema *)
  test Ethers.lns put three_entries after
      rm "/1/ip"
    = *

  test Ethers.lns put three_entries after
    set "/2/ip" "192.168.1.2" ;
    set "/3/ip" "baz"
  = "54:52:00:01:00:01 192.168.1.1
# \tcomment\t
54:52:00:01:00:02 192.168.1.2
00:16:3e:01:fe:03 baz
"

  test Ethers.lns put three_entries after
    rm "/3"
  = "54:52:00:01:00:01 192.168.1.1
# \tcomment\t
54:52:00:01:00:02 foo.example.com
"

  (* Make sure blank and indented lines get through *)
  test Ethers.lns get "54:52:00:01:00:01\tfoo  \n \n\n
54:52:00:01:00:02 bar\n" =
    { "1" { "mac" = "54:52:00:01:00:01" }
          { "ip" = "foo" } }
    {} {} {}
    { "2" { "mac" = "54:52:00:01:00:02" }
          { "ip" = "bar" } }

(* Local Variables: *)
(* mode: caml *)
(* End: *)