mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
45d2f8d4bc
commit
dd2fb8f00a
@@ -1883,6 +1883,54 @@ class DevtoolUpgradeTests(DevtoolBase):
|
||||
self.assertNotIn(recipe, result.output)
|
||||
self.assertNotExists(os.path.join(self.workspacedir, 'recipes', recipe), 'Recipe directory should not exist after resetting')
|
||||
|
||||
def test_devtool_upgrade_drop_md5sum(self):
|
||||
# Check preconditions
|
||||
self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
|
||||
self.track_for_cleanup(self.workspacedir)
|
||||
self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
|
||||
# For the moment, we are using a real recipe.
|
||||
recipe = 'devtool-upgrade-test3'
|
||||
version = '1.6.0'
|
||||
oldrecipefile = get_bb_var('FILE', recipe)
|
||||
tempdir = tempfile.mkdtemp(prefix='devtoolqa')
|
||||
self.track_for_cleanup(tempdir)
|
||||
# Check upgrade. Code does not check if new PV is older or newer that current PV, so, it may be that
|
||||
# we are downgrading instead of upgrading.
|
||||
result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, version))
|
||||
# Check new recipe file is present
|
||||
newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version))
|
||||
self.assertExists(newrecipefile, 'Recipe file should exist after upgrade')
|
||||
# Check recipe got changed as expected
|
||||
with open(oldrecipefile + '.upgraded', 'r') as f:
|
||||
desiredlines = f.readlines()
|
||||
with open(newrecipefile, 'r') as f:
|
||||
newlines = f.readlines()
|
||||
self.assertEqual(desiredlines, newlines)
|
||||
|
||||
def test_devtool_upgrade_all_checksums(self):
|
||||
# Check preconditions
|
||||
self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
|
||||
self.track_for_cleanup(self.workspacedir)
|
||||
self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
|
||||
# For the moment, we are using a real recipe.
|
||||
recipe = 'devtool-upgrade-test4'
|
||||
version = '1.6.0'
|
||||
oldrecipefile = get_bb_var('FILE', recipe)
|
||||
tempdir = tempfile.mkdtemp(prefix='devtoolqa')
|
||||
self.track_for_cleanup(tempdir)
|
||||
# Check upgrade. Code does not check if new PV is older or newer that current PV, so, it may be that
|
||||
# we are downgrading instead of upgrading.
|
||||
result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, version))
|
||||
# Check new recipe file is present
|
||||
newrecipefile = os.path.join(self.workspacedir, 'recipes', recipe, '%s_%s.bb' % (recipe, version))
|
||||
self.assertExists(newrecipefile, 'Recipe file should exist after upgrade')
|
||||
# Check recipe got changed as expected
|
||||
with open(oldrecipefile + '.upgraded', 'r') as f:
|
||||
desiredlines = f.readlines()
|
||||
with open(newrecipefile, 'r') as f:
|
||||
newlines = f.readlines()
|
||||
self.assertEqual(desiredlines, newlines)
|
||||
|
||||
def test_devtool_layer_plugins(self):
|
||||
"""Test that devtool can use plugins from other layers.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user