From a1ef39ffa7099f800d5e8f31361dd59770c68b27 Mon Sep 17 00:00:00 2001 From: Jacob Cassagnol <87133045+jcassagnol-public@users.noreply.github.com> Date: Mon, 1 Nov 2021 19:14:14 -0400 Subject: Half the failing testcases fixed. Still failing on: SCons/UtilTests.py test/Configure/ConfigureDryRunError.py test/Configure/implicit-cache.py test/Configure/option--config.py test/option/hash-format.py test/option/option-n.py test/question/Configure.py These tests all have hardcoded md5 sums or use md5 directly Next commit should fix it so the md5-specific tests are skipped if fips mode detected. Also will figure out a way around the hardcoded m5sums. --- SCons/Node/NodeTests.py | 4 ++-- test/sconsign/script/Configure.py | 2 +- test/sconsign/script/SConsignFile.py | 2 +- test/sconsign/script/Signatures.py | 2 +- test/sconsign/script/dblite.py | 2 +- test/sconsign/script/no-SConsignFile.py | 2 +- testing/framework/TestSCons.py | 6 +++--- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/SCons/Node/NodeTests.py b/SCons/Node/NodeTests.py index 29a3887..2677aa9 100644 --- a/SCons/Node/NodeTests.py +++ b/SCons/Node/NodeTests.py @@ -592,7 +592,7 @@ class NodeTestCase(unittest.TestCase): node = SCons.Node.Node() node._func_get_contents = 4 result = node.get_csig() - assert result == '550a141f12de6341fba65b0ad0433500', result + assert result == '550a141f12de6341fba65b0ad0433500' or result == '9a3e61b6bcc8abec08f195526c3132d5a4a98cc0' or result == '3538a1ef2e113da64249eea7bd068b585ec7ce5df73b2d1e319d8c9bf47eb314', result finally: SCons.Node.Node.NodeInfo = SCons.Node.NodeInfoBase @@ -609,7 +609,7 @@ class NodeTestCase(unittest.TestCase): node = SCons.Node.Node() node._func_get_contents = 4 result = node.get_cachedir_csig() - assert result == '15de21c670ae7c3f6f3f1f37029303c9', result + assert result == '15de21c670ae7c3f6f3f1f37029303c9' or result == 'cfa1150f1787186742a9a884b73a43d8cf219f9b' or result == '91a73fd806ab2c005c13b4dc19130a884e909dea3f72d46e30266fe1a1f588d8', result finally: SCons.Node.Node.NodeInfo = SCons.Node.NodeInfoBase diff --git a/test/sconsign/script/Configure.py b/test/sconsign/script/Configure.py index 125022d..7bf1f05 100644 --- a/test/sconsign/script/Configure.py +++ b/test/sconsign/script/Configure.py @@ -66,7 +66,7 @@ env = conf.Finish() test.run(arguments = '.') -sig_re = r'[0-9a-fA-F]{32}' +sig_re = r'[0-9a-fA-F]{32,64}' date_re = r'\S+ \S+ [ \d]\d \d\d:\d\d:\d\d \d\d\d\d' _sconf_temp_conftest_0_c = '.sconf_temp/conftest_%(sig_re)s_0.c'%locals() diff --git a/test/sconsign/script/SConsignFile.py b/test/sconsign/script/SConsignFile.py index c54e17b..354bd05 100644 --- a/test/sconsign/script/SConsignFile.py +++ b/test/sconsign/script/SConsignFile.py @@ -141,7 +141,7 @@ test.write(['sub2', 'inc2.h'], r"""\ test.run(arguments = '--implicit-cache .') -sig_re = r'[0-9a-fA-F]{32}' +sig_re = r'[0-9a-fA-F]{32,64}' test.run_sconsign(arguments = ".sconsign", stdout = r"""=== .: diff --git a/test/sconsign/script/Signatures.py b/test/sconsign/script/Signatures.py index 0f21496..ecb8dc2 100644 --- a/test/sconsign/script/Signatures.py +++ b/test/sconsign/script/Signatures.py @@ -149,7 +149,7 @@ test.sleep() test.run(arguments = '. --max-drift=1') -sig_re = r'[0-9a-fA-F]{32}' +sig_re = r'[0-9a-fA-F]{32,64}' date_re = r'\S+ \S+ [ \d]\d \d\d:\d\d:\d\d \d\d\d\d' test.run_sconsign(arguments = "-e hello.exe -e hello.obj sub1/.sconsign", diff --git a/test/sconsign/script/dblite.py b/test/sconsign/script/dblite.py index 41cf7e2..1fcf8c0 100644 --- a/test/sconsign/script/dblite.py +++ b/test/sconsign/script/dblite.py @@ -109,7 +109,7 @@ test.sleep() test.run(arguments = '. --max-drift=1') -sig_re = r'[0-9a-fA-F]{32}' +sig_re = r'[0-9a-fA-F]{32,64}' date_re = r'\S+ \S+ [ \d]\d \d\d:\d\d:\d\d \d\d\d\d' if sys.platform == 'win32': diff --git a/test/sconsign/script/no-SConsignFile.py b/test/sconsign/script/no-SConsignFile.py index c345829..1598af4 100644 --- a/test/sconsign/script/no-SConsignFile.py +++ b/test/sconsign/script/no-SConsignFile.py @@ -152,7 +152,7 @@ test.write(['sub2', 'inc2.h'], r"""\ test.run(arguments = '--implicit-cache --tree=prune .') -sig_re = r'[0-9a-fA-F]{32}' +sig_re = r'[0-9a-fA-F]{32,64}' expect = r"""hello.c: %(sig_re)s \d+ \d+ hello.exe: %(sig_re)s \d+ \d+ diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 50280be..2a19818 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -1415,10 +1415,10 @@ SConscript(sconscript) for ext, flag in bld_desc: # each file in TryBuild if ext in ['.c', '.cpp']: conf_filename = re.escape(os.path.join(sconf_dir, "conftest")) +\ - r'_[a-z0-9]{32}_\d+%s' % re.escape(ext) + r'_[a-z0-9]{32,64}_\d+%s' % re.escape(ext) elif ext == '': conf_filename = re.escape(os.path.join(sconf_dir, "conftest")) +\ - r'_[a-z0-9]{32}(_\d+_[a-z0-9]{32})?' + r'_[a-z0-9]{32,64}(_\d+_[a-z0-9]{32,64})?' else: # We allow the second hash group to be optional because @@ -1430,7 +1430,7 @@ SConscript(sconscript) # TODO: perhaps revisit and/or fix file naming for intermediate files in # Configure context logic conf_filename = re.escape(os.path.join(sconf_dir, "conftest")) +\ - r'_[a-z0-9]{32}_\d+(_[a-z0-9]{32})?%s' % re.escape(ext) + r'_[a-z0-9]{32,64}_\d+(_[a-z0-9]{32,64})?%s' % re.escape(ext) if flag == self.NCR: # NCR = Non Cached Rebuild -- cgit v0.12