Update test policy files in src/parser/testfiles to (largely) match current policy language

This commit is contained in:
Brian Cox 2017-03-17 23:37:05 -07:00
parent 6ea9c0b92e
commit 2c57dd824a
5 changed files with 92 additions and 94 deletions

View File

@ -2,16 +2,16 @@
# parser will echo YES1 through YES9
# there's a problem with the parser if it echoes NO
@@ifhost turd
@@ifhost foo
@@error NO1
@@else
@@echo +YES1;
@@endif
@@ifhost crap || your_host||poo
@@ifhost bar || your_host||baz
@@ifhost turd
@@ifhost foo
@@ifhost your_host
@@error +NO2;
@ -23,7 +23,7 @@
@@else
@@ifhost turd
@@ifhost foo
@@error +NO5;
@@else
@@echo +YES2;
@ -63,29 +63,29 @@
@@error +NO10;
@@endif
@@ifhost turd
@@ifhost foo
@@error +NO11;
@@else
@@echo +YES7;
@@endif
@@ifhost your_host || poo
@@ifhost your_host || baz
@@echo +YES8;
@@endif
@@ifhost poo || your_host
@@ifhost baz || your_host
@@echo +YES9;
@@endif
@@ifhost poo
@@ifhost baz
@@error +NO12;
@@endif
@@else
@@ifhost turd
@@ifhost foo
@@ifhost your_host
@@error +NO13;
@ -97,7 +97,7 @@
@@else
@@ifhost turd
@@ifhost foo
@@error +NO16;
@@else
@@error +NO17;
@ -107,7 +107,7 @@
@@endif
@@ifhost turd
@@ifhost foo
@@error +NO19;
@@else
@@error +NO20;
@ -120,13 +120,13 @@
@@endif
@@ifhost turd
@@ifhost foo
@@error +NO23;
@@else
@@error +NO24;
@@endif
@@ifhost poo
@@ifhost baz
@@error +NO25;
@@endif

View File

@ -14,34 +14,32 @@
/simple -> +ppp;
# variable
$(poo) = pinug;
/simplevar -> $(poo) ;
FOO = pinug;
/simplevar -> $(FOO) ;
$(turd) = /test6;
$(turd) -> $(poo);
BAR = /test6;
$(BAR) -> $(FOO);
# named attributes
/namedattr -> +pinug (name /namedattr ) ;
#/namedattr -> +pinug (name /namedattr ) ;
# multiple attributes
/namedattr2 -> +pinug (emailreport on, emailsendto genek, name /namedattr2, name4 val4, name5 val5 );
#/namedattr2 -> +pinug (emailreport on, emailsendto genek, name /namedattr2, name4 val4, name5 val5 );
# test line continuations
/turd \
/bar \
->\
+p
;
@@EnD
#@@EnD
/test -> +p;
"/te\x73t2" -> +p-p ;
"/te\163t3" -> +pinugs-am ;
"c:\\te\163t3\\" -> +pinugs-am ;
"c:\\te\"as\163t3\\" -> +pinugs-am ;
"/te\163t3" -> +pinugs-am ;
"/te\163t3" -> +pinugs-am ;
/test4 -> +pinugs---am ;
/test5 -> $(ReadOnly)s-+-am ;
/test7 -> +p;
"/te\x73t8" -> +p-p ;
"/te\163t9" -> +pinugs-am ;
"/te\163t12" -> +pinugs-am ;
"/te\163t13" -> +pinugs-am ;
/test14 -> +pinugs---am ;
/test15 -> $(ReadOnly)s-+-am ;
# test weird file names
/lost+found -> +p ;
@ -51,50 +49,51 @@ $(turd) -> $(poo);
;
# simple default policy
/simple -> +ppp;
/simple2 -> +ppp;
# variable
$(poo) = pinug;
/simplevar -> $(poo) ;
$(turd) = /test6;
$(turd) -> $(poo);
FOO = pinug;
/simplevar2 -> $(FOO) ;
BAR = /test16;
$(BAR) -> $(FOO);
# omit with space seperation
! /omit ;
# omit with no space separation
!/omit ;
!/omit2 ;
# named attributes
/namedattr -> +pinug (name1 value1) ;
#/namedattr -> +pinug (name1 value1) ;
# multiple attributes
/namedattr2 -> +pinug (emailreport on; emailsendto genek; name3 val3; name4 val4; name5 val5 ) ;
#/namedattr2 -> +pinug (emailreport on; emailsendto genek; name3 val3; name4 val4; name5 val5 ) ;
# test line continuations
/turd \
/bar2 \
->\
+p
;
@@END
#@@END
# the following isn't implemented yet
#########################################3
# attributes on specifers
/conditions {
xxx: +pinug (inside1 name1 ;) ;
yyy: +pinug ;
zzz: +pinug ;
default: +pinug ;
};
#/conditions2 {
# xxx: +pinug (inside1 name1 ;) ;
# yyy: +pinug ;
# zzz: +pinug ;
# default: +pinug ;
# };
# multiple specmasks
/conditions {
xxx: +pinug ;
yyy: +pinug ;
zzz: +pinug ;
default: +pinug ;
};
#/conditions3 {
# xxx: +pinug ;
# yyy: +pinug ;
# zzz: +pinug ;
# default: +pinug ;
# };
#

