[augeas-devel] augeas: master - Use absolute paths in lens tests when manipulating the tree

David Lutterkort lutter at fedoraproject.org
Sat Jan 31 00:57:38 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=e124fb0ce5c4fe49df0611e846ae526631d18a7e
Commit:        e124fb0ce5c4fe49df0611e846ae526631d18a7e
Parent:        f6f483a84bd1831cfa7b8d1c4d8904b449668b65
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Sat Jan 10 21:55:15 2009 -0800
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Fri Jan 30 16:54:44 2009 -0800

Use absolute paths in lens tests when manipulating the tree

Paths that start with a number (like '1/ipaddr') are ambiguous in the new
path expression grammar and will confuse the parser; to make it clear that
they are paths, and not just a number, use absolute paths.
---
 lenses/tests/test_aliases.aug   |   10 +++++-----
 lenses/tests/test_aptsource.aug |    2 +-
 lenses/tests/test_fstab.aug     |    2 +-
 lenses/tests/test_hosts.aug     |   10 +++++-----
 lenses/tests/test_inittab.aug   |    4 ++--
 lenses/tests/test_pam.aug       |    4 ++--
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/lenses/tests/test_aliases.aug b/lenses/tests/test_aliases.aug
index b74d01a..63b441b 100644
--- a/lenses/tests/test_aliases.aug
+++ b/lenses/tests/test_aliases.aug
@@ -29,9 +29,9 @@ adm:		root
           { "value" = "root" } }
 
   test Aliases.lns put file after
-      rm "4" ; rm "5" ;
-      set "1/value[2]" "barbar" ;
-      set "3/value[2]" "ruth"
+    rm "/4" ; rm "/5" ;
+      set "/1/value[2]" "barbar" ;
+      set "/3/value[2]" "ruth"
     = "#
 #  Aliases in this file will NOT be expanded in the header from
 #  Mail, but WILL be visible over networks or from /bin/mail.
@@ -46,8 +46,8 @@ bin:		root, ruth
 
   (* Schema violation, no 3/name *)
   test Aliases.lns put file after
-      rm "3" ;
-      set "3/values/2" "ruth"
+      rm "/3" ;
+      set "/3/value/2" "ruth"
     = *
 
   (* Don't have to have whitespace after a comma *)
diff --git a/lenses/tests/test_aptsource.aug b/lenses/tests/test_aptsource.aug
index e9275c8..e1ca9c0 100644
--- a/lenses/tests/test_aptsource.aug
+++ b/lenses/tests/test_aptsource.aug
@@ -60,7 +60,7 @@ deb-src http://mirror.bytemark.co.uk/debian etch main contrib non-free\n"
 
     (* Should be a noop; makes sure that we preserve the trailing comment *)
     test Aptsources.lns put trailing_comment after
-      set "1/type" "deb"
+      set "/1/type" "deb"
     = trailing_comment
 
 (* Local Variables: *)
diff --git a/lenses/tests/test_fstab.aug b/lenses/tests/test_fstab.aug
index 8981aa0..0688af6 100644
--- a/lenses/tests/test_fstab.aug
+++ b/lenses/tests/test_fstab.aug
@@ -53,7 +53,7 @@ module Test_fstab =
 
   test Fstab.lns get no_passno = no_passno_tree
 
-  test Fstab.lns put no_passno after set "1/passno" "1" = gen_no_passno " 1"
+  test Fstab.lns put no_passno after set "/1/passno" "1" = gen_no_passno " 1"
 
   test Fstab.lns get no_dump = no_dump_tree
 
diff --git a/lenses/tests/test_hosts.aug b/lenses/tests/test_hosts.aug
index f77bbde..c9b976b 100644
--- a/lenses/tests/test_hosts.aug
+++ b/lenses/tests/test_hosts.aug
@@ -23,13 +23,13 @@ module Test_hosts =
           { "alias" = "pigiron.example" }  }
 
   test Hosts.record put "127.0.0.1 foo\n" after
-      set "1/canonical" "bar"
+      set "/1/canonical" "bar"
   = "127.0.0.1 bar\n"
 
   test Hosts.lns put two_entries after
-    set "2/alias[10]" "piggy" ;
-    rm "1/alias[1]" ;
-    rm "2/alias[2]"
+    set "/2/alias[10]" "piggy" ;
+    rm "/1/alias[1]" ;
+    rm "/2/alias[2]"
   = "127.0.0.1 foo
   # \tcomment\t
 192.168.0.1 pigiron.example.com pigiron piggy
@@ -38,7 +38,7 @@ module Test_hosts =
   (* Deleting the 'canonical' node violates the schema; each host entry *)
   (* must have one                                                      *)
   test Hosts.lns put two_entries after
-      rm "1/canonical"
+      rm "/1/canonical"
     = *
 
   (* Make sure blank and indented lines get through *)
diff --git a/lenses/tests/test_inittab.aug b/lenses/tests/test_inittab.aug
index 40cd1cc..6ac4ce3 100644
--- a/lenses/tests/test_inittab.aug
+++ b/lenses/tests/test_inittab.aug
@@ -30,9 +30,9 @@ l0:0:wait:/etc/rc.d/rc 0
           { "action" = "wait" }
           { "process" = "/etc/rc.d/rc 0" } }
 
-  test Inittab.lns put simple after rm "1/process" = *
+  test Inittab.lns put simple after rm "/1/process" = *
 
-  test Inittab.lns put simple after set "1/runlevels" "3" =
+  test Inittab.lns put simple after set "/1/runlevels" "3" =
     "id:3:initdefault:\n"
 
 (* Local Variables: *)
diff --git a/lenses/tests/test_pam.aug b/lenses/tests/test_pam.aug
index 9553166..bef99f1 100644
--- a/lenses/tests/test_pam.aug
+++ b/lenses/tests/test_pam.aug
@@ -17,7 +17,7 @@ session    optional     pam_keyinit.so force revoke
           { "argument" = "revoke" } }
 
   test Pam.lns put example after
-    set "1/control" "requisite"
+    set "/1/control" "requisite"
   = "#%PAM-1.0
 auth requisite pam_securetty.so
 session    optional     pam_keyinit.so force revoke
@@ -27,7 +27,7 @@ session    optional     pam_keyinit.so force revoke
   let trailing_ws = "auth\trequired\tpam_unix.so \n"
 
   test Pam.lns put trailing_ws after
-    set "1/type" "auth"
+    set "/1/type" "auth"
   = trailing_ws
 
   test Pam.lns get "@include common-password\n" = 




More information about the augeas-devel mailing list