<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sssd.git/src/tests/intg, branch certificate_mapping</title>
<subtitle>Unnamed repository; edit this file to name it for gitweb.</subtitle>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/'/>
<entry>
<title>intg: Return list for enumeration functions</title>
<updated>2017-01-16T18:12:04+00:00</updated>
<author>
<name>Lukas Slebodnik</name>
<email>lslebodn@redhat.com</email>
</author>
<published>2017-01-12T16:06:40+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/commit/?id=554734a2073eaf1e862bfc08b1e9761931455454'/>
<id>554734a2073eaf1e862bfc08b1e9761931455454</id>
<content type='text'>
The documentation of get_passwd_list/get_group_list
says that they return group/user database entry list.
However, ther return class 'map' with python3 due to
changes in high level function "map".

Traceback (most recent call last):
  File "/dev/shm/sssd/src/tests/intg/ent_test.py",
       line 141, in test_assert_passwd_list
    ent.assert_passwd_list(ent.contains())
  File "/dev/shm/sssd/src/tests/intg/ent.py",
       line 243, in assert_passwd_list
    assert not d, d
AssertionError: not a list, &lt;class 'map'&gt;

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The documentation of get_passwd_list/get_group_list
says that they return group/user database entry list.
However, ther return class 'map' with python3 due to
changes in high level function "map".

Traceback (most recent call last):
  File "/dev/shm/sssd/src/tests/intg/ent_test.py",
       line 141, in test_assert_passwd_list
    ent.assert_passwd_list(ent.contains())
  File "/dev/shm/sssd/src/tests/intg/ent.py",
       line 243, in assert_passwd_list
    assert not d, d
AssertionError: not a list, &lt;class 'map'&gt;

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intg: Convert output of executed commands to strings</title>
<updated>2017-01-16T18:12:00+00:00</updated>
<author>
<name>Lukas Slebodnik</name>
<email>lslebodn@redhat.com</email>
</author>
<published>2017-01-12T15:21:20+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/commit/?id=69f6b919be962b8be78320ffab8607b8d9a0e4c6'/>
<id>69f6b919be962b8be78320ffab8607b8d9a0e4c6</id>
<content type='text'>
We know that all our tested utilities (sssctl, sss_cache, sss_override)
returns strings and not binary data. We can safely encode output to
string (unicode) in python3

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We know that all our tested utilities (sssctl, sss_cache, sss_override)
returns strings and not binary data. We can safely encode output to
string (unicode) in python3

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intg: Return strings from ctypes wrappers</title>
<updated>2017-01-16T18:11:56+00:00</updated>
<author>
<name>Lukas Slebodnik</name>
<email>lslebodn@redhat.com</email>
</author>
<published>2017-01-12T15:04:22+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/commit/?id=fd2dfed53be8e3a0b63a1b268be34c2dc11ce837'/>
<id>fd2dfed53be8e3a0b63a1b268be34c2dc11ce837</id>
<content type='text'>
Python module ctypes directly uses C functions from libraries.
C functions usually returns "char *" when string is expected.
But python3 uses unicode for string. Encoding returned bytes
("char *") to unicode strings simplify tests in python3

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Python module ctypes directly uses C functions from libraries.
C functions usually returns "char *" when string is expected.
But python3 uses unicode for string. Encoding returned bytes
("char *") to unicode strings simplify tests in python3

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intg: Use bytes as input in ctypes</title>
<updated>2017-01-16T18:11:52+00:00</updated>
<author>
<name>Lukas Slebodnik</name>
<email>lslebodn@redhat.com</email>
</author>
<published>2017-01-12T15:00:46+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/commit/?id=19398379a221a11755c77bb157864dfa9f465488'/>
<id>19398379a221a11755c77bb157864dfa9f465488</id>
<content type='text'>
Python module ctypes directly uses C functions
and C functions expect "char *" as a string and not pointer
to wide characters "wchar *".

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Python module ctypes directly uses C functions
and C functions expect "char *" as a string and not pointer
to wide characters "wchar *".

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intg: Use bytes for value of attributes in ldif</title>
<updated>2017-01-16T18:11:47+00:00</updated>
<author>
<name>Lukas Slebodnik</name>
<email>lslebodn@redhat.com</email>
</author>
<published>2017-01-12T13:01:52+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/commit/?id=1097a61a8d4a892e126d14631c1b80fc1a5ce976'/>
<id>1097a61a8d4a892e126d14631c1b80fc1a5ce976</id>
<content type='text'>
Python3 version of ldap module require string for name of attribute
but bytes for value of attribute. It was not a problem in python2
due to unicode changes in python3

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Python3 version of ldap module require string for name of attribute
but bytes for value of attribute. It was not a problem in python2
due to unicode changes in python3

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intg: Fix creating of slapd configuration</title>
<updated>2017-01-16T18:11:43+00:00</updated>
<author>
<name>Lukas Slebodnik</name>
<email>lslebodn@redhat.com</email>
</author>
<published>2016-12-21T18:30:57+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/commit/?id=73c9e3d710434857b5e13d5ccfc1f1245b1d2997'/>
<id>73c9e3d710434857b5e13d5ccfc1f1245b1d2997</id>
<content type='text'>
The python module subprocess expect bytes as an input.

