Skip to content

Commit 9d8c102

Browse files
committed
Fixes CI/CD tests
1 parent 03b44ed commit 9d8c102

3 files changed

Lines changed: 21 additions & 9 deletions

File tree

data/txt/sha256sums.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ ccc4a717e887652b1fcce073d9409d9c59a3b28548c703a9e453d15845f90cd7 lib/core/patch
189189
48797d6c34dd9bb8a53f7f3794c85f4288d82a9a1d6be7fcf317d388cb20d4b3 lib/core/replication.py
190190
0b8c38a01bb01f843d94a6c5f2075ee47520d0c4aa799cecea9c3e2c5a4a23a6 lib/core/revision.py
191191
888daba83fd4a34e9503fe21f01fef4cc730e5cde871b1d40e15d4cbc847d56c lib/core/session.py
192-
4ea19be3a4d0846babbb6ba273d0f590d34e9e97a094184f3507c02882a5e389 lib/core/settings.py
192+
82767887306a66ba4b1b2c254068225196f3adb434bfac2929a123c51fdd45f8 lib/core/settings.py
193193
cd5a66deee8963ba8e7e9af3dd36eb5e8127d4d68698811c29e789655f507f82 lib/core/shell.py
194194
bcb5d8090d5e3e0ef2a586ba09ba80eef0c6d51feb0f611ed25299fbb254f725 lib/core/subprocessng.py
195195
70ea3768f1b3062b22d20644df41c86238157ec80dd43da40545c620714273c6 lib/core/target.py
@@ -607,7 +607,7 @@ a6d013104601c0414628aff3d8b5b69bee3e6733781d8f8da880457d8b44bd3a tests/test_pro
607607
cec98d72992c0799229a780fa7f0d7f3fb01ec2d708187ce0e4a05c8612f291b tests/test_safe2bin.py
608608
a1c6cda1e5b483f61e6a4f8ddd0b06a15ddaa3fd2119bfb9dbd9cc970d7a751d tests/test_settings_regex.py
609609
d3d991331096e16e5019de3d652e9fff92c09bd9f97c50b1c2c3ceb0ed49b17e tests/test_sqlparse.py
610-
41907c873663401f979b87eaff3efc8d52e0ce96cbe1eef7aa70c6d3af8cd5cf tests/test_strings.py
610+
8bcbf1091134dd0a62f6201f8b3645ed87b5ff2f7ba40a87231a29dac412591f tests/test_strings.py
611611
f3a628db8a3e05baee580c02132e95b164695e4b3ee1785707e3ea148702449a tests/test_tamper.py
612612
b3e13febe9e0ff6f97334f2868655bfdbaa18755e464a6dc4c6d424f513bad02 tests/test_targeturl.py
613613
639851dc68f62b559b200b09c308e64e453f414969940005bac75dc0ab07a6b6 tests/test_texthelpers.py

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from thirdparty import six
2121

2222
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23-
VERSION = "1.10.6.138"
23+
VERSION = "1.10.6.139"
2424
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2525
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2626
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

tests/test_strings.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,24 @@ def test_longestCommonPrefix(self):
9090
self.assertEqual(longestCommonPrefix("abc", "xyz"), "")
9191

9292
def test_decodeIntToUnicode(self):
93-
# single-byte code points map to their char
94-
self.assertEqual(decodeIntToUnicode(65), u"A")
95-
self.assertEqual(decodeIntToUnicode(97), u"a")
96-
# NOTE: >255 ints are interpreted as a multi-byte sequence (not a Unicode code point),
97-
# e.g. 0x2122 -> bytes 0x21 0x22 -> '!"' (documents actual behavior, not an assumption)
98-
self.assertEqual(decodeIntToUnicode(0x2122), u'!"')
93+
from lib.core.common import Backend
94+
from lib.core.data import kb
95+
96+
# decodeIntToUnicode() is back-end DBMS dependent (e.g. PostgreSQL/Oracle/SQLite
97+
# treat >255 values as Unicode code points). Pin a clean, no-forced-DBMS state so
98+
# the result is deterministic regardless of test execution order (a prior dialect
99+
# test may otherwise leave a forced DBMS set); restore it afterwards.
100+
_saved = (kb.get("forcedDbms"), kb.get("stickyDBMS"))
101+
Backend.flushForcedDbms(force=True)
102+
try:
103+
# single-byte code points map to their char
104+
self.assertEqual(decodeIntToUnicode(65), u"A")
105+
self.assertEqual(decodeIntToUnicode(97), u"a")
106+
# NOTE: with no identified DBMS, >255 ints are interpreted as a multi-byte
107+
# sequence (not a Unicode code point), e.g. 0x2122 -> bytes 0x21 0x22 -> '!"'
108+
self.assertEqual(decodeIntToUnicode(0x2122), u'!"')
109+
finally:
110+
kb.forcedDbms, kb.stickyDBMS = _saved
99111

100112

101113
if __name__ == "__main__":

0 commit comments

Comments
 (0)