Skip to content

Instantly share code, notes, and snippets.

@rhoerbe
Created December 30, 2018 10:04
Show Gist options
  • Save rhoerbe/3796e4a03cbe962a8b4e67847c639a28 to your computer and use it in GitHub Desktop.
Save rhoerbe/3796e4a03cbe962a8b4e67847c639a28 to your computer and use it in GitHub Desktop.
Jenkins log
Checking out git https://github.com/rhoerbe/d-openldap-django into /var/lib/jenkins/workspace/ldap/openldap-django@script to read Jenkinsfile
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/rhoerbe/d-openldap-django # timeout=10
Fetching upstream changes from https://github.com/rhoerbe/d-openldap-django
> git --version # timeout=10
using GIT_ASKPASS to set credentials
> git fetch --tags --progress https://github.com/rhoerbe/d-openldap-django +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 0d636b70c78bd8497cc26cf16c94e5919a3f58c4 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 0d636b70c78bd8497cc26cf16c94e5919a3f58c4
Commit message: "restructure project; add pytest"
> git rev-list --no-walk a06b75ca100715bba5f91ebe0a1d7cfc50e8ffb6 # timeout=10
Running in Durability level: PERFORMANCE_OPTIMIZED
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/workspace/ldap/openldap-django
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/rhoerbe/d-openldap-django # timeout=10
Fetching upstream changes from https://github.com/rhoerbe/d-openldap-django
> git --version # timeout=10
using GIT_ASKPASS to set credentials
> git fetch --tags --progress https://github.com/rhoerbe/d-openldap-django +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 0d636b70c78bd8497cc26cf16c94e5919a3f58c4 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 0d636b70c78bd8497cc26cf16c94e5919a3f58c4
Commit message: "restructure project; add pytest"
[Pipeline] }
[Pipeline] // stage
[Pipeline] withEnv
[Pipeline] {
[Pipeline] withEnv
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Config )
[Pipeline] sh
image: local/openldap_django
container_name: openldap_django
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Cleanup )
[Pipeline] sh
.
.
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build)
[Pipeline] sh
Building openldap_django
Step 1/14 : FROM centos:7
---> 1e1148e4cc2c
Step 2/14 : RUN yum -y update && yum -y install curl iproute lsof net-tools && yum -y install https://centos7.iuscommunity.org/ius-release.rpm && yum -y install openldap openldap-servers openldap-clients && yum -y install gcc python36u-devel python36u-pip openldap-devel && pip3.6 install --upgrade pip && yum clean all
---> Using cache
---> 23344bb197e1
Step 3/14 : COPY install/etc/openldap/*.conf /etc/openldap/
---> Using cache
---> 2b375da9500e
Step 4/14 : COPY install/etc/openldap/schema/* /etc/openldap/schema/
---> Using cache
---> b2ef51f3b29f
Step 5/14 : COPY install/etc/openldap/DB_CONFIG /var/db/
---> Using cache
---> da4c76cbedad
Step 6/14 : COPY install/bin/* /opt/bin/
---> Using cache
---> 51e5d5d0e3df
Step 7/14 : COPY tests /tests
---> 92c4b4bf4cd3
Removing intermediate container f37c527eb4cc
Step 8/14 : RUN chmod -R +x /opt/bin/* /tests/* && chown -R ldap:ldap /etc/openldap /var/db && chmod 600 $(find /var/db -type f) && chmod 700 $(find /var/db -type d)
---> Running in 78bf2953fc80
 ---> 77e575b11477
Removing intermediate container 78bf2953fc80
Step 9/14 : VOLUME /etc/openldap/ /var/db/
---> Running in b3fb7b45813c
---> 6036819f6365
Removing intermediate container b3fb7b45813c
Step 10/14 : COPY manage.py requirements.txt /opt/djangoldap/
---> 6995d0c25d7d
Removing intermediate container 0966eaa727df
Step 11/14 : COPY djangoldap /opt/djangoldap/djangoldap
---> 7464b3aa82d8
Removing intermediate container 626eea47636f
Step 12/14 : RUN pip3.6 install virtualenv && mkdir -p /opt/venv && virtualenv --python=/usr/bin/python3.6 /opt/venv/djangoldap && source /opt/venv/djangoldap/bin/activate && pip install ldap3 && pip install -r /opt/djangoldap/requirements.txt
---> Running in b73e5f22ff82
Collecting virtualenv
Downloading https://files.pythonhosted.org/packages/7c/17/9b7b6cddfd255388b58c61e25b091047f6814183e1d63741c8df8dcd65a2/virtualenv-16.1.0-py2.py3-none-any.whl (1.9MB)
Installing collected packages: virtualenv
Successfully installed virtualenv-16.1.0
Already using interpreter /usr/bin/python3.6
Using base prefix '/usr'
New python executable in /opt/venv/djangoldap/bin/python3.6
Also creating executable in /opt/venv/djangoldap/bin/python
Installing setuptools, pip, wheel...
done.
Collecting ldap3
Downloading https://files.pythonhosted.org/packages/54/93/55d4de43abf3af1b60befa648811538b49701237e5cbda456608384b25ac/ldap3-2.5.2-py2.py3-none-any.whl (393kB)
Collecting pyasn1>=0.1.8 (from ldap3)
Downloading https://files.pythonhosted.org/packages/7b/7c/c9386b82a25115cccf1903441bba3cbadcfae7b678a20167347fa8ded34c/pyasn1-0.4.5-py2.py3-none-any.whl (73kB)
Installing collected packages: pyasn1, ldap3
Successfully installed ldap3-2.5.2 pyasn1-0.4.5
Collecting django (from -r /opt/djangoldap/requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/fd/9a/0c028ea0fe4f5803dda1a7afabeed958d0c8b79b0fe762ffbf728db3b90d/Django-2.1.4-py3-none-any.whl (7.3MB)
Collecting django-ldapdb (from -r /opt/djangoldap/requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/e0/32/8df574a3286c88e0ab3731e602ac06e2f0a25cf49cc5287fc30b3eabc318/django_ldapdb-1.3.0-py2.py3-none-any.whl
Collecting pytest (from -r /opt/djangoldap/requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/19/80/1ac71d332302a89e8637456062186bf397abc5a5b663c1919b73f4d68b1b/pytest-4.0.2-py2.py3-none-any.whl (217kB)
Collecting pytest-django (from -r /opt/djangoldap/requirements.txt (line 4))
Downloading https://files.pythonhosted.org/packages/e7/e9/b7dfe72e2ef68dd8adc096f50ccee899acd65d506e35c612c3cfea8da243/pytest_django-3.4.4-py2.py3-none-any.whl
Collecting pytz (from django->-r /opt/djangoldap/requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/f8/0e/2365ddc010afb3d79147f1dd544e5ee24bf4ece58ab99b16fbb465ce6dc0/pytz-2018.7-py2.py3-none-any.whl (506kB)
Collecting python-ldap>=3.0 (from django-ldapdb->-r /opt/djangoldap/requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/7f/1c/28d721dff2fcd2fef9d55b40df63a00be26ec8a11e8c6fc612ae642f9cfd/python-ldap-3.1.0.tar.gz (366kB)
Collecting six>=1.10.0 (from pytest->-r /opt/djangoldap/requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting py>=1.5.0 (from pytest->-r /opt/djangoldap/requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/3e/c7/3da685ef117d42ac8d71af525208759742dd235f8094221fdaafcd3dba8f/py-1.7.0-py2.py3-none-any.whl (83kB)
Collecting more-itertools>=4.0.0 (from pytest->-r /opt/djangoldap/requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/a4/a6/42f17d065bda1fac255db13afc94c93dbfb64393eae37c749b4cb0752fc7/more_itertools-5.0.0-py3-none-any.whl (52kB)
Collecting atomicwrites>=1.0 (from pytest->-r /opt/djangoldap/requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/3a/9a/9d878f8d885706e2530402de6417141129a943802c084238914fa6798d97/atomicwrites-1.2.1-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /opt/venv/djangoldap/lib/python3.6/site-packages (from pytest->-r /opt/djangoldap/requirements.txt (line 3)) (40.6.3)
Collecting attrs>=17.4.0 (from pytest->-r /opt/djangoldap/requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/3a/e1/5f9023cc983f1a628a8c2fd051ad19e76ff7b142a0faf329336f9a62a514/attrs-18.2.0-py2.py3-none-any.whl
Collecting pluggy>=0.7 (from pytest->-r /opt/djangoldap/requirements.txt (line 3))
Downloading https://files.pythonhosted.org/packages/1c/e7/017c262070af41fe251401cb0d0e1b7c38f656da634cd0c15604f1f30864/pluggy-0.8.0-py2.py3-none-any.whl
Requirement already satisfied: pyasn1>=0.3.7 in /opt/venv/djangoldap/lib/python3.6/site-packages (from python-ldap>=3.0->django-ldapdb->-r /opt/djangoldap/requirements.txt (line 2)) (0.4.5)
Collecting pyasn1_modules>=0.1.5 (from python-ldap>=3.0->django-ldapdb->-r /opt/djangoldap/requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/19/02/fa63f7ba30a0d7b925ca29d034510fc1ffde53264b71b4155022ddf3ab5d/pyasn1_modules-0.2.2-py2.py3-none-any.whl (62kB)
Building wheels for collected packages: python-ldap
Running setup.py bdist_wheel for python-ldap: started
Running setup.py bdist_wheel for python-ldap: finished with status 'done'
Stored in directory: /root/.cache/pip/wheels/dd/c2/2f/2fed278648af625893327dffeb4cba33ae3c486fc49e1b2b2e
Successfully built python-ldap
Installing collected packages: pytz, django, pyasn1-modules, python-ldap, django-ldapdb, six, py, more-itertools, atomicwrites, attrs, pluggy, pytest, pytest-django
Successfully installed atomicwrites-1.2.1 attrs-18.2.0 django-2.1.4 django-ldapdb-1.3.0 more-itertools-5.0.0 pluggy-0.8.0 py-1.7.0 pyasn1-modules-0.2.2 pytest-4.0.2 pytest-django-3.4.4 python-ldap-3.1.0 pytz-2018.7 six-1.12.0
---> 0e23ac27f2e8
Removing intermediate container b73e5f22ff82
Step 13/14 : COPY install/etc/profile.d/pythonenv.sh /etc/profile.d/pythonenv.sh
---> 00395b0cad07
Removing intermediate container 087c96963966
Step 14/14 : CMD /opt/bin/start.sh
---> Running in 9899250f706d
---> 8762936a179e
Removing intermediate container 9899250f706d
Successfully built 8762936a179e
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Test: setup)
[Pipeline] sh
Creating volume "openldap_django.var_db" with default driver
Creating volume "openldap_django.etc_openldap" with default driver
Creating openldap_django ...
Creating openldap_django ... done
.Container openldap_django up
openldap_django started
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Test: run)
[Pipeline] sh
load initial data
adding new entry "dc=at"
adding new entry "cn=admin,dc=at"
adding new entry "dc=gv,dc=at"
adding new entry "gvOuId=AT:TEST:1,dc=gv,dc=at"
adding new entry "gvGid=AT:B:1:12345,gvOuId=AT:TEST:1,dc=gv,dc=at"
adding new entry "tstgid=tt1,dc=at"
adding new entry "tstOuId=AT:TEST:3,dc=gv,dc=at"
test authentication with user test@bmspot.gv.at
version: 1
#
# LDAPv3
# base <dc=at> with scope subtree
# filter: uid=test@bmspot.gv.at
# requesting: ALL
#
# AT:B:1:12345, AT:TEST:1, gv.at
dn: gvGid=AT:B:1:12345,gvOuId=AT:TEST:1,dc=gv,dc=at
gvGid: AT:B:1:12345
objectClass: gvOrgPerson
displayName: User Test
cn: Test User
givenName: Test
sn: User
uid: test@bmspot.gv.at
gvScope: public
gvSource: initial
gvStatus: active
userPassword:: e1NTSEF9WXFhSlF4NVJmd1NZellxb00raDJDcDBPVGErR1VDeXI=
# search result
# numResponses: 2
# numEntries: 1
test python/ldap3
connecting as cn=admin,dc=at
search testusers
[DN: cn=admin,dc=at - STATUS: Read - READ TIME: 2018-12-30T09:55:01.436999
, DN: gvGid=AT:B:1:12345,gvOuId=AT:TEST:1,dc=gv,dc=at - STATUS: Read - READ TIME: 2018-12-30T09:55:01.437051
, DN: tstgid=tt1,dc=at - STATUS: Read - READ TIME: 2018-12-30T09:55:01.437094
]
change password for gvGid=AT:B:1:12345,gvOuId=AT:TEST:1,dc=gv,dc=at
connecting as gvGid=AT:B:1:12345,gvOuId=AT:TEST:1,dc=gv,dc=at
============================= test session starts ==============================
platform linux -- Python 3.6.7, pytest-4.0.2, py-1.7.0, pluggy-0.8.0
Django settings: djangoldap.settings (from environment variable)
rootdir: /tests, inifile:
plugins: django-3.4.4
collected 10 items
tests/test_django_ldapdb.py ..FFFFFF.F [100%]
=================================== FAILURES ===================================
____________________________ test_tstPerson_update _____________________________
def test_tstPerson_update():
u = tstPerson.objects.get(dn='tstgid=tt1,dc=at')
assert u.email == ''
u.email = 'tt1@localhost.local'
> u.save()
tests/test_django_ldapdb.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
opt/venv/djangoldap/lib/python3.6/site-packages/django/db/models/base.py:718: in save
force_update=force_update, update_fields=update_fields)
opt/venv/djangoldap/lib/python3.6/site-packages/django/db/models/base.py:748: in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
opt/venv/djangoldap/lib/python3.6/site-packages/ldapdb/models/base.py:137: in _save_table
connection.rename_s(old_dn, self.build_rdn())
opt/venv/djangoldap/lib/python3.6/site-packages/ldapdb/backends/ldap/base.py:308: in rename_s
return cursor.connection.rename_s(dn, newrdn)
opt/venv/djangoldap/lib/python3.6/site-packages/ldap/ldapobject.py:1256: in rename_s
return self._apply_method_s(SimpleLDAPObject.rename_s,*args,**kwargs)
opt/venv/djangoldap/lib/python3.6/site-packages/ldap/ldapobject.py:1197: in _apply_method_s
return func(self,*args,**kwargs)
opt/venv/djangoldap/lib/python3.6/site-packages/ldap/ldapobject.py:684: in rename_s
resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all=1,timeout=self.timeout)
opt/venv/djangoldap/lib/python3.6/site-packages/ldap/ldapobject.py:749: in result3
resp_ctrl_classes=resp_ctrl_classes
opt/venv/djangoldap/lib/python3.6/site-packages/ldap/ldapobject.py:756: in result4
ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)
opt/venv/djangoldap/lib/python3.6/site-packages/ldap/ldapobject.py:329: in _ldap_call
reraise(exc_type, exc_value, exc_traceback)
opt/venv/djangoldap/lib/python3.6/site-packages/ldap/compat.py:44: in reraise
raise exc_value
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <ldap.ldapobject.ReconnectLDAPObject object at 0x7f351c705898>
func = <built-in method result4 of LDAP object at 0x7f351c6285f8>
args = (14, 1, -1, 0, 0, 0), kwargs = {}, diagnostic_message_success = None
exc_type = None, exc_value = None, exc_traceback = None
def _ldap_call(self,func,*args,**kwargs):
"""
Wrapper method mainly for serializing calls into OpenLDAP libs
and trace logs
"""
self._ldap_object_lock.acquire()
if __debug__:
if self._trace_level>=1:
self._trace_file.write('*** %s %s - %s\n%s\n' % (
repr(self),
self._uri,
'.'.join((self.__class__.__name__,func.__name__)),
pprint.pformat((args,kwargs))
))
if self._trace_level>=9:
traceback.print_stack(limit=self._trace_stack_limit,file=self._trace_file)
diagnostic_message_success = None
try:
try:
> result = func(*args,**kwargs)
E ldap.OBJECT_CLASS_VIOLATION: {'desc': 'Object class violation', 'info': "object class 'tstPerson' requires attribute 'tstgid'"}
opt/venv/djangoldap/lib/python3.6/site-packages/ldap/ldapobject.py:313: OBJECT_CLASS_VIOLATION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment