ó
wŰjc           @   s    d  d l  Z  d  d l Z d  d l m Z e j d  Z e j e e  d  o[ e  j   d k d  d e j	 f d     Y Z
 d	   Z e d
 k r e   n  d S(   i˙˙˙˙N(   t   test_supportt   spwdt   geteuidi    s   root privileges requiredt   TestSpwdRootc           B   s   e  Z d    Z d   Z RS(   c         C   sD   t  j   } |  j | t  x! | D] } |  j | t  j  q# Wd  S(   N(   R   t   getspallt   assertIsInstancet   listt   struct_spwd(   t   selft   entriest   entry(    (    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_spwd.pyt   test_getspall   s    c         C   s  t  j   } | s" |  j d  n  | d j } t  j |  } |  j | t  j  |  j | j |  |  j | j | d  |  j | j t	  |  j | j | d  |  j | j
 t  |  j | j
 | d  |  j | j t  |  j | j | d  |  j | j t  |  j | j | d  |  j | j t  |  j | j | d  |  j | j t  |  j | j | d  |  j | j t  |  j | j | d	  |  j | j t  |  j | j | d
  |  j t   } t  j d  Wd  QX|  j t	 | j  d  |  j t t  j  |  j t t  j d  |  j t t  j | d  t j ry t |  } Wn t k
 rwqX|  j t  j |  |  n  d  S(   Ns   empty shadow password databasei    i   i   i   i   i   i   i   i   s   invalid user names   'getspnam(): name not found'(   R   R   t   skipTestt   sp_namt   getspnamR   R   t   assertEqualt   sp_pwdt   strt	   sp_lstchgt   intt   sp_mint   sp_maxt   sp_warnt   sp_inactt	   sp_expiret   sp_flagt   assertRaisest   KeyErrort	   exceptiont	   TypeErrorR    t   have_unicodet   unicodet   UnicodeDecodeError(   R   R	   t   random_nameR
   t   cxt   unicode_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_spwd.pyt   test_getspnam   sH    	(   t   __name__t
   __module__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_spwd.pyR      s   	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_spwd.pyt	   test_main:   s    t   __main__(   t   ost   unittestt   testR    t   import_moduleR   t
   skipUnlesst   hasattrR   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_spwd.pyt   <module>   s   $	0	