Add more automount tests

This adds tests for the automountlocation_tofiles and
automountlocation_import commands, and to automountmap_add_indirect
with the --parentmap option.

The tofiles test checks not only the XML-RPC output, but also the
output_for_cli method.

The import tests load data from tofiles output to the directory
and check that tofiles output matches.
This only works when all maps are connected to auto.master.

Two minor touches to the automount plugin itself: remove an extra
space, and don't hide the traceback when re-raising an exception.
This commit is contained in:
Petr Viktorin
2012-05-25 10:53:23 -04:00
committed by Rob Crittenden
parent 895203c477
commit c799f6a0bf
2 changed files with 223 additions and 8 deletions

View File

@@ -349,7 +349,7 @@ class automountlocation_tofiles(LDAPQuery):
textui.print_plain(_('maps not connected to /etc/auto.master:'))
for m in orphanmaps:
textui.print_plain('---------------------------')
textui.print_plain('/etc/%s: ' % m['automountmapname'])
textui.print_plain('/etc/%s:' % m['automountmapname'])
for k in orphankeys:
if len(k) == 0: continue
dn = DN(k[0]['dn'])
@@ -391,7 +391,7 @@ class automountlocation_import(LDAPQuery):
reason=_('File %(file)s not found') % {'file': filename}
)
else:
raise e
raise
return map
def forward(self, *args, **options):