Traceback (most recent call last):
  File "src/tests/intg/test_ldap.py", line 51, in ds_inst
    ds_inst.setup()
  File "src/tests/intg/ds_openldap.py", line 201, in setup
    self._setup_config()
  File "src/tests/intg/ds_openldap.py", line 169, in _setup_config
    slapadd.communicate(config)
  File "/usr/lib64/python3.6/subprocess.py", line 821, in communicate
    self._stdin_write(input)
  File "/usr/lib64/python3.6/subprocess.py", line 776, in _stdin_write
    self.stdin.write(input)
TypeError: a bytes-like object is required, not 'str'

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The python module subprocess expect bytes as an input.

Traceback (most recent call last):
  File "src/tests/intg/test_ldap.py", line 51, in ds_inst
    ds_inst.setup()
  File "src/tests/intg/ds_openldap.py", line 201, in setup
    self._setup_config()
  File "src/tests/intg/ds_openldap.py", line 169, in _setup_config
    slapadd.communicate(config)
  File "/usr/lib64/python3.6/subprocess.py", line 821, in communicate
    self._stdin_write(input)
  File "/usr/lib64/python3.6/subprocess.py", line 776, in _stdin_write
    self.stdin.write(input)
TypeError: a bytes-like object is required, not 'str'

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intg: Use bytes with hash function</title>
<updated>2017-01-16T18:11:40+00:00</updated>
<author>
<name>Lukas Slebodnik</name>
<email>lslebodn@redhat.com</email>
</author>
<published>2016-12-21T18:29:20+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/commit/?id=e1711a2b2cb904f7edc26cc68566e064896d4f8a'/>
<id>e1711a2b2cb904f7edc26cc68566e064896d4f8a</id>
<content type='text'>
Python3 expects bytes as an input for hash function.
We need to convert string to bytes before hashing

Traceback (most recent call last):
  File "src/tests/intg/test_ldap.py", line 51, in ds_inst
    ds_inst.setup()
  File "src/tests/intg/ds_openldap.py", line 200, in setup
    self._setup_config()
  File "src/tests/intg/ds_openldap.py", line 76, in _setup_config
    admin_pw_hash = hash_password(self.admin_pw)
  File "src/tests/intg/ds_openldap.py", line 41, in hash_password
    hash = hashlib.sha1(password)
TypeError: Unicode-objects must be encoded before hashing

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Python3 expects bytes as an input for hash function.
We need to convert string to bytes before hashing

