+
    Bi+                     $   ^ RI t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ]! ]R4      '       d   ]! ]R4      '       g   ]P                  ! R4      h]P                  ! R4      t ! R	 R
]P                  4      t]R8X  d   ]P                  ! 4        R# R# )    N)support)import_helper)	os_helperaddaudithookauditz.test only relevant when sys.audit is availablezaudit-tests.pyc                     a  ] tR t^t o Rt]P                  ! 4       R 4       tR tRR/R lt	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR t]P4                  ! R4      R 4       tR tR tR tR tR t R t!R t"R  t#R! t$R" t%R# t&R$ t']PP                  ]PR                  R% 4       4       t*R&t+V t,R# )'	AuditTestNc                t   \         P                  ! \        P                  R \        .VORR\         P
                  \         P
                  R7      ;_uu_ 4       pVP                  4        W"P                  P                  4       VP                  P                  4       3uuRRR4       #   + '       g   i     R# ; i)z-X utf8zutf-8backslashreplace)encodingerrorsstdoutstderrN)

subprocessPopensys
executableAUDIT_TESTS_PYPIPEwaitr   readr   )selfargsps   &* &/usr/lib/python3.14/test/test_audit.pyrun_test_in_subprocess AuditTest.run_test_in_subprocess   s{    ^^Y>>%????
 
 FFHhhmmoqxx}}6
 
 
 
s   AB&&B7	c                    V P                   ! V!  w  r#p\        P                  P                  V4       \        P                  P                  V4       VP
                  '       d   V P                  V4       R # R # )N)r   r   r   writer   
returncodefail)r   r   procr   r   s   &*   r   do_testAuditTest.do_test!   sU    #::DAf

 

 ???IIf     expect_stderrFc               B   . pV P                   ! V!  w  rEpV'       d   \        P                  '       d    \        P                  P                  V4       VP                  VP                  4        Uu. uF!  qwP                  4       P                  R 4      NK#  	  upV3# u upi ) )
r   r   verboser   r   r   r    
splitlinesstrip	partition)r   r&   r   eventsr"   r   r   lines   &$*     r   
run_pythonAuditTest.run_python)   s|    #::DAfJJV$OO5;5F5F5HI5HTZZ\##C(5HI
 	
