diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2023-12-06 21:55:30 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-08 16:58:34 +0000 |
commit | dd2fb8f00acedf758f51a5afa7f04e5bc24ad15f (patch) | |
tree | 075f8da4aa59841b9d732f8feb22d287cb0fb714 /meta/lib/oeqa/selftest/cases | |
parent | 45d2f8d4bc2ca7c16379334a93ea172a538a6bb2 (diff) | |
download | poky-dd2fb8f00acedf758f51a5afa7f04e5bc24ad15f.tar.gz |
devtool: upgrade: Update all existing checksums for the SRC_URI
In addition to updating the sha256sum and removing the md5sum, update
all other existing checksums. If the only existing checksum is md5sum,
then replace it with the default expected checksums (currently only
sha256sum).
(From OE-Core rev: 8ea8827ee49b7f0443b1c4bd47d1344a689d73a3)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index fd9ac42168..47353dadff 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
@@ -1883,6 +1883,54 @@ class DevtoolUpgradeTests(DevtoolBase): | |||
1883 | self.assertNotIn(recipe, result.output) | 1883 | self.assertNotIn(recipe, result.output) |
1884 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting') | 1884 | self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting') |
1885 | 1885 | ||
1886 | def test_devtool_upgrade_drop_md5sum(self): | ||
1887 | # Check preconditions | ||
1888 | self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') | ||
1889 | self.track_for_cleanup(self.workspacedir) | ||
1890 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
1891 | # For the moment, we are using a real recipe. | ||
1892 | recipe = 'devtool-upgrade-test3' | ||
1893 | version = '1.6.0' | ||
1894 | oldrecipefile = get_bb_var('FILE', recipe) | ||
1895 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | ||
1896 | self.track_for_cleanup(tempdir) | ||
1897 | # Check upgrade. Code does not check if new PV is older or newer that current PV, so, it may be that | ||
1898 | # we are downgrading instead of upgrading. | ||
1899 | result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, version)) | ||
1900 | # Check new recipe file is present | ||
1901 | newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version)) | ||
1902 | self.assertExists(newrecipefile, 'Recipe file should exist after upgrade') | ||
1903 | # Check recipe got changed as expected | ||
1904 | with open(oldrecipefile + '.upgraded', 'r') as f: | ||
1905 | desiredlines = f.readlines() | ||
1906 | with open(newrecipefile, 'r') as f: | ||
1907 | newlines = f.readlines() | ||
1908 | self.assertEqual(desiredlines, newlines) | ||
1909 | |||
1910 | def test_devtool_upgrade_all_checksums(self): | ||
1911 | # Check preconditions | ||
1912 | self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory') | ||
1913 | self.track_for_cleanup(self.workspacedir) | ||
1914 | self.add_command_to_tearDown('bitbake-layers remove-layer */workspace') | ||
1915 | # For the moment, we are using a real recipe. | ||
1916 | recipe = 'devtool-upgrade-test4' | ||
1917 | version = '1.6.0' | ||
1918 | oldrecipefile = get_bb_var('FILE', recipe) | ||
1919 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | ||
1920 | self.track_for_cleanup(tempdir) | ||
1921 | # Check upgrade. Code does not check if new PV is older or newer that current PV, so, it may be that | ||
1922 | # we are downgrading instead of upgrading. | ||
1923 | result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, version)) | ||
1924 | # Check new recipe file is present | ||
1925 | newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version)) | ||
1926 | self.assertExists(newrecipefile, 'Recipe file should exist after upgrade') | ||
1927 | # Check recipe got changed as expected | ||
1928 | with open(oldrecipefile + '.upgraded', 'r') as f: | ||
1929 | desiredlines = f.readlines() | ||
1930 | with open(newrecipefile, 'r') as f: | ||
1931 | newlines = f.readlines() | ||
1932 | self.assertEqual(desiredlines, newlines) | ||
1933 | |||
1886 | def test_devtool_layer_plugins(self): | 1934 | def test_devtool_layer_plugins(self): |
1887 | """Test that devtool can use plugins from other layers. | 1935 | """Test that devtool can use plugins from other layers. |
1888 | 1936 | ||