Traceback (most recent call last):
  File "src/tests/intg/test_ldap.py", line 51, in ds_inst
    ds_inst.setup()
  File "src/tests/intg/ds_openldap.py", line 200, in setup
    self._setup_config()
  File "src/tests/intg/ds_openldap.py", line 76, in _setup_config
    admin_pw_hash = hash_password(self.admin_pw)
  File "src/tests/intg/ds_openldap.py", line 41, in hash_password
    hash = hashlib.sha1(password)
TypeError: Unicode-objects must be encoded before hashing

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intg: Avoid using iteritems for dictionary</title>
<updated>2017-01-16T18:11:33+00:00</updated>
<author>
<name>Lukas Slebodnik</name>
<email>lslebodn@redhat.com</email>
</author>
<published>2017-01-12T13:09:40+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/commit/?id=00fc94cbeede07693a07d6f860c47cb5f4961218'/>
<id>00fc94cbeede07693a07d6f860c47cb5f4961218</id>
<content type='text'>
Originally, Python items() built a real list of tuples and returned that.
That could potentially take a lot of extra memory. Python iteritems()
returned an iterator-generator. The original remains for backwards
compatibility.

One of Python 3’s changes is that items() now return iterators,
and a list is never fully built. The iteritems() method is also gone,
since items() in Python 3 works like viewitems() in Python2.

But we do not have a lot of values in dictionary; so it does not worth
to optimize returned list from "items()" on Python2

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Originally, Python items() built a real list of tuples and returned that.
That could potentially take a lot of extra memory. Python iteritems()
returned an iterator-generator. The original remains for backwards
compatibility.

One of Python 3’s changes is that items() now return iterators,
and a list is never fully built. The iteritems() method is also gone,
since items() in Python 3 works like viewitems() in Python2.

But we do not have a lot of values in dictionary; so it does not worth
to optimize returned list from "items()" on Python2

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intg: Avoid using xrange in tests</title>
<updated>2017-01-16T18:11:28+00:00</updated>
<author>
<name>Lukas Slebodnik</name>
<email>lslebodn@redhat.com</email>
</author>
<published>2017-01-12T13:29:17+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/commit/?id=1fef02f87429597e82965a9870e4597e0fadf212'/>
<id>1fef02f87429597e82965a9870e4597e0fadf212</id>
<content type='text'>
In Python 2 range() returns a list, and xrange() returns an object that
will only generate the items in the range when needed, saving memory.

In Python 3, the range() function is gone, and xrange() has been renamed
range().

We do not strictly require list or iterator in code therefore we can use
range which is in poth version. And we do not use big ranges there
so the memory overhead with list on python2 is not big.

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In Python 2 range() returns a list, and xrange() returns an object that
will only generate the items in the range when needed, saving memory.

In Python 3, the range() function is gone, and xrange() has been renamed
range().

We do not strictly require list or iterator in code therefore we can use
range which is in poth version. And we do not use big ranges there
so the memory overhead with list on python2 is not big.

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>intg: Fix python2,3 urllib</title>
<updated>2017-01-16T18:11:24+00:00</updated>
<author>
<name>Lukas Slebodnik</name>
<email>lslebodn@redhat.com</email>
</author>
<published>2016-12-21T18:21:14+00:00</published>
<link rel='alternate' type='text/html' href='https://fedorapeople.org/cgit/sbose/public_git/sssd.git/commit/?id=c46dec3dfad9e83321cc9d3185d93f0e8c38f57e'/>
<id>c46dec3dfad9e83321cc9d3185d93f0e8c38f57e</id>
<content type='text'>
The three modules urllib, urllib2 and urlparse has been reorganized
into three new modules, urllib.request, urllib.parse and urllib.error.
And urllib.quote was moved into urllib.parse.

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The three modules urllib, urllib2 and urlparse has been reorganized
into three new modules, urllib.request, urllib.parse and urllib.error.
And urllib.quote was moved into urllib.parse.

Reviewed-by: Martin Basti &lt;mbasti@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