Is   0'Bc                (    V P                  R 4       R# )
test_basicNr#   r   s   &r   r2   AuditTest.test_basic4   s    \"r%   c                (    V P                  R 4       R# )test_block_add_hookNr3   r4   s   &r   r7   AuditTest.test_block_add_hook7   s    *+r%   c                (    V P                  R 4       R# )!test_block_add_hook_baseexceptionNr3   r4   s   &r   r:   +AuditTest.test_block_add_hook_baseexception:   s    89r%   c                T    \         P                  ! R 4       V P                  R4       R# )marshaltest_marshalNr   import_moduler#   r4   s   &r   r>   AuditTest.test_marshal=   s    ##I.^$r%   c                T    \         P                  ! R 4       V P                  R4       R# )pickletest_pickleNr?   r4   s   &r   rD   AuditTest.test_pickleB   s    ##H-]#r%   c                (    V P                  R 4       R# )test_monkeypatchNr3   r4   s   &r   rG   AuditTest.test_monkeypatchG   s    '(r%   c                F    V P                  R \        P                  4       R# )	test_openN)r#   r   TESTFNr4   s   &r   rJ   AuditTest.test_openJ   s    [)"2"23r%   c                (    V P                  R 4       R# )test_cantraceNr3   r4   s   &r   rN   AuditTest.test_cantraceM   s    _%r%   c                (    V P                  R 4       R# )	test_mmapNr3   r4   s   &r   rQ   AuditTest.test_mmapP   s    [!r%   c                T    \         P                  ! R 4       V P                  R4       R# )ctypestest_ctypes_call_functionNr?   r4   s   &r   rU   #AuditTest.test_ctypes_call_functionS   s    ##H-01r%   c                T    \         P                  ! R 4       V P                  R4       R# )_posixsubprocesstest_posixsubprocessNr?   r4   s   &r   rY   AuditTest.test_posixsubprocessW   s    ##$67+,r%   c                    V P                  R 4      w  rpV'       g   V P                  RV 24       V P                  R.V4       R# )test_excepthookzExpected fatal exception
N)zsys.excepthookr(   zRuntimeError('fatal-error'))r/   r!   assertSequenceEqualr   r    r-   r   s   &   r   r\   AuditTest.test_excepthook[   sC    %)__5F%G"
FII26(;<  CDf	
r%   c                   \         P                  ! R 4       V P                  R4      w  rpV'       d   V P                  V4       V P	                  V^ ,          ^ ,          R4       V P	                  V^ ,          ^,          R4       R# )	_testcapitest_unraisablehookzsys.unraisablehookzDRuntimeError('nonfatal-error') Exception ignored for audit hook testN)r   r@   r/   r!   assertEqualr^   s   &   r   rb   AuditTest.test_unraisablehookd   sh    ##K0%)__5J%K"
FIIf1';<1IaLR	
r%   c                   \         P                  ! R 4       V P                  R4      w  rpV'       d   V P                  V4       V P	                  V^ ,          ^ ,          R4       V P	                  V^,          ^ ,          R4       V^,          ^,          pV P                  V4       V P                  RRV R2.V^,          4       V P                  RRV R2.V^,          4       V P                  RRV.V^,          4       R	# )
winregtest_winregzwinreg.OpenKeyzwinreg.OpenKey/resultzwinreg.EnumKeyr(   z 0z 10000zwinreg.PyHKEY.DetachN)r   r@   r/   r!   rc   
assertTruer]   )r   r    r-   r   expecteds   &    r   rg   AuditTest.test_winregp   s    ##H-%)__]%C"
FIIf1'781'>?!9Q<!  "2CH:R!I6RS9U  "2CH:V9L!MvVWyY  "8#x!H&QR)Tr%   c                   \         P                  ! R 4       V P                  R4      w  rpV'       d   V P                  V4       \        P
                  '       d   \        VRR/  V P                  V^ ,          ^ ,          R4       V P                  V^,          ^ ,          R4       V P                  V^,          ^ ,          R4       V P                  V^,          ^,          R4       R# )	sockettest_socketsep
zsocket.gethostnamezsocket.__new__zsocket.bindz('127.0.0.1', 8080)N)	r   r@   r/   r!   r   r)   printrc   assertEndsWithr^   s   &   r   rm   AuditTest.test_socket~   s    ##H-%)__]%C"
FIIf???6$t$1';<1'781}5F1IaL*?@r%   c                    V P                  R 4      w  rpV'       d   V P                  V4       \        P                  '       d   \	        VRR/  T P                  V Uu. uF  qD^ ,          NK  	  up. RO4       R# u upi )test_gcrn   ro   N)zgc.get_objectszgc.get_referrerszgc.get_referentsr/   r!   r   r)   rp   rc   r   r    r-   r   events   &    r   rt   AuditTest.test_gc   sd    %)__Y%?"
FIIf???6$t$#)*6%1XX6*F	
*s   A;networkc                   \         P                  ! R 4       V P                  R4      w  rpV'       d   V P                  V4       \        P
                  '       d   \        VRR/  V P                  V^ ,          ^ ,          R4       V P                  V^ ,          ^,          R4       V P                  V^,          ^ ,          R4       V^,          ^,          R8w  d#   V P                  RV^,          ^,          4       R	# R	# )
zhttp.clienttest_http_clientrn   ro   zhttp.client.connectzwww.python.org 80zhttp.client.sendz[cannot send]HTTPN)	r   r@   r/   r!   r   r)   rp   rc   assertInr^   s   &   r   	test_httpAuditTest.test_http   s    ##M2%)__5G%H"
FIIf???6$t$1'<=1':;1'9:!9Q<?*MM&&)A,/ +r%   c                   \         P                  ! R 4      pV P                  R4      w  r#pV'       d   V P                  V4       \        P
                  '       d   \        VRR/  V Uu. uF  qU^ ,          NK  	  ppRR.^,          p\        VP                  R4      '       d   VRR.,          pV P                  Wg4       R	# u upi )
