diff --git a/doc/naturaldocs/conf/lenses/Menu.txt b/doc/naturaldocs/conf/lenses/Menu.txt index 2e5f47d5b..3c1769b24 100644 --- a/doc/naturaldocs/conf/lenses/Menu.txt +++ b/doc/naturaldocs/conf/lenses/Menu.txt @@ -115,6 +115,7 @@ Group: Generic Modules { Group: Tests and Examples { + File: Test_Access (tests/test_access.aug) File: Test_Reprepro_Uploaders (tests/test_reprepro_uploaders.aug) File: Test_IniFile (tests/test_inifile.aug) } # Group: Tests and Examples diff --git a/lenses/access.aug b/lenses/access.aug index 5cb77fcb1..4ea5e0c7d 100644 --- a/lenses/access.aug +++ b/lenses/access.aug @@ -20,6 +20,9 @@ About: Lens Usage About: Configuration files This lens applies to /etc/security/access.conf. See . + +About: Examples + The file contains various examples and tests. *) module Access = autoload xfm @@ -27,8 +30,9 @@ module Access = (* Group: Comments and empty lines *) (* Variable: comment *) let comment = Util.comment -(* Variable: empty line *) +(* Variable: empty *) let empty = Util.empty + (* Group: Useful primitives *) (* Variable: colon * this is the standard field separator " : " @@ -116,4 +120,5 @@ let lns = (comment|empty|entry) * (* Variable: filter *) let filter = incl "/etc/security/access.conf" +(* xfm *) let xfm = transform lns filter diff --git a/lenses/tests/test_access.aug b/lenses/tests/test_access.aug index d89d61c74..fcb63dfea 100644 --- a/lenses/tests/test_access.aug +++ b/lenses/tests/test_access.aug @@ -1,5 +1,12 @@ +(* +Module: Test_Access + Provides unit tests and examples for the lens. +*) + module Test_access = +(* Variable: conf + A full configuration *) let conf = "+ : ALL : LOCAL + : root : localhost.localdomain - : root : 127.0.0.1 .localdomain @@ -12,6 +19,8 @@ let conf = "+ : ALL : LOCAL +:root:.example.com " +(* Test: Access.lns + Test the full *) test Access.lns get conf = { "access" = "+" { "user" = "ALL" } @@ -77,13 +86,20 @@ test Access.lns put conf after - : ALL : ALL " -(* Bug #190 *) +(* Test: Access.lns + - netgroups (starting with '@') are mapped as "netgroup" nodes; + - nisdomains (starting with '@@') are mapped as "nisdomain" nodes. + + This closes . + *) test Access.lns get "+ : @group@@domain : ALL \n" = { "access" = "+" { "netgroup" = "group" { "nisdomain" = "domain" } } { "origin" = "ALL" } } +(* Test Access.lns + Put test for netgroup and nisdomain *) test Access.lns put "+ : @group : ALL \n" after set "/access/netgroup[. = 'group']/nisdomain" "domain" = "+ : @group@@domain : ALL \n"