ó
‹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 m Z d e j f d „  ƒ  YZ d „  Z	 e
 d k r„ e	 ƒ  n  d S(   iÿÿÿÿN(   t   supportt   PlatformTestc           B   s  e  Z d  „  Z e e d ƒ r* d „  Z n  d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z e j e j j d ƒ d ƒ d „  ƒ Z d „  Z d „  Z d „  Z e j e j d k d ƒ d „  ƒ Z d „  Z d „  Z d „  Z RS(   c         C   s   t  j ƒ  } d  S(   N(   t   platformt   architecture(   t   selft   res(    (    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_platform.pyt   test_architecture
   s    t   symlinkc         C   sx   d „  } t  j j t j ƒ } t  j j t j ƒ } t  j | | ƒ z  |  j	 | | ƒ | | ƒ ƒ Wd  t  j
 | ƒ Xd  S(   Nc         S   s1   |  d d g } t  j | d t  j ƒ} | j ƒ  S(   Ns   -cs.   import platform; print platform.architecture()t   stdout(   t
   subprocesst   Popent   PIPEt   communicate(   t   pythont   cmdt   p(    (    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_platform.pyt   get   s    	(   t   ost   patht   realpatht   syst
   executablet   abspathR    t   TESTFNR   t   assertEqualt   remove(   R   R   t   realt   link(    (    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_platform.pyt   test_architecture_via_symlink   s    	 c         C   sD   x= t  t f D]/ } x& t  t f D] } t j | | ƒ } q  Wq Wd  S(   N(   t   Falset   TrueR   (   R   t   aliasedt   terseR   (    (    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_platform.pyt   test_platform   s    c         C   s   t  j ƒ  } d  S(   N(   R   t   system(   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_platform.pyt   test_system!   s    c         C   s   t  j ƒ  } d  S(   N(   R   t   node(   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_platform.pyt	   test_node$   s    c         C   s   t  j ƒ  } d  S(   N(   R   t   release(   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_platform.pyt   test_release'   s    c         C   s   t  j ƒ  } d  S(   N(   R   t   version(   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_platform.pyt   test_version*   s    c         C   s   t  j ƒ  } d  S(   N(   R   t   machine(   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_platform.pyt   test_machine-   s    c         C   s   t  j ƒ  } d  S(   N(   R   t	   processor(   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_platform.pyt   test_processor0   s    c         C   s(   t  j |  _ t  j |  _ t  j |  _ d  S(   N(   R   R(   t   save_versiont
   subversiont   save_subversionR   t   save_platform(   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_platform.pyt   setUp3   s    c         C   s(   |  j  t _ |  j t _ |  j t _ d  S(   N(   R.   R   R(   R0   R/   R1   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_platform.pyt   tearDown8   s    c         C   s—  xÀ d d> f d d? f d d@ f d dA f d dB f d dC f d dD f d dE f d dF f d dG f d dH f f D]U \ } } t  j | ƒ \ } } } } } } }	 |  j | | d d | | |	 f | ƒ qj Wi d d d d dI d  f d! dJ |  j f 6d	 d" d d dK d# f dL 6d	 d d d dM d& f dN 6d	 d( d d dO d) f dP 6d+ d, d- d. dQ d1 f d2 dR d1 f 6d3 d4 d- d5 dS d f d6 dT |  j f 6}
 x|
 j ƒ  D]\ \ } } } } | t _ | d  k rÒt t d7 ƒ rÛt `	 qÛn	 | t _	 | d  k	 ró| t _  n  |  j t  j
 ƒ  | d8 ƒ |  j t  j ƒ  | d9 ƒ |  j t  j ƒ  | d: ƒ |  j t  j ƒ  | d; ƒ |  j t  j ƒ  | d< ƒ |  j t  j ƒ  | d= ƒ q�Wd  S(U   NsC   2.4.3 (#1, Jun 21 2006, 13:54:21) 
[GCC 3.3.4 (pre 3.3.5 20040809)]t   CPythons   2.4.3t    t   1s   Jun 21 2006 13:54:21s   GCC 3.3.4 (pre 3.3.5 20040809)s)   IronPython 1.0.60816 on .NET 2.0.50727.42t
   IronPythons	   1.0.60816s   .NET 2.0.50727.42s4   IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42s   1.0.0s"   2.4.3 (truncation, date, t) 
[GCC]t
   truncations   date tt   GCCs!   2.4.3 (truncation, date, ) 
[GCC]t   dates    2.4.3 (truncation, date,) 
[GCC]s   2.4.3 (truncation, date) 
[GCC]s   2.4.3 (truncation, d) 
[GCC]t   ds   2.4.3 (truncation, ) 
[GCC]s   2.4.3 (truncation,) 
[GCC]s   2.4.3 (truncation) 
[GCC]s   2.6.1s	   tags/r261t   67515s
   r261:67515s   Dec  6 2008 15:26:00s+   GCC 4.0.1 (Apple Computer, Inc. build 5370)sX   2.6.1 (r261:67515, Dec  6 2008, 15:26:00) 
[GCC 4.0.1 (Apple Computer, Inc. build 5370)]s   2.0.0s   .NET 2.0.50727.3053s/   IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053t   clis   .NET 2.0.50727.1433s=   2.6.1 (IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433)s   2.7.4s   Mono 4.0.30319.1 (32-bit)s@   2.7.4 (IronPython 2.7.4 (2.7.0.40) on Mono 4.0.30319.1 (32-bit))t   Jythons   2.5.0t   trunkt   6107s
   trunk:6107s   Mar 26 2009s   java1.5.0_16s^   2.5 (trunk:6107, Mar 26 2009, 13:02:18) 
[Java HotSpot(TM) Client VM ("Apple Computer, Inc.")]t   PyPys   2.5.2t   63378s1   2.5.2 (63378, Mar 26 2009, 18:03:29)
[PyPy 1.0.0]R/   i    i   i   i   i   i   (   R4   s   2.4.3R5   R5   R6   s   Jun 21 2006 13:54:21s   GCC 3.3.4 (pre 3.3.5 20040809)(   R7   s	   1.0.60816R5   R5   R5   R5   s   .NET 2.0.50727.42(   R7   s   1.0.0R5   R5   R5   R5   s   .NET 2.0.50727.42(   R4   s   2.4.3R5   R5   R8   s   date tR9   (   R4   s   2.4.3R5   R5   R8   R:   R9   (   R4   s   2.4.3R5   R5   R8   R:   R9   (   R4   s   2.4.3R5   R5   R8   R:   R9   (   R4   s   2.4.3R5   R5   R8   R;   R9   (   R4   s   2.4.3R5   R5   R8   R5   R9   (   R4   s   2.4.3R5   R5   R8   R5   R9   (   R4   s   2.4.3R5   R5   R8   R5   R9   (   s
   r261:67515s   Dec  6 2008 15:26:00(   R4   s	   tags/r261R<   (   R5   R5   (   s/   IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053NR=   (   R5   R5   (   s=   2.6.1 (IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.1433)NR=   (   R5   R5   (   s@   2.7.4 (IronPython 2.7.4 (2.7.0.40) on Mono 4.0.30319.1 (32-bit))NR=   (   s
   trunk:6107s   Mar 26 2009(   R>   R?   R@   (   RB   s   Mar 26 2009(   RA   R?   RB   (   R   t   _sys_versionR   R1   t   Nonet	   iteritemsR   R(   t   hasattrR/   t   python_implementationt   python_versiont   python_brancht   python_revisiont   python_buildt   python_compiler(   R   t   inputt   outputt   nameR(   t   brancht   revisiont   buildnot	   builddatet   compilert   sys_versionst   version_tagR/   t   sys_platformt   info(    (    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_platform.pyt   test_sys_version=   sn    $#


		c         C   s+   t  j t  j ƒ  t  j ƒ  t  j ƒ  ƒ } d  S(   N(   R   t   system_aliasR"   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_platform.pyt   test_system_alias”   s    		c         C   s#   t  j ƒ  } |  j t | ƒ ƒ d  S(   N(   R   t   unamet
   assertTruet   any(   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_platform.pyt
   test_uname›   s    t   wins   windows only testc      
   C   sÂ   z± t  j ƒ  �Ÿ } d | k r( | d =n  d | d <d  t _ t j ƒ  \ } } } } } } |  j | d ƒ d | d <d  t _ t j ƒ  \ } } } } } } |  j | d ƒ Wd  QXWd  d  t _ Xd  S(   Nt   PROCESSOR_ARCHITEW6432t   foot   PROCESSOR_ARCHITECTUREt   bar(   R    t   EnvironmentVarGuardRD   R   t   _uname_cacheR\   R   (   R   t   environR"   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_platform.pyt   test_uname_win32_ARCHITEW6432Ÿ   s    

	
	c         C   s5   t  j ƒ  } t j  d k r1 |  j t | ƒ ƒ n  d  S(   Nt   java(   R   t   java_verR   R]   t   all(   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_platform.pyt   test_java_ver´   s    c         C   s   t  j ƒ  } d  S(   N(   R   t	   win32_ver(   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_platform.pyt   test_win32_ver¹   s    c   
      C   s‡  t  j ƒ  } y d d  l } Wn t k
 r5 t } n Xt } | rƒt  j ƒ  d d k rƒt j d d ƒ } d  } x7 | D]/ } | j
 d ƒ rw | j ƒ  j ƒ  d } Pqw qw W| j ƒ  |  j | d  k ƒ | d j d ƒ } | j d ƒ } t | ƒ t | ƒ }	 |	 d k r"| j d g |	 ƒ n  |  j | | ƒ |  j | d	 d ƒ t j d k rl|  j | d d ƒ qƒ|  j | d d ƒ n  d  S(   Niÿÿÿÿi    t   Darwint   sw_verst   rs   ProductVersion:t   .t   0i   R5   t   littlei   t   i386t   x86_64t   PowerPC(   R5   R5   R5   (   Ru   Rv   (   R   t   mac_vert   gestaltt   ImportErrorR   R   R\   R   t   popenRD   t
   startswitht   stript   splitt   closet   assertFalset   lent   extendR   R   t	   byteordert   assertIn(
   R   R   Ry   t   have_toolbox_gluet   fdt   real_vert   lnt   result_listt   expect_listt   len_diff(    (    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_platform.pyt   test_mac_ver¼   s2    

t   darwins   OSX only testc         C   sp   t  j ƒ  } | d k r4 t j ƒ  } t  j d ƒ n8 t  j | d ƒ \ } } |  j | | ƒ |  j | d ƒ d  S(   Ni    (   R   t   forkR   Rx   t   _exitt   waitpidR   (   R   t   pidRX   t   cpidt   sts(    (    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_platform.pyt   test_mac_ver_with_forkä   s    c         C   s   t  j ƒ  } d  S(   N(   R   t   dist(   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_platform.pyt	   test_distö   s    c         C   sÅ   t  j j t j ƒ r> t  j j t j d ƒ r> t j d } n	 t j } t j | ƒ } |  j t	 j
 t	 j ƒ t t	 j d ƒ �% } | j d d	 ƒ | j d ƒ Wd  QX|  j t j t	 j ƒ d
 ƒ d  S(   Ns   .exet   wbt   xi @  i
   s"   GLIBC_1.23.4 GLIBC_1.9 GLIBC_1.21 t   glibcs   1.23.4iö?  (   R™   s   1.23.4(   R   R   t   isdirR   R   t   existsR   t   libc_vert
   addCleanupR    t   unlinkR   t   opent   writeR   (   R   R   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_platform.pyt   test_libc_verù   s    	c         C   sŽ   x‡ d d! f d d" f d	 d# f d d$ f d d% f d d& f d d' f d d( f d d) f d  d* f f
 D]% \ } } |  j t j | ƒ | ƒ qa Wd  S(+   Ns   SuSE Linux 9.3 (x86-64)s   SuSE Linux s   9.3s   x86-64s   SUSE LINUX 10.1 (X86-64)s   SUSE LINUX s   10.1s   X86-64s   SUSE LINUX 10.1 (i586)t   i586s    Fedora Core release 5 (Bordeaux)s   Fedora Coret   5t   Bordeauxs"   Red Hat Linux release 8.0 (Psyche)s   Red Hat Linuxs   8.0t   Psyches    Red Hat Linux release 9 (Shrike)t   9t   Shrikes+   Red Hat Enterprise Linux release 4 (Nahant)s   Red Hat Enterprise Linuxt   4t   Nahants   CentOS release 4t   CentOSs   Rocks release 4.2.1 (Cydonia)t   Rockss   4.2.1t   CydoniaR5   (   s   SuSE Linux s   9.3s   x86-64(   s   SUSE LINUX s   10.1s   X86-64(   s   SUSE LINUX s   10.1R£   (   s   Fedora CoreR¤   R¥   (   s   Red Hat Linuxs   8.0R¦   (   s   Red Hat LinuxR§   R¨   (   s   Red Hat Enterprise LinuxR©   Rª   (   R«   R©   N(   R¬   s   4.2.1R­   (   R5   R5   R5   (   RD   R   R   t   _parse_release_file(   R   RM   RN   (    (    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_platform.pyt   test_parse_release_file	  s    									(   t   __name__t
   __module__R   RF   R   R   R!   R#   R%   R'   R)   R+   R-   R2   R3   RY   R[   R_   t   unittestt
   skipUnlessR   R   R|   Rh   Rl   Rn   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_platform.pyR   	   s.   											W		'			($		c           C   s   t  j t ƒ d  S(   N(   R    t   run_unittestR   (    (    (    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_platform.pyt	   test_main  s    t   __main__(   R   R   R²   R   R	   t   testR    t   TestCaseR   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_platform.pyt   <module>   s   ÿ 	