sqlite3test_sqlite3rn   ro   zsqlite3.connectzsqlite3.connect/handleenable_load_extensionzsqlite3.enable_load_extensionzsqlite3.load_extensionN)
r   r@   r/   r!   r   r)   rp   hasattr
Connectionrc   )r   r   r    r-   r   evactualri   s   &       r   r   AuditTest.test_sqlite3   s    --i8%)__^%D"
FIIf???6$t$"()&BQ%%&)%'?@1D7%%'>??/( H 	* *s   )Cc                   V P                  R 4      w  rpV'       d   V P                  V4       \        P                  '       d   \	        VRR/  V Uu. uF  qD^ ,          V^,          3NK  	  ppR.pV P                  WV4       R# u upi )test_sys_getframern   ro   N)zsys._getframer   ru   r   r    r-   r   r   r   ri   s   &      r   r   AuditTest.test_sys_getframe   st    %)__5H%I"
FIIf???6$t$+126Ra5"Q%.62:;* 3   Bc                   V P                  R 4      w  rpV'       d   V P                  V4       \        P                  '       d   \	        VRR/  V Uu. uF  qD^ ,          V^,          3NK  	  ppR.pV P                  WV4       R# u upi )test_sys_getframemodulenamern   ro   N)zsys._getframemodulename0ru   r   s   &      r   r   %AuditTest.test_sys_getframemodulename   st    %)__5R%S"
FIIf???6$t$+126Ra5"Q%.6245* 3r   c                   V P                  R 4      w  rpV'       d   V P                  V4       \        P                  '       d   \	        VRR/  V Uu. uF  qD^ ,          V^,          3NK  	  pp. ROpV P                  WV4       R# u upi )test_threadingrn   ro   N))z_thread.start_new_threadz(<test_func>, (), None)ztest.test_funcz())z_thread.start_joinable_threadz(<test_func>, 1, None)r   ru   r   s   &      r   r   AuditTest.test_threading   su    %)__5E%F"
FIIf???6$t$+126Ra5"Q%.62
 	* 3s   Bc                @   \         P                  ! R 4       V P                  R4      w  rpV'       d   V P                  V4       \        P
                  '       d   \        VRR/  V Uu. uF  qD^ ,          V^,          3NK  	  ppR.pV P                  WV4       R# u upi )_wmitest_wmi_exec_queryrn   ro   N)z_wmi.exec_queryz#SELECT * FROM Win32_OperatingSystemr   r@   r/   r!   r   r)   rp   rc   r   s   &      r   r   AuditTest.test_wmi_exec_query   s    ##F+%)__5J%K"
FIIf???6$t$+126Ra5"Q%.62NO* 3s   )Bc                   \         P                  ! R 4      pV P                  R4      w  r#pV'       d   V P                  V4       \        P
                  '       d   \        R.VO5RR/  V P                  VRRRVP                   23RRVP                   R	23R
RVP                   3RRRVP                   R23RRRVP                   23RRRVP                   RVP                   23RRRVP                   23R.	4       R# )syslogtest_syslogzEvents:rn   z
  zsyslog.openlogr(   z	python 0 zsyslog.syslogz testzsyslog.setlogmaskz test2zaudit-tests.py 0 zaudit-tests.py zNone 0 N)zsyslog.closelog r   )r   r@   r/   r!   r   r)   rp   r]   LOG_USERLOG_INFO	LOG_DEBUG
LOG_NDELAY
LOG_LOCAL0)r   r   r    r-   r   s   &    r   r   AuditTest.test_syslog   s   ,,X6%)__]%C"
FIIf???)1f1&1  y0A%BCcfoo%6e#<= #&*:*:);='cfoo%6f#=>s&77H$IJsof6G6G5H&J[J[I\$]^sgfoo->$?@')	
r%   c                d    V P                  R 4      w  rpV'       d   V P                  V4       R# R# )test_not_in_gcNr/   r!   r   r    _r   s   &   r   r   AuditTest.test_not_in_gc
  s*     $0@ A
