[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[augeas-devel] augeas: master - Limits: map domain into the value of domain node (schema change)



Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=75e9de51882f2b3bf8a43e009fe67b83fd988075
Commit:        75e9de51882f2b3bf8a43e009fe67b83fd988075
Parent:        a6ce07faed1520cda95e7a09ea354431b278a185
Author:        Raphael Pinson <raphink gmail com>
AuthorDate:    Thu Mar 19 10:21:35 2009 -0700
Committer:     David Lutterkort <lutter redhat com>
CommitterDate: Thu Mar 19 10:40:27 2009 -0700

Limits: map domain into the value of domain node (schema change)

Mapping the domain as the label of a node leads to difficulties since '*'
is a valid domain name.

Problem reported by Mark Drayton (ticket #47)
---
 lenses/limits.aug            |    2 +-
 lenses/tests/test_limits.aug |   39 +++++++++++++++++++++++++--------------
 2 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/lenses/limits.aug b/lenses/limits.aug
index 5b2705c..2caab49 100644
--- a/lenses/limits.aug
+++ b/lenses/limits.aug
@@ -24,7 +24,7 @@ let sto_to_eol = store /([^ \t\n].*[^ \t\n]|[^ \t\n])/
  *                               ENTRIES
  *************************************************************************)
 
-let domain     = key /[% ]?[A-Za-z0-9_ -]+|\*/
+let domain     = label "domain" . store /[% ]?[A-Za-z0-9_ -]+|\*/
 
 let type_re    = "soft"
                | "hard"
diff --git a/lenses/tests/test_limits.aug b/lenses/tests/test_limits.aug
index d886c94..0d95ccd 100644
--- a/lenses/tests/test_limits.aug
+++ b/lenses/tests/test_limits.aug
@@ -1,20 +1,31 @@
 module Test_limits =
 
-let conf = "@audio - rtprio 99
+  let conf = "@audio - rtprio 99
 ftp hard nproc /ftp
 * soft core 0
 "
 
-test Limits.lns get conf =
-   { "@audio"
-     { "type"  = "-" }
-     { "item"  = "rtprio" }
-     { "value" = "99" } }
-   { "ftp"
-     { "type" = "hard" }
-     { "item" = "nproc" }
-     { "value" = "/ftp" } }
-   { "*"
-     { "type" = "soft" }
-     { "item" = "core" }
-     { "value" = "0" } }
+  test Limits.lns get conf =
+    { "domain" = "@audio"
+      { "type"  = "-" }
+      { "item"  = "rtprio" }
+      { "value" = "99" } }
+    { "domain" = "ftp"
+      { "type" = "hard" }
+      { "item" = "nproc" }
+      { "value" = "/ftp" } }
+    { "domain" = "*"
+      { "type" = "soft" }
+      { "item" = "core" }
+      { "value" = "0" } }
+
+  test Limits.lns put conf after
+    insa "domain" "domain[last()]" ;
+    set "domain[last()]" "*" ;
+    set "domain[last()]/type" "-" ;
+    set "domain[last()]/item" "nofile" ;
+    set "domain[last()]/value" "4096"
+  = "@audio - rtprio 99
+ftp hard nproc /ftp
+* soft core 0
+* - nofile 4096\n"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]