Commit f786639 Ticket 49172 - Fix test schema files

2 files Authored and Committed by firstyear 4 months ago
Ticket 49172 - Fix test schema files

Bug Description:  This issue has two points. First, is that we were not
handling conditions where schema was empty, so we got a none type back.

Second, schema handling moves in 1.3.6, to the join systemschema dir and
schemadir. We should be reflective of this in our test, which requires and
update to the defaults.inf to list the path.

Fix Description:  Update defaults.inf, and the test to correctly
handle none.

https://pagure.io/389-ds-base/issue/49172

Author: wibrown

Review by: mreynolds (thanks!)

    
 1 @@ -129,8 +129,12 @@
 2       for fn in schemainst.schema.list_files():
 3           try:
 4               fschema = schemainst.schema.file_to_subschema(fn)
 5 +             if fschema is None:
 6 +                 raise Exception("Empty schema file %s" % fn)
 7           except:
 8               log.warn("Unable to parse %s as a schema file - skipping" % fn)
 9 +             continue
10 +         log.info("Parsed %s as a schema file - checking" % fn)
11           for oid in fschema.listall(occlass):
12               se = fschema.get_obj(occlass, oid)
13               assert se
1 @@ -36,6 +36,7 @@
2   pid_file = @localstatedir@/run/dirsrv/slapd-{instance_name}.pid
3   inst_dir = @serverdir@
4   plugin_dir = @serverplugindir@
5 + system_schema_dir = @systemschemadir@
6   
7   ; These values can be altered in an installation of ds
8   user = dirsrv