View File

@ -1 +1 @@
/etc jj ;
/etc -> $(IgnoreNone);

View File

@ -1,17 +1,16 @@
# test weird file names
/lost+found -> +p ;
/l-o_st+fo/und -> +ping (l-o_st+fo/und2 l-o_st+fo/und3) ;
/l-o_st+fo/und -> +ping;
# test variables
$(ReadOnly) = ping;
/simplevar -> $(ReadOnly) ;
/var -> $(ReadOnly)-p ;
FOO = ping;
/simplevar -> $(FOO) ;
/var -> $(FOO)-p ;
# test line continuations
c:/test -> +p ;
/turd \
/bar \
->\
+p
;
@ -19,26 +18,25 @@ c:/test -> +p ;
# test quoted strings
"/qfoo" -> +p ;
"/Program Files" -> +p ;
" /lots o' spaces " -> +p ;
" colon: semicolon; quote' " -> +p ;
#" /lots o' spaces " -> +p ;
#" colon: semicolon; quote' " -> +p ;
# test attributes
/namedattr2 -> +p ( name1 value1; name2 value2; ) ;
/namedattr -> +p (name1 value1; ) ;
#/namedattr2 -> +p ( name1 value1; name2 value2; ) ;
#/namedattr -> +p (name1 value1; ) ;
# test propvector
c:/test -> +p ;
/test -> +p ;
/test -> +p-p ;
/test -> +pinugs-am ;
/test -> +pinugs---am ;
/test -> +pinugs-+-am ;
/test1 -> +p ;
/test2 -> +p-p ;
/test3 -> +pinugs-am ;
/test4 -> +pinugs---am ;
/test5 -> +pinugs-+-am ;
# attributes and props
/namedattr3 -> +pinug ( name1 value1; name2 value2; ) ;
/namedattr4 -> +pinug (name1 value1; ) ;
#/namedattr3 -> +pinug ( name1 value1; name2 value2; ) ;
#/namedattr4 -> +pinug (name1 value1; ) ;
# simple default policy
/simple -> +ppp;
@ -48,38 +46,39 @@ c:/test -> +p ;
! /omit ;
# omit with no space separation
!/omit ;
!/omit2 ;
# multiple attributes
/namedattr -> +pinug (emailreport on; emailsendto genek; name3 val3; name4 val4; name5 val5; ) ;
#/namedattr -> +pinug (emailreport on; emailsendto genek; name3 val3; name4 val4; name5 val5; ) ;
@@END
#@@END
# the following isn't implemented yet
#########################################3
# multiple specmasks
/conditions -> {
xxx -> +pinug ;
yyy -> +pinug ;
zzz -> +pinug ;
default -> +pinug ;
};
#/conditions -> {
# xxx -> +pinug ;
# yyy -> +pinug ;
# zzz -> +pinug ;
# default -> +pinug ;
# };
# attributes on specifers
/conditions -> {
xxx -> +pinug (inside1 name1 ;) ;
yyy -> +pinug ;
zzz -> +pinug ;
default -> +pinug ;
};
#/conditions -> {
# xxx -> +pinug (inside1 name1 ;) ;
# yyy -> +pinug ;
# zzz -> +pinug ;
# default -> +pinug ;
# };
# hard ones
/conditions -> {
xxx -> +pinug (inside1 name1 ;) ;
yyy -> $(poo)+pinug ;
zzz -> +pinug ( inside1 name1 ; outside name2);
default -> $(turd)-p ;
};
#/conditions -> {
# xxx -> +pinug (inside1 name1 ;) ;
# yyy -> $(baz)+pinug ;
# zzz -> +pinug ( inside1 name1 ; outside name2);
# default -> $(bar)-p ;
# };

View File

@ -1,4 +1,4 @@
( emailreport on ; )
(emailto=root@localhost)
{
/foo -> +pinugs ;
}
}