config root man

Current Path : /usr/share/fail2ban/testcases/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/share/fail2ban/testcases/clientreadertestcase.pyc

³ò
E²óSc
@sçdZdZdZddkZddkZddkZddkZddkZddkl	Z	ddk
lZddkl
Z
ddklZdd	klZd
eifd„ƒYZdefd
„ƒYZdefd„ƒYZdS(s!Cyril Jaquier, Yaroslav Halchenkos>Copyright (c) 2004 Cyril Jaquier, 2011-2013 Yaroslav HalchenkotGPLiÿÿÿÿN(tConfigReader(t
JailReader(tJailsReader(tConfigurator(tLogCaptureTestCasetConfigReaderTestcBsJeZd„Zd„Zd„Zd„Zdd„Zd„Zd„ZRS(cCs.tiddƒ|_td|iƒ|_dS(sCall before every test case.tprefixsf2b-temptbasedirN(ttempfiletmkdtemptdRtc(tself((s5/usr/share/fail2ban/testcases/clientreadertestcase.pytsetUp"scCsti|iƒdS(sCall after every test case.N(tshutiltrmtreeR(R
((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttearDown'scCstii|joRtii|ƒ}tii|i|ƒ}tii|ƒpti|ƒqentd|i|fdƒi	d|ƒdS(Ns%s/%stws
[section]
option = %s
(
tostpathtseptdirnametjoinRtexiststmakedirstopentwrite(R
tfnametvalueRtd_((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyt_write+scCs7tid|i|fƒ|i|iidƒƒdS(Ns%s/%sR(RtunlinkRt
assertTrueRtread(R
R((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyt_remove7sRcCs3|i|ii|ƒƒ|iiddgƒdS(Ntsectiontinttoption(sintsoption(R!RR"t
getOptions(R
tf((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyt
_getoption<scCsˆtii|idƒ}|iddƒ|i|idƒdƒti|dƒti|ti	ƒp|i
|iidƒƒndS(Nsd.confiR(
RRRRRtassertEqualR)tchmodtaccesstR_OKtassertFalseRR"(R
R(((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestInaccessibleFileAscCsó|i|iidƒƒ|iddƒ|i|iƒdƒ|iddƒ|i|iƒdƒ|iddƒ|i|iƒd	ƒ|id
dƒ|i|iƒd	ƒ|idd
ƒ|i|iƒdƒ|idƒ|i|iƒd	ƒ|idƒ|i|iƒdƒ|id
ƒ|i|iƒdƒ|iddƒ|i|iƒdƒ|iddƒ|i|iƒdƒ|idƒ|i|iƒdƒ|iddƒ|idƒ|idƒ|i|iƒdƒdS(NRsc.conft1it2isc.d/98.conft998iæsc.d/90.conft990sc.d/99.conft999içiÞsc.localt3isc.d/5.localt9i	(R.RR"RR*R)R#(R
((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestOptionalDotDDirPs6





(	t__name__t
__module__RRRR#R)R/R7(((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyR s					tJailReaderTestcBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsŠtddtiiddƒƒ}|i|iƒƒ|i|iƒƒ|i|iƒƒ|i|idƒƒ|i|idƒƒdS(NtemptyactionRt	testcasestconfigs"No filter set for jail emptyactions'No actions were defined for emptyaction(	RRRRR!R"R't	isEnabledt
_is_logged(R
tjail((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestJailActionEmptyps!cCsŠtddtiiddƒƒ}|i|iƒƒ|i|iƒƒ|i|iƒƒ|i|i	dƒƒ|i|i	dƒƒdS(NtmissingbitsjailRR<R=sXFound no accessible config files for 'filter.d/catchallthebadies' under testcases/configsUnable to read the filter(
RRRRR!R"R.R'R>R?(R
R@((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestJailActionFilterMissingxs!cCsŠtddtiiddƒƒ}|i|iƒƒ|i|iƒƒ|i|iƒƒ|i|i	dƒƒ|i|i	dƒƒdS(NtbrokenactiondefRR<R=s#Error in action definition joho[foosXCaught exception: While reading action joho[foo we should have got 1 or 2 groups. Got: 0(
RRRRR!R"R.R'R>R?(R
R@((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestJailActionBrokenDef€s!cCsˆtdddƒ}|i|iƒƒ|i|iƒƒ|i|iƒƒ|i|iƒdƒ|idƒ|i|iƒdƒdS(Nsssh-iptablesRR=sssh-funky-blocker(	RR!R"R'R.R>R*tgetNametsetName(R
R@((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestStockSSHJailˆs
cCs d}dhdd<g}ti|ƒ}|i||ƒ|idhgtidƒƒ|idhdd<dd	<gtid
ƒƒ|idhgtidƒƒ|idhgtidƒƒ|i|id
ƒƒ|idhdd<gtidƒƒ|ittidƒdS(Nsmail-whois[name=SSH]s
mail-whoistSSHtnamesmail.who_istcattatdogtbsmail.who_is[a=cat,b=dog]smail--ho_issmail--ho_is['s']sInvalid argument ['s'] in ''s''tmailt,smail[a=',']s	mail-how[(RtsplitActionR*R!R?tassertRaisest
ValueError(R
tactiontexpectedtresult((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestSplitAction‘s1(cCstiddƒ}tii|dƒ}t|dƒiƒtii|dƒ}tid|ƒ|it	i
tii|dƒƒ|gƒ|it	i
|ƒgƒ|i|id|ƒƒ|it	i
tii|dƒƒgƒti
|ƒti
|ƒti|ƒdS(	NRsf2b-temptf1Rtf2tnonexistingt*s4File %s is a dangling link, thus cannot be monitored(R	R
RRRRtclosetsymlinkR*Rt_globR!R?tremovetrmdir(R
RRXRY((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestGlob£s+(

(R8R9RARCRERHRWRa(((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyR:ns						tJailsReaderTestcBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs=tiidƒp&tddƒ}|it|iƒndS(Ns/XXXR(RRRRRRRSR"(R
treader((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestProvidingBadBasedirºsc,Csøtdtiiddƒƒ}|i|iƒƒ|i|iƒƒ|it	|i
ƒ|i
dtƒ}d|_
|it|ƒtdddgddd	d
gddddgddd
dgddddgdddgddd	d
gddddgddddgddd
dgddddgdddgddd	d
gddddgddd
dgddddgddddgdddgddd	d
gddddgddd
dgddddgddddgddddgdddddgdddddgdddddgdddddgdddddgdddgddd	d
gddddgddd
dgddddgddddgddgddgddgddgddgg(ƒƒ|i|idƒƒ|i|id ƒƒdS(!NRR<R=tallow_no_filestaddR;tautotsettusednstwarntmaxretryitfindtimeiXtbantimetspecialtaddfailregexs<IP>tmissinglogfilestbrokenactiont	addactiont	actionbanshit with big stick <ip>t
actionstopttactionstarttactionunbantactionchecksparse_to_end_of_jail.conftstarts-Errors in jail 'missingbitsjail'. Skipping...s6No file(s) found for glob /weapons/of/mass/destruction(RRRRR!R"R.R'RRRStconverttTruetNonetmaxDiffR*tsortedR?(R
tjailst
comm_commands((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestReadTestJailConf¿sj					cCs§tddƒ}|i|iƒƒ|i|iƒƒ|iƒ}d|_|i|gƒ|}|i|idƒƒ|i|i	dƒƒ|i|iƒ|ƒdS(NRR=tBOGUSsNo section: 'BOGUS'(
RR!R"R'RzR|R}R*R.R?(R
RR€told_comm_commands((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestReadStockJailConf÷s	cCsátdddtƒ}|i|iƒƒ|i|iƒƒtd„titii	dddƒƒDƒƒ}td„|i
ƒDƒƒ}d|_|i|i
|ƒd|i|ƒƒ|i|i
|ƒd	|i|ƒƒdS(
NRR=tforce_enablecssMxF|]?}|idƒp)tiitii|ƒdƒdVqqWdS(scommon.confiiN(tendswithRRtsplitexttsplit(t.0RL((s5/usr/share/fail2ban/testcases/clientreadertestcase.pys	<genexpr>
s	sfilter.ds*.confcss#x|]}|iƒdVqWdS(tfilterN(t
getRawOptions(R‰R@((s5/usr/share/fail2ban/testcases/clientreadertestcase.pys	<genexpr>s	s=More filters exists than are referenced in stock jail.conf %rs2Stock jail.conf references non-existent filters %r(RR{R!R"R'RhtglobRRRtgetJailsR|R}tissubsett
difference(R
Rtfilterstfilters_jail((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestReadSockJailConfCompletes	(	c
Cstdddtƒ}|i|iƒƒ|i|iƒƒ|idtƒ}|it|ƒƒxhddgD]Z}|id|dg|jƒ|id	|d
dg|jƒ|id|g|jƒqmW|i|d
ddƒx|iD]}|i	}|i
ƒ}|it|ƒdd|ƒxÓ|D]Ë}|iƒ}|iƒ}dt|ƒjoš|id|i
jƒt}	d	|d|dg}
x?|D]7}t|ƒdjo|d |
jo
t}	q•q•q•W|i|	dd|
t|ƒfƒq,q,WqíWdS(NRR=R…Resssh-iptablestrecidiveRfRgRhRiRjRyiÿÿÿÿitmsgsNo actions found for jail %ss<blocktype>t	blocktypetsetcinfoisFound no %s command among %s(RR{R!R"R'RztlenR*t_JailsReader__jailst_JailReader__actionsRFtgetFiletstrt_ActionReader__cInfotFalse(R
RR€tjtactionst	jail_nameRTtcommandstfile_tblocktype_presentttarget_commandtcommand((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyt!testReadStockJailConfForceEnabledsF

	cCsûtƒ}|idƒ|i|iƒdƒ|iƒ|iƒ}|i|ddƒ|i|ddƒ|iƒ|iƒ|iƒ}|it	|ƒdddgdd	d
ggƒ|i
idƒ|i|i
iƒdƒ|i|iƒdƒdS(NR=tsockets/var/run/fail2ban/fail2ban.socktpidfiles/var/run/fail2ban/fail2ban.pidRhtloglevelit	logtargets/var/log/fail2ban.logs/tmp(Rt
setBaseDirR*t
getBaseDirt	readEarlytgetEarlyOptionsR'tconvertToProtocoltgetConfigStreamR~t_Configurator__jails(R
tconfiguratortoptsR¡((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyttestConfiguratorJs 	



(R8R9RdRR„R’R¦R´(((s5/usr/share/fail2ban/testcases/clientreadertestcase.pyRb¸s		8			3(t
__author__t
__copyright__t__license__RRŒR	Rtunittesttclient.configreaderRtclient.jailreaderRtclient.jailsreaderRtclient.configuratorRtutilsRtTestCaseRR:Rb(((s5/usr/share/fail2ban/testcases/clientreadertestcase.pys<module>s<NJ

Man Man