#48771 lib389 - get ns-slapd version
Closed: wontfix None Opened 8 years ago by vashirov.

Some tests should be executed only with 389-ds-base that implements required features/has fixes. This can be done with py.test skipif fixture [1]. But we don't have a way to get the version of ns-slapd that is currently used in DirSrv instance.

We need to add property for DirSrv object that would contain the version of ns-slapd.

[1] https://pytest.org/latest/skipping.html


Self nack. With this implementation version won't be accessible outside of the fixture. Better implement getversion() in lib389.utils.

I don't think this is the best way to do this.

First, features can be discovered by oid in the base '' dit.

For other features by version, I think that you can get the version from cn=monitor:

{{{
ldapsearch -H ldap://... -s base -b 'cn=monitor' -LLL -x -Z '(objectClass=*)' version
dn: cn=monitor
version: 389-Directory/1.3.4.0 B2016.047.164
}}}

Also, I don't like that you added a dependency here.

You can check in python lexicographically with:

{{{

x = '389-Directory/1.3.4.0 B2016.047.164'
y = '389-Directory/1.3.5.0 B2016.047.164'
x < y
True
}}}

So you should not need this dependency.

If you needed some version, say 1.2.11, you could do:

{{{

x = '389-Directory/1.3.4.0 B2016.047.164'
z = '389-Directory/1.2.11'
x > z
True
}}}

Conversely:

{{{

x = '389-Directory/1.3.4.0 B2016.047.164'
z = '389-Directory/1.4.0'
x > z
False
}}}

I hope that this helps you.

Replying to [comment:5 firstyear]:

I don't think this is the best way to do this.

First, features can be discovered by oid in the base '' dit.
I'm not talking about LDAPv3 features and extensions, but rather 389-ds specific features. For example, 1a58bf8 adds repl keep alive entries. It's not advertised anywhere in dit.

For other features by version, I think that you can get the version from cn=monitor:

{{{
ldapsearch -H ldap://... -s base -b 'cn=monitor' -LLL -x -Z '(objectClass=*)' version
dn: cn=monitor
version: 389-Directory/1.3.4.0 B2016.047.164
}}}
That would be nice to have also, but my use case is different. I want to skip tests before even the instance gets created. So you can't query cn=monitor. Also, not only ns-slapd has new features, but other command line utils shipped with 389-ds-base. So the build timestamp from ns-slapd can give me the required information.
I also don't want to compare rpm NVR, because it won't be useful for other distros (if any) and ds built from sources manually.

Also, I don't like that you added a dependency here.

You can check in python lexicographically with:
Right, thanks, will rework it.

Thanks Mark!

commit 568b7767ba5dd27f9c3dcf17a69703bbe92bf37b
To ssh://git.fedorahosted.org/git/389/lib389.git
f682647..568b776 master -> master

Metadata Update from @vashirov:
- Issue assigned to vashirov
- Issue set to the milestone: lib389 1.0.2

7 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/1831

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

3 years ago

Login to comment on this ticket.

Metadata