A | |
att_list_def, Test_Xml.Xml | |
attributes, Test_Xml.Xml | |
C | |
cdata, Test_Xml.Xml | |
comment, Test_Xml.Xml | |
content, Test_Xml.Xml | |
D | |
decl_def_item, Test_Xml.Xml | |
disk_config, Test_FAI_DiskConfig. | |
doc, Test_Xml.Xml | |
doctype, Test_Xml.Xml | |
E | |
empty_element, Test_Xml.Xml | |
entry, Test_Reprepro_Uploaders. | |
L | |
lns | |
N | |
notation_def, Test_Xml.Xml | |
P | |
prolog, Test_Xml.Xml | |
V | |
volume, Test_FAI_DiskConfig. |
test Xml.att_list_def get att_def1 = { "!ATTLIST" = "termdef" { "1" { "#name" = "id" } { "#type" = "ID" } { "#REQUIRED" } } { "2" { "#name" = "name" } { "#type" = "CDATA" } { "#IMPLIED" } } }
test Xml.attributes get attr1 = { "#attribute" { "attr1" = "value1" } { "attr2" = "value2" } }
test Xml.cdata get cdata1 = { "#CDATA" = "testing" }
Comments get mapped into “#comment” nodes.
test Xml.comment get "<!-- declarations for <head> & <body> -->" = { "#comment" = " declarations for <head> & <body> " }
test Xml.content put "<a><b/></a>" after clear "/a/b" = "<a><b></b>\n</a>"
!ELEMENT declaration tags are mapped in “!ELEMENT” nodes.
test Xml.decl_def_item get "<!ELEMENT greeting (#PCDATA)>" = { "!ELEMENT" = "greeting" { "#decl" = "(#PCDATA)" } }
Test FAI_DiskConfig.disk_config
test FAI_DiskConfig.disk_config get "disk_config hda preserve_always:6,7 disklabel:msdos bootable:3\n" = { "disk_config" = "hda" { "preserve_always" { "1" = "6" } { "2" = "7" } } { "disklabel" = "msdos" } { "bootable" = "3" } }
Test input1 with Xml.doc
test Xml.doc get input1 = { "#declaration" { "#attribute" { "version" = "1.0" } { "encoding" = "UTF-8" } } } { "html" { "#text" = "\n " } { "head" { "#text" = "\n " } { "title" { "#text" = "Wiki" } } { "#text" = " " } } { "#text" = " " } { "body" { "#text" = " " } { "h1" { "#text" = "Augeas" } } { "#text" = " " } { "p" { "#attribute" { "class" = "main" } } { "#text" = "Augeas is now able to parse XML files!" } } { "#text" = " " } { "ul" { "#text" = "\n " } { "li" { "#text" = "Translate from XML to a tree syntax" } } { "#text" = " " } { "li" { "#text" = "Translate from the tree back to XML" } } { "#text" = " " } { "#comment" = " this is some comment " } { "#text" = " " } { "li" { "#text" = "this" } } { "#text" = " " } } { "#text" = " " } } }
!DOCTYPE tags are mapped in “!DOCTYPE” nodes.
test Xml.doctype get "<!DOCTYPE greeting SYSTEM \"hello.dtd\">" = { "!DOCTYPE" = "greeting" { "SYSTEM" = "hello.dtd" } }
test Xml.empty_element get empty1 = { "a" = "#empty" }
A star condition gets mapped as direct value of the “allow” node.
test Reprepro_Uploaders.entry get "allow * by anybody\n" = { "allow" = "*" { "by" = "anybody" } }
Test the full conf
test Access.lns get conf = { "access" = "+" { "user" = "ALL" } { "origin" = "LOCAL" } } { "access" = "+" { "user" = "root" } { "origin" = "localhost.localdomain" } } { "access" = "-" { "user" = "root" } { "origin" = "127.0.0.1" } { "origin" = ".localdomain" } } { "access" = "+" { "user" = "root" } { "user" = "alice" { "host" = "server1" } } { "netgroup" = "admins" } { "group" = "wheel" } { "origin" = "cron" } { "origin" = "crond" } { "origin" = ":0" } { "origin" = "tty1" } { "origin" = "tty2" } { "origin" = "tty3" } { "origin" = "tty4" } { "origin" = "tty5" } { "origin" = "tty6" } } { "#comment" = "IP v6 support" } { "access" = "+" { "user" = "john" } { "user" = "foo" } { "origin" = "2001:4ca0:0:101::1" } { "origin" = "2001:4ca0:0:101::/64" } } { "#comment" = "Except" } { "access" = "+" { "user" = "ALL" } { "except" { "user" = "john" } { "netgroup" = "wheel" } } { "origin" = "ALL" } { "except" { "origin" = "LOCAL" } { "origin" = ".win.tue.nl" } } } { "#comment" = "No spaces" } { "access" = "+" { "user" = "root" } { "origin" = ".example.com" } }
Testing Aliases.lns on file
test Aliases.lns get file = { } { "#comment" = "Aliases in this file will NOT be expanded in the header from" } { "#comment" = "Mail, but WILL be visible over networks or from /bin/mail." } {} { "#comment" = "Basic system aliases -- these MUST be present." } { "1" { "name" = "mailer-daemon" } { "value" = "postmaster" } } { "2" { "name" = "postmaster" } { "value" = "root" } } {} { "#comment" = "General redirections for pseudo accounts." } { "3" { "name" = "bin" } { "value" = "root" } { "value" = "adm" } { "value" = "bob" } } { "4" { "name" = "daemon" } { "value" = "root" } } { "5" { "name" = "adm" } { "value" = "root" } } { "6" { "name" = "file" } { "value" = "/var/foo" } } { "7" { "name" = "pipe1" } { "value" = "|/bin/ls" } } { "8" { "name" = "pipe2" } { "value" = "|\"/usr/bin/ls args,\"" } }
Testing Approx.lns on default_approx
test Approx.lns get default_approx = { "#comment" = "The following are the defaults, so there is no need" } { "#comment" = "to uncomment them unless you want a different value." } { "#comment" = "See approx.conf(5) for details." } { } { "$interface" = "any" } { "$port" = "9999" } { "$interval" = "720" } { "$max_wait" = "10" } { "$max_rate" = "unlimited" } { "$debug" = "false" } { } { "#comment" = "Here are some examples of remote repository mappings." } { "#comment" = "See http://www.debian.org/mirror/list for mirror sites." } { } { "debian" = "http://ftp.nl.debian.org/debian" } { "debian-volatile" = "http://ftp.nl.debian.org/debian-volatile" } { "security" = "http://security.debian.org" }
Testing the full FAI_DiskConfig.lns on simple_config
test FAI_DiskConfig.lns get simple_config = { "#comment" = "A comment" } { "disk_config" = "disk2" { "raw-disk" { "mountpoint" = "-" } { "size" = "0" } { "filesystem" = "-" } { "mount_options" { "1" = "-" } } } } { } { "disk_config" = "lvm" { "vg" { "name" = "my_pv" } { "disk" = "sda2" } } { "vg" { "name" = "test" } { "disk" = "disk1" { "partition" = "9" } } } { "lv" { "vg" = "my_pv" } { "name" = "_swap" } { "mountpoint" = "swap" } { "size" = "2048" } { "filesystem" = "swap" } { "mount_options" { "1" = "sw" } } } { "lv" { "vg" = "my_pv" } { "name" = "_root" } { "mountpoint" = "/" } { "size" = "2048" } { "filesystem" = "ext3" } { "mount_options" { "1" = "rw" } { "2" = "errors" { "value" = "remount-ro" } } } } } { } { "disk_config" = "raid" { "raid1" { "mountpoint" = "/boot" } { "disk" = "disk1" { "partition" = "1" } } { "disk" = "disk2" { "partition" = "1" } } { "disk" = "disk3" { "partition" = "1" } } { "disk" = "disk4" { "partition" = "1" } } { "disk" = "disk5" { "partition" = "1" } } { "disk" = "disk6" { "partition" = "1" } } { "filesystem" = "ext3" } { "mount_options" { "1" = "rw" } } } { "raid1" { "mountpoint" = "swap" } { "disk" = "disk1" { "partition" = "2" } } { "disk" = "disk2" { "partition" = "2" } } { "disk" = "disk3" { "partition" = "2" } } { "disk" = "disk4" { "partition" = "2" } } { "disk" = "disk5" { "partition" = "2" } } { "disk" = "disk6" { "partition" = "2" } } { "filesystem" = "swap" } { "mount_options" { "1" = "sw" } } } { "raid5" { "mountpoint" = "/srv/data" } { "disk" = "disk1" { "partition" = "11" } } { "disk" = "disk2" { "partition" = "11" } } { "disk" = "disk3" { "partition" = "11" } } { "disk" = "disk4" { "partition" = "11" } } { "disk" = "disk5" { "partition" = "11" } } { "disk" = "disk6" { "partition" = "11" } } { "filesystem" = "ext3" } { "mount_options" { "1" = "ro" } } { "fs_options" { "createopts" = "-m 0" } } } { "raid0" { "mountpoint" = "-" } { "disk" = "disk2" { "partition" = "2" } } { "disk" = "sdc1" } { "disk" = "sde1" { "spare" } { "missing" } } { "filesystem" = "ext2" } { "mount_options" { "1" = "default" } } } } { } { "disk_config" = "tmpfs" { "tmpfs" { "mountpoint" = "/var/opt/hosting/tmp" } { "size" = "500" } { "mount_options" { "1" = "defaults" } } } }
Test the full conf
test Keepalived.lns get conf = { "#comment" = "This is a comment" } { "#comment" = "Configuration File for keepalived" } {} { "global_defs" { } { "#comment" = "this is who emails will go to on alerts" } { "notification_email" { } { "email" = "admins@example.com" } { "email" = "fakepager@example.com" } { "#comment" = "add a few more email addresses here if you would like" } } { "notification_email_from" = "admins@example.com" } { } { "smtp_server" = "127.0.0.1" { "#comment" = "I use the local machine to relay mail" } } { "smtp_connect_timeout" = "30" } {} { "#comment" = "each load balancer should have a different ID" } { "#comment" = "this will be used in SMTP alerts, so you should make" } { "#comment" = "each router easily identifiable" } { "lvs_id" = "LVS_EXAMPLE_01" } } {} { "vrrp_sync_group" = "VG1" { } { "group" { } { "inside_network" { "#comment" = "name of vrrp_instance (below)" } } { "outside_network" { "#comment" = "One for each moveable IP." } } } } {}
Testing the full conf against Reprepro_Uploaders.lns
test Reprepro_Uploaders.lns get conf = { "#comment" = "ftpmaster" } { "allow" = "*" { "by" = "key" { "key" = "74BF771E" } } } { } { "allow" { "and" { "or" = "sections" { "or" = "desktop/*" } } } { "by" = "anybody" } } { "allow" { "and" { "or" = "sections" { "or" = "gforge/*" } } } { "and" { "or" = "binaries" { "contain" } { "or" = "bzr" } } { "or" = "source" { "not" } { "or" = "*melanie*" } { "or" = "katya" } } } { "by" = "key" { "key" = "any" } } }
test Xml.lns put "<a></a >" after set "/a/#text[1]" "foo"; set "/a/#text[2]" "bar" = "<a>foobar</a >"
test Xml.notation_def get "<!NOTATION not3 SYSTEM \"\">" = { "!NOTATION" = "not3" { "SYSTEM" = "" } }
The XML prolog tag is mapped in a “#declaration” node, which contains an “#attribute” node with various attributes of the tag.
test Xml.prolog get "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" = { "#declaration" { "#attribute" { "version" = "1.0" } { "encoding" = "UTF-8" } } }
Test FAI_DiskConfig.volume
test FAI_DiskConfig.volume get "primary /boot 20-100 ext3 rw\n" = { "primary" { "mountpoint" = "/boot" } { "size" = "20-100" } { "filesystem" = "ext3" } { "mount_options" { "1" = "rw" } } }