tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Q\¬Qc@s?dZddlmZejdƒZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddlZddl Z ddlZddlZejje jƒejdƒZejddeƒdejfd    „ƒYZd
ejfd „ƒYZd „Zed kr;eƒndS(sTest posix functionsiÿÿÿÿ(t test_supporttposixNs-dummy-symlinktignores.* potential security risk .*t PosixTestercBs™eZd„Zd„Zd„Zeedƒr<d„ZneedƒrWd„Zneedƒr{d„Z    d    „Z
need
ƒrŸd „Z d „Z ne jeed ƒdƒd„ƒZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Ze jeedƒdƒd„ƒZe jeed ƒd!ƒd"„ƒZe jeed#ƒd$ƒd%„ƒZd&„Z d'„Z!d(„Z"d)„Z#d*„Z$d+„Z%d,„Z&d-„Z'd.„Z(d/„Z)e jeed0ƒd1ƒd2„ƒZ*e jeed3ƒd4ƒd5„ƒZ+e jeed3ƒd4ƒd6„ƒZ,d7„Z-e jee.d8ƒd9ƒd:„ƒZ/RS(;cCs/ttjdƒ}|jƒtjg|_dS(Nsw+(topenRtTESTFNtclosetteardown_files(tselftfp((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pytsetUps
cCs%x|jD]}tj|ƒq
WdS(N(Rtostunlink(Rt teardown_file((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttearDown#scCs©ddddddddd    d
d d d ddg}tjƒdtjddtƒxI|D]A}tt|dƒ}|dk    rZ|ƒ|jt|dƒqZqZWWdQXdS(Ntctermidtgetcwdtgetcwdutunamettimest
getloadavgttmpnamtgetegidtgeteuidtgetgidt    getgroupstgetpidtgetpgrptgetppidtgetuidRti(    twarningstcatch_warningstfilterwarningstDeprecationWarningtgetattrRtNonet assertRaisest    TypeError(RtNO_ARG_FUNCTIONStnamet
posix_func((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttestNoArgFunctions's         t    getresuidcCsGtjƒ}|jt|ƒdƒx|D]}|j|dƒq)WdS(Nii(RR+t assertEqualtlentassertGreaterEqual(Rtuser_idstval((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_getresuid9s  t    getresgidcCsGtjƒ}|jt|ƒdƒx|D]}|j|dƒq)WdS(Nii(RR2R,R-R.(Rt    group_idsR0((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_getresgid@s  t    setresuidcCsBtjƒ}|jtj|Œƒ|jtjdddƒƒdS(Niÿÿÿÿ(RR+t assertIsNoneR5(Rtcurrent_user_ids((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_setresuidGs cCsLtjƒ}d|krH|ddddf}|jttj|ŒndS(Niiiÿÿÿÿ(RR+R%tOSErrorR5(RR7t new_user_ids((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_setresuid_exceptionMs  t    setresgidcCsBtjƒ}|jtj|Œƒ|jtjdddƒƒdS(Niÿÿÿÿ(RR2R6R<(Rtcurrent_group_ids((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_setresgidUs cCsLtjƒ}d|krH|ddddf}|jttj|ŒndS(Niiiÿÿÿÿ(RR2R%R9R<(RR=t new_group_ids((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_setresgid_exception[s  t
initgroupsstest needs os.initgroups()cCs|jttjƒ|jttjdƒ|jttjddƒ|jttjddtƒƒtjƒdkrytj    tjƒƒj
}Wn t k
r±t j dƒ‚nXytj|dƒWn)tk
rñ}|j|jtjƒqX|jdƒndS(Nitfooisneed a pwd entryi s+Expected OSError to be raised by initgroups(R%R&RRAR$tobjectR Rtpwdtgetpwuidtpw_nametKeyErrortunittesttSkipTestR9R,terrnotEPERMtfail(RR(te((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_initgroupsbs cCs/ttdƒr+|jtjtjƒƒndS(Ntstatvfs(thasattrRt
assertTrueROR tcurdir(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_statvfs{scCsSttdƒrOttjƒ}z |jtj|jƒƒƒWd|jƒXndS(Ntfstatvfs(    RPRRRRRQRTtfilenoR(RR    ((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_fstatvfss
 cCsgttdƒrcttjdƒ}z1|jdƒ|jƒtj|jƒdƒWd|j    ƒXndS(Nt    ftruncatesw+ttesti(
RPRRRRtwritetflushRWRUR(RR    ((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_ftruncate‡s 
cCsittdƒrettjƒ}z6tj|jƒƒ}|j|tƒt    j
|ƒWd|j
ƒXndS(Ntdup( RPRRRRR\RUtassertIsInstancetintR R(RR    tfd((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_dup’scCsQttdƒrM|jttjdƒ|jttjdƒƒdktƒndS(Ntconfstrt
CS_garbagetCS_PATHi(RPRR%t
ValueErrorRaR,R-tTrue(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_confstrœscCslttdƒrhttjƒ}ttjƒ}z tj|jƒ|jƒƒWd|jƒ|jƒXndS(Ntdup2(RPRRRRRgRUR(Rtfp1tfp2((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt    test_dup2¡s 
cGs8tjtjtjƒ}tj||Œ}|jƒdS(N(R RRRtO_RDONLYRtfdopenR(RtargsR_Ri((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt fdopen_helper«scCs=ttdƒr9|jƒ|jdƒ|jddƒndS(NRltrid(RPRRn(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_fdopen°s
 cCsèttdƒrätjtjtjtjBtjBƒ}|j    t
tjtjtjtjBtj Bƒtj |ƒttdƒrätjtjtjtj BtjBƒ}|j    t
tjtjtjtjBtj Bƒtj |ƒqändS(NtO_EXLOCKtO_SHLOCK(RPRR RRRtO_WRONLYRqtO_CREATR%R9t
O_NONBLOCKRRr(RR_((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_osexlock¶s   cCsîttdƒrêtjtjtjtjBtjBƒ}tjtjtjtjBtjBƒ}tj    |ƒtj    |ƒttdƒrêtjtjtjtjBtjBƒ}|j
t tjtjtj tj BtjBƒtj    |ƒqêndS(NRrRq(RPRR RRRRsRrRtRR%R9RkRqRu(Rtfd1tfd2R_((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_osshlockÅs     cCsSttdƒrOttjƒ}z |jtj|jƒƒƒWd|jƒXndS(Ntfstat(    RPRRRRRQRzRUR(RR    ((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt
test_fstatÕs
 cCs/ttdƒr+|jtjtjƒƒndS(Ntstat(RPRRQR|RR(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt    test_statÝsc    s‡‡‡fd†}tjƒ}tjƒ}|ˆ||ƒ|||ƒ|ˆd|ƒ|||ƒ|ˆ|dƒ|||ƒ|dkrðd
}|ˆ||ƒ|||ƒ|ˆddƒ|||ƒ|ˆ||ƒ|||ƒn«tjƒd krtjdƒ‚n‡ˆjt|ˆddƒ|||ƒˆjt|ˆddƒ|||ƒdtj    ƒkr›ˆjt|ˆddƒ|||ƒnxlt
t fD]^}ˆjt |ˆ||ƒ|ƒ|||ƒˆjt |ˆ|||ƒƒ|||ƒq¨Wd    S( s/Common code for chown, fchown and lchown tests.csEˆdk    rAˆˆƒ}ˆj|j|ƒˆj|j|ƒndS(N(R$R,tst_uidtst_gid(tuidtgidR|(t first_paramRt    stat_func(sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt
check_statãs  iÿÿÿÿiiisHP-UXtSunOSs1Skipping because of non-standard chown() behaviorNI€(sHP-UXR…( R RRtplatformtsystemRHRIR%R9RtstrtfloatR&(    Rt
chown_funcR‚RƒR„R€Rt    big_valuett((R‚RRƒsW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt_test_all_chown_commonás>           tchownstest needs os.chown()cCsntjtjƒ|jttjtjddƒttjdƒj    ƒ|j
tjtjt tddƒƒdS(NiÿÿÿÿtwR|( R R RRR%R9RRŽRRRR#R$(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt
test_chowns
tfchownstest needs os.fchown()cCsftjtjƒttjdƒ}z2|jƒ}|jtj|t    tddƒƒWd|j ƒXdS(NRRz( R R RRRRURRR‘R#R$R(Rt    test_fileR_((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_fchown's tlchownstest needs os.lchown()cCsLtjtjƒtjttjƒ|jtjtjt    tddƒƒdS(Ntlstat( R R RRtsymlinkt_DUMMY_SYMLINKRRR”R#R$(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_lchown4scCs?ttdƒr;tjtjƒ|jttjtjƒndS(Ntchdir(    RPRR™R RRR%R9RR(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt
test_chdir<scCs5ttdƒr1|jtjtjtjƒƒndS(Ntlsdir(RPRtassertInRRR›R RR(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt
test_lsdirAscCs5ttdƒr1|jtjtjtjƒƒndS(Ntaccess(RPRRQRžRRR tR_OK(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_accessEscCsBttdƒr>tjdƒ}|j|tƒtj|ƒndS(Ntumaski(RPRR¡R]R^(Rtold_mask((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt
test_umaskIscCs,ttdƒr(|jtjdƒƒndS(Ntstrerrori(RPRRQR¤(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_strerrorOscCsBttdƒr>tjƒ\}}tj|ƒtj|ƒndS(Ntpipe(RPRR¦R R(Rtreadertwriter((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt    test_pipeSs cCs„ttdƒr€tjƒ`tjddtƒ|jtjƒƒ|jtjtj    ƒƒ|jtjtj    dƒƒWdQXndS(NttempnamRtblah(
RPRRR R!R"RQRªR RR(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_tempnamYs  cCsRttdƒrNtjƒ.tjddtƒtjƒ}|jƒWdQXndS(NttmpfileR(RPRRR R!R"R­R(RR    ((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_tmpfileas
  cCsÓttdƒrÏtjƒ}tjtjdƒ|jttjtjdƒ|jttjtj|dfƒ|jttjtjd|fƒtjtjt    |ƒt    |ƒfƒtjtj||fƒndS(Ntutime(NN(
RPRttimeR¯RRR$R%R&R^(Rtnow((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt
test_utimehs ""%c    Cs tj|ƒ}|jt|dƒƒy|||jtjBƒWn>tk
r€}|jtjkrj‚nd}|j    |ƒnXzotj|ƒ}|j
|jtjB|jƒyt |dƒ}Wn)t k
rî}|j
|jtj ƒnXWdtj||jƒXdS(Ntst_flagss2chflag UF_IMMUTABLE not supported by underlying fssw+(R R|RQRPR³t UF_IMMUTABLER9RJt
EOPNOTSUPPtskipTestR,RtIOErrorRKRtchflags(    Rt chflags_funct target_filetstterrtmsgtnew_stR_RM((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt_test_chflags_regular_filers"R¸stest needs os.chflags()cCs|jtjtjƒdS(N(R¿RR¸RR(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt test_chflags‰stlchflagsstest needs os.lchflags()cCs|jtjtjƒdS(N(R¿RRÁRR(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_lchflags_regular_filescCs,tjtjƒ}|jt|dƒƒtjtjtƒ|jj    tƒtj
tƒ}yt j t|j tjBƒWn>tk
r¸}|jtjkr¢‚nd}|j|ƒnXzXtjtjƒ}tj
tƒ}|j|j |j ƒ|j|j tjB|j ƒWdt j t|j ƒXdS(NR³s2chflag UF_IMMUTABLE not supported by underlying fs(R R|RRRQRPR–R—RtappendR•RRÁR³R´R9RJRµR¶R,(Rt    testfn_sttdummy_symlink_stR¼R½t new_testfn_sttnew_dummy_symlink_st((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_lchflags_symlink‘s(    cs«ttdƒr§d}tjƒ}tjjtjƒd}ytj|ƒtj    |ƒWndSXz#d‡‡fd†‰ˆ|ƒWdtj    |ƒt
j |ƒXndS(NRs8getcwd-test-directory-0123456789abcdef-01234567890abcdefs.getcwdicsytj|ƒWntjd‚nXtj|ƒz­y8tjƒ|dkrnˆ||t|ƒdƒnWnntk
rß}tj    }dt
j kp´dt
j kp´dt
j k}|rÉtj }nˆj |j|ƒnXWdtjdƒtj|ƒXdS(Ns?mkdir cannot create directory sufficiently deep for getcwd testiitsunostnetbsdtopenbsds..(R tmkdirRHRIR™RR-R9RJt ENAMETOOLONGtsysR†tERANGER,trmdir(tdirnametcurrent_path_lengthRMtexpected_errnotquirky_platform(t_create_and_do_getcwdR(sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyRÕÀs( 
 "      ( RPRR RtpathtabspathRRRÌR™tshutiltrmtree(RRÑRRt    base_path((RÕRsW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_getcwd_long_pathnames¯s   Rstest needs os.getegid()c    Cstjdƒ%}|jƒjƒ}|jƒ}WdQX|dksI| r[tjdƒ‚ntj    dkr²ddl
}|j dƒpˆd}t |ƒdkr²tjdƒ‚q²n|j tg|jƒD]}t|ƒ^qȃttjƒtjƒgƒƒdS(    Nsid -Gsneed working 'id -G'tdarwiniÿÿÿÿtMACOSX_DEPLOYMENT_TARGETs10.0g333333%@s$getgroups(2) is broken prior to 10.6(R tpopentreadtstripRR$RHRIRÎR†t    sysconfigtget_config_varR‰R,tsettsplitR^RRR(RtidgtgroupstretRátdttx((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_getgroupsâs ((0t__name__t
__module__R
RR*RPRR1R4R8R;R>R@RHt
skipUnlessRNRSRVR[R`RfRjRnRpRvRyR{R}RRR“R˜RšRR R£R¥R©R¬R®R²R¿RÀRÂRÈRÛR Rê(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyRs\                                        
       
                           ;$ $ $                                    
   $$$    3tPosixGroupsTestercBsbeZd„Zd„Zejeedƒdƒd„ƒZejeedƒdƒd„ƒZ    RS(cCsytjƒdkr$tjdƒ‚nttdƒsEtjdƒ‚ntjdkrftjdƒ‚ntjƒ|_dS(Nisnot enough privilegesRsneed posix.getgroupsRÜsgetgroups(2) is broken on OSX(    RRRHRIRPRÎR†Rt saved_groups(R((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyR
üscCsgttdƒr"tj|jƒnAttdƒrctjtjƒƒj}tj||jdƒndS(Nt    setgroupsRAi(    RPRRðRïRDRERRFRA(RR(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyRs
RAstest needs posix.initgroups()cCsUt|jƒd}tjtjƒƒj}tj||ƒ|j|tj    ƒƒdS(Ni(
tmaxRïRDRERRRFRARœR(RtgR(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyRN sRðstest needs posix.setgroups()cCsGx@dgtdƒgD])}tj|ƒ|j|tjƒƒqWdS(Nii(trangeRRðtassertListEqualR(RRæ((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyttest_setgroupss (
RëRìR
RRHRíRPRRNRõ(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyRîús                 cCstjttƒdS(N(Rt run_unittestRRî(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt    test_mainst__main__(t__doc__RXRt import_moduleRRJRÎR°R R†RDRØR|ttempfileRHRRÖtjoint
gettempdirRR—R!tRuntimeWarningtTestCaseRRîR÷Rë(((sW/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_posix.pyt<module>s0             ÿà$