ó
wŪjc           @   s\  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 y d  d l
 Z
 Wn e k
 r” d Z
 n Xd  d l m Z d  d l m Z d  d l Z d  d l Z e j d d e e  e j d d e e  d e j f d     YZ d	 e j f d
     YZ d e j f d     YZ d  d l m Z d e j f d     YZ d e j f d     YZ d e j f d     YZ d e j f d     YZ d e j f d     YZ  e j! d  d k Z" e j# e" d  d e j f d     Y Z$ d e j f d     YZ% e j& e j' d k d   d! e j f d"     Y Z( d# e j f d$     YZ) e j# e j' d k d%  d& e j f d'     Y Z* e j& e j' d k d   d( e j f d)     Y Z+ e j& e j' d k d   d* e j f d+     Y Z, d, e j f d-     YZ- d.   Z. e d/ k rXe.   n  d S(0   i’’’’N(   t   test_support(   t   assert_python_okt   ignoret   tempnamt   tmpnamt	   FileTestsc           B   s;   e  Z d    Z e Z d   Z d   Z e j d    Z RS(   c         C   s,   t  j j t j  r( t  j t j  n  d  S(   N(   t   ost   patht   existsR    t   TESTFNt   unlink(   t   self(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   setUp   s    c         C   sO   t  j t j t  j t  j B } t  j |  |  j t  j t j t  j	   d  S(   N(
   R   t   openR    R	   t   O_CREATt   O_RDWRt   closet
   assertTruet   accesst   W_OK(   R   t   f(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_access#   s    c         C   sŚ   t  j t j t  j t  j B } t  j |  } zj d } x] | | d k r t  j |  | d 7} | d k r} |  j d  n  | t  j |  } } q: WWd  t  j |  Xt  j	 | | d  |  j
 t t  j | d  d  S(   Ni    i   i
   s%   couldn't allocate two consecutive fdsi   t   a(   R   R   R    R	   R   R   t   dupR   t   skipTestt
   closeranget   assertRaisest   OSErrort   write(   R   t   firstt   secondt   retries(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_closerange(   s    
c         C   sZ   t  t j  } t j |  } |  j t t j | d  t j |  } |  j	 | |  d  S(   Ni    (
   t   unicodeR    R	   t   syst   getrefcountR   t	   TypeErrorR   t   renamet   assertEqual(   R   R   t   oldt   new(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_rename=   s
    (	   t   __name__t
   __module__R   t   tearDownR   R    R    t   cpython_onlyR)   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR      s
   			t   TemporaryFileTestsc           B   s   e  Z d    Z d   Z d   Z e j e e d  d  d    Z	 e j e e d  d  d    Z
 e j e e d	  d
  d    Z RS(   c         C   s   g  |  _  t j t j  d  S(   N(   t   filesR   t   mkdirR    R	   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR   G   s    	c         C   s5   x |  j  D] } t j |  q
 Wt j t j  d  S(   N(   R/   R   R
   t   rmdirR    R	   (   R   t   name(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR,   K   s    c         C   s=   |  j  t j j |  d  t | d  |  j j |  d  S(   Ns&   file already exists for temporary filet   w(   t   assertFalseR   R   R   R   R/   t   append(   R   R2   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   check_tempfileP   s    R   s   test needs os.tempnam()c      	   C   s·   t  j   „ t  j d d t d  t  j d d t  |  j t j    t j t j	  } |  j |  t j t j	 d  } |  j
 t j j |  d  d k  |  j |  Wd  QXd  S(   NR   R   s   test_os$t   pfxi   (   t   warningst   catch_warningst   filterwarningst   RuntimeWarningt   DeprecationWarningR6   R   R   R    R	   R   R   t   basename(   R   R2   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_tempnamX   s    #t   tmpfiles   test needs os.tmpfile()c      	   C   s@  t  j   .t  j d d t  t j d k rä d } t j j |  rW t j	 |  n  y t
 | d  } Wn] t k
 rÉ } y t j   } Wn) t k
 r· } |  j | j | j  n X|  j d  d  SX| j   t j	 |  n  t j   } | j d  | j d d  | j   } | j   |  j | d k  Wd  QXd  S(	   NR   R?   t   win32s    \python_test_os_test_tmpfile.txtR3   s&   expected os.tmpfile() to raise OSErrort   foobari    (   R8   R9   R:   R<   R"   t   platformR   R   R   t   removeR   t   IOErrorR?   R   R&   t   argst   failR   R   t   seekt   readR   (   R   R2   t   fpR   R   t   s(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_tmpfileg   s.    

R   s   test needs os.tmpnam()c      	   C   s   t  j   u t  j d d t d  t  j d d t  t j   } t j d k rp |  j	 t j
 j |  d  n |  j |  Wd  QXd  S(   NR   R   s   test_os$R@   s&   file already exists for temporary file(   R@   (   R8   R9   R:   R;   R<   R   R   R"   RB   R4   R   R   R6   (   R   R2   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_tmpnam   s    
(   R*   R+   R   R,   R6   t   unittestt
   skipUnlesst   hasattrR   R>   RK   RL   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR.   F   s   			$$2t   StatAttributeTestsc           B   s"  e  Z d    Z d   Z e j e e d  d  d    Z e j e e d  d  d    Z	 d   Z
 d	   Z e j e j d
 k d  e j e e j  d k d  d     Z e j e j d
 k d  e j e e j  d k d  d     Z e j e j d
 k d  d    Z RS(   c         C   sX   t  j t j  t  j j t j d  |  _ t |  j d  } | j d  | j	   d  S(   Nt   f1t   wbt   ABC(
   R   R0   R    R	   R   t   joint   fnameR   R   R   (   R   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR   ø   s
    c         C   s$   t  j |  j  t  j t j  d  S(   N(   R   R
   RU   R1   R    R	   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR,   æ   s    t   stats   test needs os.stat()c         C   s  d d  l  } t j  |  j  } |  j | | j d  |  j | j d  t |  } x t |  D] } | d  d k ra | j   } | j d  r d   } n	 d   } |  j | t	 | |   | t	 | |   |  j
 | |  qa qa Wy | d |  j d  Wn t k
 rn Xy d	 | _ |  j d  Wn t t f k
 rJn Xy d	 | _ |  j d  Wn t t f k
 r~n Xy d	 | _ |  j d  Wn t k
 r¬n Xy  t j d  } |  j d  Wn t k
 rąn Xy t j d  } Wn t k
 rn Xd  S(   Ni’’’’i   t   ST_t   TIMEc         S   s
   t  |   S(   N(   t   int(   t   x(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   truncŅ   t    c         S   s   |  S(   N(    (   RZ   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR[   Ō   R\   iČ   s   No exception raisedi   i
   i    i   i   i   i   i   i   i	   i   i   i   i   (   i
   (   i    i   i   i   i   i   i   i   i   i	   i
   i   i   i   i   (   RV   R   RU   R&   t   ST_SIZEt   st_sizet   dirt   lowert   endswitht   getattrt   assertInRF   t
   IndexErrort   st_modet   AttributeErrorR$   t   st_rdevt   parrott   stat_result(   R   RV   t   resultt   membersR2   t   attrR[   t   result2(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_stat_attributesĆ   sV    				t   statvfss   test needs os.statvfs()c         C   sd  y t  j |  j  } Wn5 t k
 rM } | j t j k rN |  j d  qN n X|  j | j | d  d } x; t	 |  D]- \ } } |  j t
 | d |  | |  qx Wy d | _ |  j d  Wn t k
 rÖ n Xy d | _ |  j d  Wn t k
 rn Xy  t  j d  } |  j d  Wn t k
 r8n Xy t  j d  } Wn t k
 r_n Xd  S(    Ns%   glibc always returns ENOSYS on AtheOSi   t   bsizet   frsizet   blockst   bfreet   bavailR/   t   ffreet   favailt   flagt   namemaxt   f_i   s   No exception raisedi
   i    i   i   i   i   i   i   i	   i   i   i   i   (
   Rp   Rq   Rr   Rs   Rt   R/   Ru   Rv   Rw   Rx   (   i
   (   i    i   i   i   i   i   i   i   i   i	   i
   i   i   i   i   (   R   Ro   RU   R   t   errnot   ENOSYSR   R&   t   f_bfreet	   enumerateRb   RF   R$   Rh   Rf   t   statvfs_result(   R   Rj   t   eRk   t   valuet   memberRm   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_statvfs_attributes   s:     %		c         C   sw   d } t  j t j  } t  j t j | j t | j |  f  t  j t j  } |  j | j t | j |   d  S(   Ni@B (	   R   RV   R    R	   t   utimet   st_atimeRY   t   st_mtimeR&   (   R   t   deltat   stt   st2(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_utime_dir,  s
    )c      
   C   s   t  j d k r t j j t j j |    d d } d d  l } | j j } | j	 d d  } | j
 | d  d d  d  d  | t |   r | j Sn  d  S(   NR@   i    s   \i’’’’R\   id   (   R"   RB   R   R   t
   splitdrivet   abspatht   ctypest   windllt   kernel32t   create_string_buffert   GetVolumeInformationAt   Nonet   lenR   (   R   t   rootR   R   t   buf(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   get_file_system7  s    &*R@   s   Win32 specific testst   NTFSs   requires NTFSc         C   sB   d } t  j |  j | | f  |  j t  j |  j  j |  d  S(   Ng  ŠgśEŃA(   R   R   RU   R&   RV   R   (   R   t   t1(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_1565150@  s    c         C   sB   d } t  j |  j | | f  |  j t  j |  j  j |  d  S(   NI ņ*   (   R   R   RU   R&   RV   R   (   R   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_large_timeH  s    c         C   sW   y t  j d  Wn? t k
 rR } | j d k rB |  j d  n  |  j d  n Xd  S(   Ns   c:\pagefile.sysi   s   c:\pagefile.sys does not exists   Could not stat pagefile.sys(   R   RV   t   WindowsErrorRz   R   RF   (   R   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_1686475P  s    (   R*   R+   R   R,   RM   RN   RO   R   Rn   R   R   R   R"   RB   R    R	   R   R   R   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyRP   ·   s   		$=$,			(   t   mapping_testst   EnvironTestsc           B   sh   e  Z d  Z d
 Z d   Z d   Z d   Z d   Z d   Z	 e
 j e j j d  d  d	    Z RS(   s8   check that os.environ object conform to mapping protocolc         C   s   i d d 6d d 6d d 6S(   Nt   VALUE1t   KEY1t   VALUE2t   KEY2t   VALUE3t   KEY3(    (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt
   _reference_  s    c         C   s   t  j j   t  j S(   N(   R   t   environt   clear(   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   _empty_mappinga  s    c         C   s#   t  t j  |  _ t j j   d  S(   N(   t   dictR   R„   t   _EnvironTests__saveR¦   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR   d  s    c         C   s$   t  j j   t  j j |  j  d  S(   N(   R   R„   R¦   t   updateR©   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR,   g  s    c         C   sf   t  j j d  rb t  j j d d  t  j d  ) } | j   j   } |  j | d  Wd  QXn  d  S(   Ns   /bin/sht   HELLOt   Worlds   /bin/sh -c 'echo $HELLO'(	   R   R   R   R„   RŖ   t   popenRH   t   stripR&   (   R   R­   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_update2l  s
    t   freebsdt   darwins%   due to known OS bug: see issue #13415c         C   sX   t  j d k r5 d d } |  j t t j j |  n d } |  j t t j j |  d  S(   NR@   RZ   iPĆ  s   key=(   R"   RB   R   t
   ValueErrorR   R„   t   __delitem__R   (   R   t   key(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_unset_erroru  s
    
N(   R°   R±   (   R*   R+   t   __doc__R   t	   type2testR¤   R§   R   R,   RÆ   RM   t   skipIfR"   RB   t
   startswithRµ   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR   \  s   						t	   WalkTestsc           B   s    e  Z d  Z d   Z d   Z RS(   s   Tests for os.walk().c         C   sl  d d  l  } d d l m } | t j d  } | | d  } | | d  } | | d  } | | d  } | | d  } | | d	  }	 | | d
  }
 | t j d  } | t j d d  } | j |  | j |  | j |  xH | | |	 | f D]4 } t | d  } | j d | d  | j   qų Wt	 | d  rs| j
 | j j |  |
  | d
 g d	 g f } n | g  d	 g f } t | j |   } |  j t |  d  | d d d d k } | d d j   |  j | d | d d g d g f  |  j | d | | d g d g f  |  j | d | | g  g  f  |  j | d d | |  g  } xR | j |  D]A \ } } } | j | | | f  d | k rz| j d  qzqzW|  j t |  d  |  j | d | d g d g f  |  j | d |  t | j | d t  } |  j t |  d  | d d d d k } | d d j   |  j | d | d d g d g f  |  j | | | g  g  f  |  j | | d | d g d g f  |  j | d d | |  t	 | d  rhxi | j | d t D]B \ } } } | |
 k r|  j | g   |  j | d g  PqqW|  j d  n  d  S(   Ni’’’’(   RT   t   TEST1t   SUB1t   SUB11t   SUB2t   tmp1t   tmp2t   tmp3t   linkt   TEST2t   tmp4R3   s   I'm s"    and proud of it.  Blame test_os.
t   symlinki   i    i   i   i   t   topdownt   followlinkss+   Didn't follow symlink with followlinks=True(   R   t   os.pathRT   R    R	   t   makedirst   fileR   R   RO   RÅ   R   R   t   listt   walkR&   R   t   sortR5   RC   t   Falset   TrueRF   (   R   R   RT   t	   walk_patht	   sub1_patht
   sub11_patht	   sub2_patht	   tmp1_patht	   tmp2_patht	   tmp3_patht	   link_patht   t2_patht	   tmp4_pathR   R   t	   sub2_treet   allt   flippedR   t   dirsR/   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_traversal  sl    &'!#&'%c         C   sĀ   x« t  j t j d t D] \ } } } x* | D]" } t  j t  j j | |   q/ WxR | D]J } t  j j | |  } t  j j |  s t  j	 |  q\ t  j |  q\ Wq Wt  j	 t j  d  S(   NRĘ   (
   R   RĢ   R    R	   RĪ   RC   R   RT   t   islinkR1   (   R   R   RŻ   R/   R2   t   dirname(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR,   Ż  s    ( (   R*   R+   R¶   RŽ   R,   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyRŗ     s   	Yt   MakedirTestsc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   t  j t j  d  S(   N(   R   R0   R    R	   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR   ī  s    c      	   C   sä   t  j } t j j | d d d  } t j |  t j j | d d d d  } t j |  |  j t t j t j  t j j | d d d d d t j  } t j |  t j j | d t j d d d d d  } t j |  d  S(   Nt   dir1t   dir2t   dir3t   dir4t   dir5t   dir6(	   R    R	   R   R   RT   RÉ   R   R   t   curdir(   R   t   baseR   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_makedirń  s    	'c         C   ss   t  j j t j d d d d d d  } x8 t  j j |  ra | t j k ra t  j j |  } q* Wt  j |  d  S(   NRā   Rć   Rä   Rå   Rę   Rē   (   R   R   RT   R    R	   R   Rą   t
   removedirs(   R   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR,     s
    %(   R*   R+   R   Rź   R,   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyRį   ķ  s   		t   DevNullTestsc           B   s   e  Z d    Z RS(   c         C   s_   t  t j d  } | j d  | j   t  t j d  } |  j | j   d  | j   d  S(   NR3   t   hellot   rR\   (   RŹ   R   t   devnullR   R   R&   RH   (   R   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_devnull  s    
(   R*   R+   Rš   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyRģ     s   t   URandomTestsc           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C   s   |  j  t t j d   d  |  j  t t j d   d  |  j  t t j d   d  |  j  t t j d   d  |  j  t t j d   d  d  S(   Ni    i   i
   id   ič  (   R&   R   R   t   urandom(   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_urandom_length  s
    c         C   s2   t  j d  } t  j d  } |  j | |  d  S(   Ni   (   R   Rņ   t   assertNotEqual(   R   t   data1t   data2(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_urandom_value   s    c         C   s¾   d j  d d | d d d f  } t j d | g } t j | d t j d	 t j d
 t j } | j   \ } } |  j | j   d | j   | f  t	 |  } |  j t
 |  | |  | S(   Ns   
s   import os, syss   data = os.urandom(%s)s   sys.stdout.write(repr(data))s   sys.stdout.flush()s&   print >> sys.stderr, (len(data), data)s   -ct   stdint   stdoutt   stderri    (   RT   R"   t
   executablet
   subprocesst   Popent   PIPEt   communicateR&   t   waitt   evalR   (   R   t   countt   codet   cmd_linet   pt   outt   err(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   get_urandom_subprocess%  s    %c         C   s2   |  j  d  } |  j  d  } |  j | |  d  S(   Ni   (   R  Rō   (   R   Rõ   Rö   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_urandom_subprocess7  s    (   R*   R+   Ró   R÷   R  R	  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyRń     s   			t   HAVE_GETENTROPYi   s+   getentropy() does not use a file descriptort   URandomFDTestsc           B   s#   e  Z e j e d   d    Z RS(   s!   test requires the resource modulec         C   s   d } t  d |  d  S(   NsĢ  if 1:
            import errno
            import os
            import resource

            soft_limit, hard_limit = resource.getrlimit(resource.RLIMIT_NOFILE)
            resource.setrlimit(resource.RLIMIT_NOFILE, (1, hard_limit))
            try:
                os.urandom(16)
            except OSError as e:
                assert e.errno == errno.EMFILE, e.errno
            else:
                raise AssertionError("OSError not raised")
            s   -c(   R   (   R   R  (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_urandom_failureB  s    (   R*   R+   RM   RN   t   resourceR  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR  ?  s   t	   ExecTestsc           B   s   e  Z d    Z d   Z RS(   c         C   s    |  j  t t j d g  d   d  S(   Nt   notepad(   R   R²   R   t   execvpeR   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_execvpe_with_bad_arglist\  s    c      
   C   sč   t  j d d g } t j j   } d | d <|  j t   t j | d | |  Wd  QXt j j   } d | d <|  j t   t j | d | |  Wd  QXt j j   } d | d	 <|  j t   t j | d | |  Wd  QXd  S(
   Ns   -ct   passt   cabbages   FRUIT VEGETABLEi    s   orange VEGETABLE=cabbaget   FRUITt   lemons   FRUIT=ORANGE(	   R"   Rū   R   R„   t   copyR   R$   t   execveR²   (   R   RE   t   newenv(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_execve_invalid_env_  s    


(   R*   R+   R  R  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR  Z  s   	R@   s   Win32 specific testst   Win32ErrorTestsc           B   s>   e  Z d    Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   s'   |  j  t t j t j t j d  d  S(   Ns   .bak(   R   R   R   R%   R    R	   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR)   w  s    c         C   s   |  j  t t j t j  d  S(   N(   R   R   R   RC   R    R	   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_removez  s    c         C   s   |  j  t t j t j  d  S(   N(   R   R   R   t   chdirR    R	   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt
   test_chdir}  s    c         C   sQ   t  t j d  } z |  j t t j t j  Wd  | j   t j t j  Xd  S(   NR3   (	   R   R    R	   R   R   R   R0   R   R
   (   R   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt
   test_mkdir  s
    
c         C   s    |  j  t t j t j d   d  S(   N(   R   R   R   R   R    R	   R   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt
   test_utime  s    c         C   s    |  j  t t j t j d  d  S(   Ni    (   R   R   R   t   chmodR    R	   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt
   test_chmod  s    (   R*   R+   R)   R  R  R  R  R!  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR  u  s   					t   TestInvalidFDc        	   B   sļ  e  Z d  d d d d d d d d g	 Z d	   Z x% e D] Z e e  e   d
 e <q7 Wd   Z e j e	 e
 d  d  d    Z e j e	 e
 d  d  d    Z e j e	 e
 d  d  d    Z e j e	 e
 d  d  d    Z e j e	 e
 d  d  d    Z e j e	 e
 d  d  d    Z e j e	 e
 d  d  d     Z e j e	 e
 d!  d"  d#    Z e j e	 e
 d$  d%  d&    Z e j e	 e
 d'  d(  d)    Z e j e	 e
 d*  d+  d,    Z RS(-   t   fchdirt   fdopenR   t	   fdatasynct   fstatt   fstatvfst   fsynct	   tcgetpgrpt   ttynamec            s     f d   } | S(   Nc            s,   t  t    r( |  j t t     n  d  S(   N(   RO   R   t   checkRb   (   R   (   R   (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   helper  s    (    (   R   R,  (    (   R   s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt
   get_single  s    t   test_c         G   sX   y | t  j   |  Wn) t k
 rB } |  j | j t j  n X|  j d |  d  S(   Ns5   %r didn't raise an OSError with a bad file descriptor(   R    t   make_bad_fdR   R&   Rz   t   EBADFRF   (   R   R   RE   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR+    s    	t   isattys   test needs os.isatty()c         C   s#   |  j  t j t j    t  d  S(   N(   R&   R   R1  R    R/  RĪ   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_isatty¤  s    R   s   test needs os.closerange()c         C   s   t  j   } x> t d  D]0 } y t j | |  Wn t k
 rG q XPq W| d k  rk t j d   n  |  j t j	 | | | d  d   d  S(   Ni
   i   s5   Unable to acquire a range of invalid file descriptorsi   (   R    R/  t   rangeR   R&  R   RM   t   SkipTestR&   R   R   (   R   t   fdt   i(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR    Ø  s     t   dup2s   test needs os.dup2()c         C   s   |  j  t j d  d  S(   Ni   (   R+  R   R7  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt	   test_dup2ø  s    t   fchmods   test needs os.fchmod()c         C   s   |  j  t j d  d  S(   Ni    (   R+  R   R9  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_fchmod¼  s    t   fchowns   test needs os.fchown()c         C   s   |  j  t j d d  d  S(   Ni’’’’(   R+  R   R;  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_fchownĄ  s    t	   fpathconfs   test needs os.fpathconf()c         C   s   |  j  t j d  d  S(   Nt   PC_NAME_MAX(   R+  R   R=  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_fpathconfÄ  s    t	   ftruncates   test needs os.ftruncate()c         C   s   |  j  t j d  d  S(   Ni    (   R+  R   R@  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_ftruncateČ  s    t   lseeks   test needs os.lseek()c         C   s   |  j  t j d d  d  S(   Ni    (   R+  R   RB  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt
   test_lseekĢ  s    RH   s   test needs os.read()c         C   s   |  j  t j d  d  S(   Ni   (   R+  R   RH   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt	   test_readŠ  s    t	   tcsetpgrps   test needs os.tcsetpgrp()c         C   s   |  j  t j d  d  S(   Ni    (   R+  R   RE  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_tcsetpgrptŌ  s    R   s   test needs os.write()c         C   s   |  j  t j d  d  S(   Nt    (   R+  R   R   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt
   test_writeŲ  s    (   R*   R+   t   singlesR-  R   t   localsR+  RM   RN   RO   R   R2  R    R8  R:  R<  R?  RA  RC  RD  RF  RH  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR"    s"   			$$$$$$$$$$s   Posix specific testst   PosixUidGidTestsc           B   s(  e  Z e j e e d   d  d    Z e j e e d  d  d    Z e j e e d  d  d    Z e j e e d	  d
  d    Z	 e j e e d  d  d    Z
 e j e e d  d  d    Z e j e e d  d  d    Z e j e e d  d  d    Z RS(   t   setuids   test needs os.setuid()c         C   s^   t  j   d k r. |  j t  j t  j d  n  |  j t t  j d  |  j t t  j d  d  S(   Ni    s
   not an inti   i    I       (   R   t   getuidR   t   errorRL  R$   t   OverflowError(   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_setuidŽ  s    t   setgids   test needs os.setgid()c         C   s^   t  j   d k r. |  j t  j t  j d  n  |  j t t  j d  |  j t t  j d  d  S(   Ni    s
   not an inti   i    I       (   R   RM  R   RN  RQ  R$   RO  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_setgidå  s    t   seteuids   test needs os.seteuid()c         C   s^   t  j   d k r. |  j t  j t  j d  n  |  j t t  j d  |  j t t  j d  d  S(   Ni    s
   not an inti   i    I       (   R   RM  R   RN  RS  R$   RO  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_seteuidģ  s    t   setegids   test needs os.setegid()c         C   s^   t  j   d k r. |  j t  j t  j d  n  |  j t t  j d  |  j t t  j d  d  S(   Ni    s
   not an inti   i    I       (   R   RM  R   RN  RU  R$   RO  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_setegidó  s    t   setreuids   test needs os.setreuid()c         C   s   t  j   d k r1 |  j t  j t  j d d  n  |  j t t  j d d  |  j t t  j d d  |  j t t  j d d  |  j t t  j d d  d  S(   Ni    s
   not an inti   i    I       I       (   R   RM  R   RN  RW  R$   RO  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_setreuidś  s    c         C   s   t  j t j d d g  d  S(   Ns   -cs,   import os,sys;os.setreuid(-1,-1);sys.exit(0)(   Rü   t
   check_callR"   Rū   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_setreuid_neg1  s    	t   setregids   test needs os.setregid()c         C   s   t  j   d k r1 |  j t  j t  j d d  n  |  j t t  j d d  |  j t t  j d d  |  j t t  j d d  |  j t t  j d d  d  S(   Ni    s
   not an inti   i    I       I       (   R   RM  R   RN  R[  R$   RO  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_setregid  s    c         C   s   t  j t j d d g  d  S(   Ns   -cs,   import os,sys;os.setregid(-1,-1);sys.exit(0)(   Rü   RY  R"   Rū   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_setregid_neg1  s    	(   R*   R+   RM   RN   RO   R   RP  RR  RT  RV  RX  RZ  R\  R]  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyRK  Ü  s   $$$$$	$$	t   Win32KillTestsc           B   sM   e  Z d    Z d   Z d   Z d   Z e j d  d    Z d   Z	 RS(   c         C   s  d d  l  } d d l  m } d d  l } | j j j } | j | _ | j | j	 | j
  | j | j	 | j  | j	 | j  | j	 | j  f | _ d } t j t j d d j |  g d t j d t j d t j } |  j | j j  |  j | j j  |  j | j j  d \ } }	 xÄ | |	 k  r×| j   d  k r×| j t |   }
 | | j | j j    |
 | j |
  d  d  d   } |  j | d	 d  |
 j  r½|  j! | |
 j   Pn  t" j# d  | d 7} q!W|  j$ d  t% j& | j' |  |  j! | j(   |  d  S(   Ni’’’’(   t   wintypest   runnings   -cs<   import sys;sys.stdout.write('{}');sys.stdout.flush();input()Rł   Rś   Rų   i    id   s   PeekNamedPipe failedg¹?i   s1   Did not receive communication from the subprocess(   i    id   ()   R   R_  t   msvcrtR   R   t   PeekNamedPipet   BOOLt   restypet   HANDLEt   POINTERt   c_chart   DWORDt   argtypesRü   Rż   R"   Rū   t   formatRž   t
   addCleanupRł   R   Rś   Rų   t   pollR   R   R   t   get_osfhandlet   filenot   sizeofRō   R   R&   t   timet   sleepRF   R   t   killt   pidR   (   R   t   sigR   R_  Ra  Rb  t   msgt   procR  t   maxR   t   rslt(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   _kill  sF    		!	c         C   s   |  j  t j  d  S(   N(   Ry  t   signalt   SIGTERM(   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_kill_sigtermU  s    c         C   s   |  j  d  d  S(   Nid   (   Ry  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_kill_intY  s    c         C   s6  d t  j   } t j d d |  } d | d <t j t j t j j	 t j j
 t  d  | g d t j } d \ } } xZ | | k  rÉ | j   d  k rÉ | d d	 k rÆ Pn  t j d
  | d 7} q} W|  j d  t j | j |  t j d
  | j   s2t j | j t j  |  j d j |   n  d  S(   Ns
   test_os_%si’’’’i   t   0i    s   win_console_handler.pyt   creationflagsi   t   1g      ą?s'   Subprocess didn't finish initializations   subprocess did not stop on {}(   i    i   (   t   uuidt   uuid1t   mmapRü   Rż   R"   Rū   R   R   RT   Rą   t   __file__t   CREATE_NEW_PROCESS_GROUPRl  R   Rp  Rq  RF   Rr  Rs  Rz  t   SIGINTRj  (   R   t   eventR2   t   tagnamet   mRv  R  Rw  (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   _kill_with_event]  s&    
!s.   subprocesses aren't inheriting Ctrl+C propertyc         C   s   d d l  m } d d  l  } | j | j    } | j j j } | j | j  | j f | _ | j | _	 | | d  |  j
 t j d  d  S(   Ni’’’’(   R_  i    t   CTRL_C_EVENT(   R   R_  Rf  t   c_intR   R   t   SetConsoleCtrlHandlerRc  Ri  Rd  R  Rz  R  (   R   R_  R   t   NULLR  (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_CTRL_C_EVENTx  s    c         C   s   |  j  t j d  d  S(   Nt   CTRL_BREAK_EVENT(   R  Rz  R  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_CTRL_BREAK_EVENT  s    (
   R*   R+   Ry  R|  R}  R  RM   t   skipR  R  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR^    s   	6			t   Win32ListdirTestsc           B   s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   s   Test listdir on Windows.c         C   sĮ   g  |  _  x¤ t d  D] } d | } t j j t j |  } d | } t j j t j |  } t j |  t | d   } | j	 d |  Wd  QX|  j  j
 | | g  q W|  j  j   d  S(   Ni   s   SUB%ds   FILE%dR3   s'   I'm %s and proud of it. Blame test_os.
(   t   created_pathsR3  R   R   RT   t   supportR	   RÉ   R   R   t   extendRĶ   (   R   R6  t   dir_namet   dir_patht	   file_namet	   file_pathR   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR     s    	

c         C   s   t  j t j  d  S(   N(   t   shutilt   rmtreeR  R	   (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR,      s    c         C   s   t  j   } |  j t t j t j j |    g  |  j	 D] } | j |  ^ q:  |  j t t j t j
 t j    |  j	  d S(   s-   Test when the path is not an "extended" path.N(   R"   t   getfilesystemencodingR&   t   sortedR   t   listdirR  R	   t   decodeR  t   fsencode(   R   t   fs_encodingR   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_listdir_no_extended_path£  s    &c         C   s«   t  j   } d t j j t j j |   } |  j t	 t j
 |   g  |  j D] } | j |  ^ qP  d t j j t j  } |  j t	 t j
 |   |  j  d S(   s&   Test when the path starts with '\\?\'.u   \\?\s   \\?\N(   R"   R  R   R   R   R  R	   R   R&   R  R  R  (   R   R¢  R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_listdir_extended_path°  s    "&(   R*   R+   R¶   R   R,   R£  R¤  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR    s
   			t
   SpawnTestsc           B   sY   e  Z d    Z e j e e d  d  d    Z e j e e d  d  d    Z RS(   c         C   sĀ  t  j d d g } t j j   } d | d <y  | t j | d | |  } Wn t k
 r^ n X|  j | d  t j j   } d | d <y  | t j | d | |  } Wn t k
 r» n X|  j | d  t j j   } d	 | d
 <y  | t j | d | |  } Wn t k
 rn X|  j | d  t	 j
 } |  j t	 j |  t | d   } | j d  Wd  QXt  j | g } t j j   } d | d <| t j | d | |  } |  j | d  d  S(   Ns   -cR  R  s   FRUIT VEGETABLEi    i   s   orange VEGETABLE=cabbageR  R  s   FRUIT=ORANGER3   sP   import sys, os
if os.getenv("FRUIT") != "orange=lemon":
    raise AssertionErrors   orange=lemon(   R"   Rū   R   R„   R  t   P_WAITR$   R&   R²   R    R	   Rk  R
   R   R   (   R   t   spawnRE   R  t   exitcodet   filenameRI   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   _test_invalid_envĀ  s>    
 
 
 	
t   spawnves   test needs os.spawnve()c         C   s   |  j  t j  d  S(   N(   RŖ  R   R«  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_spawnve_invalid_envš  s    t   spawnvpes   test needs os.spawnvpe()c         C   s   |  j  t j  d  S(   N(   RŖ  R   R­  (   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   test_spawnvpe_invalid_envō  s    (	   R*   R+   RŖ  RM   RN   RO   R   R¬  R®  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyR„  Į  s   	.$c           C   s;   t  j t t t t t t t t	 t
 t t t t t t  d  S(   N(   R    t   run_unittestR   R.   RP   R   Rŗ   Rį   Rģ   Rń   R  R  R  R"  RK  R^  R„  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt	   test_mainł  s     t   __main__(/   R   Rz   RM   R8   R"   Rz  Rü   t	   sysconfigt   textwrapRp  R  t   ImportErrorR   t   testR    t   test.script_helperR   R  R  R:   R;   R*   t   TestCaseR   R.   RP   R   t   BasicTestMappingProtocolR   Rŗ   Rį   Rģ   Rń   t   get_config_varR
  Rø   R  R  RN   RB   R  R"  RK  R^  R  R„  R°  (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_os.pyt   <module>   s\   
)q£%l!	&		N@q18	