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

selftest: fix potential reference before assigned error

This would only happen if the test failed (but the message would be
incorrect as 'e' the exception to be stringified doesn't exist.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15611
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Noel Power 2024-03-28 09:09:02 +00:00 committed by Andrew Bartlett
parent 8e931fce12
commit efdbf0511e
2 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ class HttpChunkBlackboxTests(BlackboxTestCase):
try:
msg = "snglechunksnglechunksnglechunksnglechunksnglechunk"
resp = self.check_output("%s -d11 -U%% -I%s --rsize 49 --uri %s" % (COMMAND, os.getenv("SERVER_IP", "localhost"), msg))
self.fail(str(e))
self.fail("unexpected success")
except BlackboxProcessError as e:
if "http_read_chunk: size 50 exceeds max content len 49 skipping body" not in e.stderr.decode('utf-8'):
self.fail(str(e))

View File

@ -77,7 +77,7 @@ class HttpContentBlackboxTests(BlackboxTestCase):
msg = "012345678" # 9 bytes
# limit response to 8 bytes
resp = self.check_output("%s -d11 -U%% -I%s --rsize 8 --uri %s" % (COMMAND, os.getenv("SERVER_IP", "localhost"), msg))
self.fail(str(e))
self.fail("unexpected success")
except BlackboxProcessError as e:
if "unexpected 0 len response" not in e.stdout.decode('utf-8'):
self.fail(str(e))