#49057 Fix tests failures on older versions of DS
Closed: Fixed None Opened 2 years ago by vashirov.

On older versions of DS some tests are failing because features are not implemented. We need to mark these tests with skip fixture, so they won't be executed.


There are failures left that are either bugs in the DS or in the test. It needs additional investigation.

I think that this is great, and we should be making it default for new tests to check such versions if possible.

Thanks!

Looks good!

Sorry, I have to confess that I haven't checked each version passed to skipif... But it looks correct in the quick scan.
{{{
pytestmark = pytest.mark.skipif(ds_is_older('1.x.x'), reason="Not implemented")
^^^^^
}}}

I'm not sure about this.

{{{
if ds_paths.version < '1.3':
425 nsinactivate = '%s/ns-inactivate.pl' % inst_dir
426 nsinactivate_cmd = [nsinactivate, '-D', DN_DM, '-w', PASSWORD, '-I', BINDDN]
427 else:
428 nsinactivate = '%s/sbin/ns-inactivate.pl' % topology.standalone.prefix
429 nsinactivate_cmd = [nsinactivate, '-Z', 'standalone', '-D', DN_DM, '-w', PASSWORD, '-I', BINDDN]
}}}

Code like this frightens me. Versions less that 1.3 (ie 1.2) should have the sbin scripts in place. So I don't see why you need to use the instance version instead.

As well, you have access to ds_paths from 1.2, so can't you use that to get the sbin / instance dir if needed?

With the 1.3 version, you should be using either ds_paths.sbin_dir, or standalone.get_sbin_dir().

Remember, that the sbin dir MAY NOT be relative to the prefix. People can (and have) changed it in installs...

Replying to [comment:8 firstyear]:

I'm not sure about this.

{{{
if ds_paths.version < '1.3':
425 nsinactivate = '%s/ns-inactivate.pl' % inst_dir
426 nsinactivate_cmd = [nsinactivate, '-D', DN_DM, '-w', PASSWORD, '-I', BINDDN]
427 else:
428 nsinactivate = '%s/sbin/ns-inactivate.pl' % topology.standalone.prefix
429 nsinactivate_cmd = [nsinactivate, '-Z', 'standalone', '-D', DN_DM, '-w', PASSWORD, '-I', BINDDN]
}}}

Code like this frightens me. Versions less that 1.3 (ie 1.2) should have the sbin scripts in place. So I don't see why you need to use the instance version instead.
Except they don't:
{{{

locate ns-activate.pl

/usr/lib64/dirsrv/slapd-rhel6ds/ns-activate.pl
/usr/share/dirsrv/script-templates/template-ns-activate.pl

rpm -ql 389-ds-base | grep ns-activate

/usr/share/dirsrv/script-templates/template-ns-activate.pl
}}}
(this is taken from RHEL6 with instance rhel6ds installed).

As well, you have access to ds_paths from 1.2, so can't you use that to get the sbin / instance dir if needed?
I'm getting instance dir from there:
{{{
inst_dir = ds_paths.inst_dir
}}}

With the 1.3 version, you should be using either ds_paths.sbin_dir, or standalone.get_sbin_dir().

Right, I'll fix that, since topology.standalone.prefix is no longer valid (missed that during the rebase).
Remember, that the sbin dir MAY NOT be relative to the prefix. People can (and have) changed it in installs...
It will be in case of RHEL/Fedora and official rpm installs. Other use cases on different distros/OSes are not a primary concern for QE, since it's not supported by RH.

You have my ack, looks good. Thanks for clearing this up.

Thank you Noriko and William!

commit ad23dc8
To ssh://git.fedorahosted.org/git/389/ds.git
dccf277..ad23dc8 master -> master

Metadata Update from @vashirov:
- Issue set to the milestone: CI test 1.0

2 years ago

Login to comment on this ticket.

Metadata