]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oeqa/selftest/devtool: ensure Git username is set before upgrade tests
authorRoss Burton <ross@burtonini.com>
Thu, 31 Mar 2022 18:28:55 +0000 (19:28 +0100)
committerAnuj Mittal <anuj.mittal@intel.com>
Thu, 7 Apr 2022 06:40:14 +0000 (14:40 +0800)
The 'devtool upgrade' tests fail if Git doesn't know the user's name or
email, so verify this before the tests start and skip if it is not.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
(cherry picked from commit b4d8aca97a1ead38ce55f3bb5859d3d05d9dd84f)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/lib/oeqa/selftest/cases/devtool.py

index a2b4d7f7d11f39ea7f76298816fc326575a9eec3..1fe0628a44e59e9a0e4cdd8a6ef8b5c43575906f 100644 (file)
@@ -1464,6 +1464,14 @@ class DevtoolExtractTests(DevtoolBase):
 
 class DevtoolUpgradeTests(DevtoolBase):
 
+    def setUp(self):
+        super().setUp()
+        try:
+            runCmd("git config --global user.name")
+            runCmd("git config --global user.email")
+        except:
+            self.skip("Git user.name and user.email must be set")
+
     def test_devtool_upgrade(self):
         # Check preconditions
         self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')