1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ndrdump tests: Make the tests less fragile

Remove the C source file and line number from the expected output to
make the tests less likely to break if ndr.c changes.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Gary Lockyer 2020-03-03 16:59:19 +13:00 committed by Andrew Bartlett
parent b0ba7cd4f9
commit 56e466b4b8

View File

@ -22,6 +22,7 @@ from __future__ import print_function
"""Blackbox tests for ndrdump."""
import os
import re
from samba.tests import BlackboxTestCase, BlackboxProcessError
for p in ["../../../../../source4/librpc/tests",
@ -436,6 +437,11 @@ dump OK
except BlackboxProcessError as e:
self.fail(e)
# Filter out the C source file and line number
regex = rb"\.\./\.\./librpc/ndr/ndr\.c:[0-9]+"
actual = re.sub(regex, b"", actual)
expected = re.sub(regex, b"", expected)
self.assertEqual(actual, expected)
# Test a print of NULL pointer in manually-written ndr_drsuapi.c