vIIf r%   c                   V P                  R R4      w  rpV'       d   V P                  V4       \        P                  '       d   \	        VRR/  V Uu. uF  qD^ ,          V^,          3NK  	  pp. ROpV P                  WV4       R# u upi )	test_timerp   rn   ro   N))
time.sleepr   )r   z0.0625)r   z-1ru   r   s   &      r   r   AuditTest.test_time  sv    %)__['%J"
FIIf???6$t$+126Ra5"Q%.62* 	* 3s   Bc                    V P                  R RRR7      w  rpV P                  V^ 4       V P                  RVP                  4       R,          4       R# )r   r!   T)r&   zhook failedN)r/   assertNotEqualr}   r*   r^   s   &   r   test_time_failAuditTest.test_time_fail  sN    %)__[&CG &5 &I"
FJ*mV%6%6%8%<=r%   c                   V P                  R 4      w  rpV'       d   V P                  V4       \        P                  '       d   \	        VRR/  V Uu. uF  qD^ ,          V^,          3NK  	  ppR.pV P                  WV4       R# u upi )%test_sys_monitoring_register_callbackrn   ro   N)z sys.monitoring.register_callbackz(None,)ru   r   s   &      r   r   /AuditTest.test_sys_monitoring_register_callback$  st    %)__5\%]"
FIIf???6$t$+126Ra5"Q%.62CD* 3r   c                T   \         P                  ! R 4      pRpV P                  RV4      w  r4pV'       d   V P                  V4       \        P
                  '       d   \        VRR/  V Uu. uF  qf^ ,          V^,          3NK  	  ppRRV: R23.pV P                  Wx4       R# u upi )	_winapiz+\\.\pipe\LOCAL\test_winapi_createnamed_pipetest_winapi_createnamedpipern   ro   z_winapi.CreateNamedPipe(z, 3, 8)Nr   )	r   winapi	pipe_namer    r-   r   r   r   ri   s	   &        r   r   %AuditTest.test_winapi_createnamedpipe0  s    ,,Y7B	%)__5RT]%^"
FIIf???6$t$+126Ra5"Q%.62.!I=0HIJ* 3s   ,B%c                d    V P                  R 4      w  rpV'       d   V P                  V4       R# R# )test_assert_unicodeNr   r   s   &   r   r   AuditTest.test_assert_unicode?  s*     $0E F
vIIf r%   c           	     ,   V P                  R 4      w  rpT P                  \        V Uu. uF  pRV9   NK
  	  up4      4       T P                  \        V Uu. uF  pRV9   NK
  	  up4      4       V'       d   V P                  V4       R# R# u upi u upi )test_sys_remote_execzsys.remote_execzcpython.remote_debugger_scriptN)r/   rh   anyr!   rv   s   &    r   r   AuditTest.test_sys_remote_execE  s     &*__5K%L"
FVLVE.%7VLMNTZ[TZ5=FTZ[\]IIf  M[s   BB )-__name__
__module____qualname____firstlineno__maxDiffr   requires_subprocessr   r#   r/   r2   r7   r:   r>   rD   rG   rJ   rN   rQ   rU   rY   r\   rb   rg   rm   rt   requires_resourcer~   r   r   r   r   r   r   r   r   r   r   r   r   support_remote_exec_onlycpython_onlyr   __static_attributes____classdictcell__)__classdict__s   @r   r	   r	      s    G  "	7 #	7	
e 	
#,:%
$
)4&"2-


UA

 y)0 *0+&
+
++$+
.
+>
++ %%  &r%   r	   __main__)r   r   unittesttestr   test.supportr   r   r   SkipTestfindfiler   TestCaser	   r   mainr   r%   r   <module>r      s     
   & " sN##73+@+@


L
MM!!"23z!! zx	 zMMO r%   