tests/samba-tool user wdigest: fix a flapping test
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 9 Feb 2018 10:09:41 +0000 (23:09 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 12 Feb 2018 04:21:01 +0000 (05:21 +0100)
The output of something like

  samba-tool user getpassword $USER --attributes virtualWDigest01

contains an LDIF section with long strings folded on the 77th column.

To unfold this LDIF we were using:

   result = re.sub(r"\n\s*", '', out)

which worked fine EXCEPT when a space in the output happened to land
immediately after the fold and got eaten by the \s*.

Instead we remove just a single space after the line break, because
that is always what fold_string() in lib/ldb/common/ldb_ldif.c
inserts, and for this simple replacement we don't need the re module.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Feb 12 05:21:01 CET 2018 on sn-devel-144


No differences found