mirror of
https://git.yoctoproject.org/poky
synced 2026-07-21 05:27:01 +00:00
devtool: reset: Escape command line input used in regular expression
Running, e.g., `devtool reset sdbus-c++` would result in the following error: re.error: multiple repeat at position 35 This was due to the ++ in the recipe name, which would be treated as an incorrect regular expression in _reset(). Use re.escape() to make sure all characters in the recipe name are treated literally. (From OE-Core rev: 6e73bd9b3e6d529752db93879f2c0ed53873dd1a) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
0e32e1cb26
commit
c0f3bc79b3
@@ -1757,6 +1757,8 @@ class DevtoolExtractTests(DevtoolBase):
|
||||
self.assertExists(os.path.join(tempdir, 'Makefile.am'), 'Extracted source could not be found')
|
||||
self._check_src_repo(tempdir)
|
||||
|
||||
class DevtoolResetTests(DevtoolBase):
|
||||
|
||||
def test_devtool_reset_all(self):
|
||||
tempdir = tempfile.mkdtemp(prefix='devtoolqa')
|
||||
self.track_for_cleanup(tempdir)
|
||||
@@ -1783,6 +1785,21 @@ class DevtoolExtractTests(DevtoolBase):
|
||||
matches2 = glob.glob(stampprefix2 + '*')
|
||||
self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2)
|
||||
|
||||
def test_devtool_reset_re_plus_plus(self):
|
||||
tempdir = tempfile.mkdtemp(prefix='devtoolqa')
|
||||
self.track_for_cleanup(tempdir)
|
||||
self.track_for_cleanup(self.workspacedir)
|
||||
self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
|
||||
testrecipe = 'devtool-test-reset-re++'
|
||||
result = runCmd('devtool modify %s' % testrecipe)
|
||||
result = runCmd('devtool reset -n %s' % testrecipe)
|
||||
self.assertIn(testrecipe, result.output)
|
||||
result = runCmd('devtool status')
|
||||
self.assertNotIn(testrecipe, result.output)
|
||||
self.assertNotExists(os.path.join(self.workspacedir, 'recipes', testrecipe), 'Recipe directory should not exist after resetting')
|
||||
|
||||
class DevtoolDeployTargetTests(DevtoolBase):
|
||||
|
||||
@OETestTag("runqemu")
|
||||
def test_devtool_deploy_target(self):
|
||||
self._check_runqemu_prerequisites()
|
||||
@@ -1850,6 +1867,8 @@ class DevtoolExtractTests(DevtoolBase):
|
||||
result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True)
|
||||
self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have')
|
||||
|
||||
class DevtoolBuildImageTests(DevtoolBase):
|
||||
|
||||
def test_devtool_build_image(self):
|
||||
"""Test devtool build-image plugin"""
|
||||
# Check preconditions
|
||||
|
||||
Reference in New Issue
Block a user