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

View File

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

View File

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

View File

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

View File

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