@@ -1690,7 +1690,7 @@ def run_checks():
16901690 expected = "Checksums missing for one or more sources/patches in toy-0.0-gompi-2018a-test.eb: "
16911691 expected += "found 1 sources + 1 patches vs 1 checksums"
16921692 self .assertEqual (res [0 ], expected )
1693- self .assertTrue (res [1 ].startswith ("Non-SHA256 checksum found for toy-0.0.tar.gz:" ))
1693+ self .assertTrue (res [1 ].startswith ("Non-SHA256 checksum(s) found for toy-0.0.tar.gz:" ))
16941694
16951695 # check for main sources/patches should reveal two issues with checksums
16961696 res = eb .check_checksums_for (eb .cfg )
@@ -1708,6 +1708,43 @@ def run_checks():
17081708 self .assertTrue (res [idx ].startswith (expected ))
17091709 idx += 1
17101710
1711+ # check whether tuple of alternative SHA256 checksums is correctly recognized
1712+ toy_ec = os .path .join (testdir , 'easyconfigs' , 'test_ecs' , 't' , 'toy' , 'toy-0.0.eb' )
1713+
1714+ ec = process_easyconfig (toy_ec )[0 ]
1715+ eb = get_easyblock_instance (ec )
1716+
1717+ # single SHA256 checksum per source/patch: OK
1718+ eb .cfg ['checksums' ] = [
1719+ '44332000aa33b99ad1e00cbd1a7da769220d74647060a10e807b916d73ea27bc' , # toy-0.0.tar.gz
1720+ '45b5e3f9f495366830e1869bb2b8f4e7c28022739ce48d9f9ebb159b439823c5' , # toy-*.patch
1721+ '4196b56771140d8e2468fb77f0240bc48ddbf5dabafe0713d612df7fafb1e458' , # toy-extra.txt]
1722+ ]
1723+ # no checksum issues
1724+ self .assertEqual (eb .check_checksums (), [])
1725+
1726+ # SHA256 checksum with type specifier: OK
1727+ eb .cfg ['checksums' ] = [
1728+ ('sha256' , '44332000aa33b99ad1e00cbd1a7da769220d74647060a10e807b916d73ea27bc' ), # toy-0.0.tar.gz
1729+ '45b5e3f9f495366830e1869bb2b8f4e7c28022739ce48d9f9ebb159b439823c5' , # toy-*.patch
1730+ ('sha256' , '4196b56771140d8e2468fb77f0240bc48ddbf5dabafe0713d612df7fafb1e458' ), # toy-extra.txt]
1731+ ]
1732+ # no checksum issues
1733+ self .assertEqual (eb .check_checksums (), [])
1734+
1735+ # tuple of two alternate SHA256 checksums: OK
1736+ eb .cfg ['checksums' ] = [
1737+ (
1738+ # two alternate checksums for toy-0.0.tar.gz
1739+ 'a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd' ,
1740+ '44332000aa33b99ad1e00cbd1a7da769220d74647060a10e807b916d73ea27bc' ,
1741+ ),
1742+ '45b5e3f9f495366830e1869bb2b8f4e7c28022739ce48d9f9ebb159b439823c5' , # toy-*.patch
1743+ '4196b56771140d8e2468fb77f0240bc48ddbf5dabafe0713d612df7fafb1e458' , # toy-extra.txt
1744+ ]
1745+ # no checksum issues
1746+ self .assertEqual (eb .check_checksums (), [])
1747+
17111748 def test_this_is_easybuild (self ):
17121749 """Test 'this_is_easybuild' function (and get_git_revision function used by it)."""
17131750 # make sure both return a non-Unicode string
0 commit comments