]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - tools/buildman/func_test.py
buildman: Ignore conflicting tags
[karo-tx-uboot.git] / tools / buildman / func_test.py
index 2cb5cf05fc4b4676f68c63ba9721a245d36b41ef..75eb3a97bbee72565951843be91151dc32d43689 100644 (file)
@@ -79,6 +79,7 @@ Date:   Thu Aug 14 16:48:25 2014 -0600
     Series-changes: 7
     - Add new patch to fix the 'reverse' bug
 
+    Series-version: 8
 
     Change-Id: I79078f792e8b390b8a1272a8023537821d45feda
     Reported-by: York Sun <yorksun@freescale.com>
@@ -156,6 +157,8 @@ Date:   Fri Aug 22 15:57:39 2014 -0600
     Series-changes: 9
     - Add new patch to avoid changing the order of tags
 
+    Series-version: 9
+
     Suggested-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
     Change-Id: Ib1518588c1a189ad5c3198aae76f8654aed8d0db
 """]
@@ -199,6 +202,8 @@ class TestFunctional(unittest.TestCase):
         # Map of [board, commit] to error messages
         self._error = {}
 
+        self._test_branch = TEST_BRANCH
+
         # Avoid sending any output and clear all terminal output
         terminal.SetPrintTestMode()
         terminal.GetPrintTestLines()
@@ -252,10 +257,10 @@ class TestFunctional(unittest.TestCase):
     def _HandleCommandGitLog(self, args):
         if '-n0' in args:
             return command.CommandResult(return_code=0)
-        elif args[-1] == 'upstream/master..%s' % TEST_BRANCH:
+        elif args[-1] == 'upstream/master..%s' % self._test_branch:
             return command.CommandResult(return_code=0, stdout=commit_shortlog)
         elif args[:3] == ['--no-color', '--no-decorate', '--reverse']:
-            if args[-1] == TEST_BRANCH:
+            if args[-1] == self._test_branch:
                 count = int(args[3][2:])
                 return command.CommandResult(return_code=0,
                                             stdout=''.join(commit_log[:count]))
@@ -270,9 +275,9 @@ class TestFunctional(unittest.TestCase):
             return command.CommandResult(return_code=0)
         elif config.startswith('branch.badbranch'):
             return command.CommandResult(return_code=1)
-        elif config == 'branch.%s.remote' % TEST_BRANCH:
+        elif config == 'branch.%s.remote' % self._test_branch:
             return command.CommandResult(return_code=0, stdout='upstream\n')
-        elif config == 'branch.%s.merge' % TEST_BRANCH:
+        elif config == 'branch.%s.merge' % self._test_branch:
             return command.CommandResult(return_code=0,
                                          stdout='refs/heads/master\n')
 
@@ -505,3 +510,10 @@ class TestFunctional(unittest.TestCase):
         self.assertEqual(self._builder.count, self._total_builds)
         self.assertEqual(self._builder.fail, 0)
         self.assertEqual(self._make_calls, 3)
+
+    def testBranchWithSlash(self):
+        """Test building a branch with a '/' in the name"""
+        self._test_branch = '/__dev/__testbranch'
+        self._RunControl('-b', self._test_branch, clean_dir=False)
+        self.assertEqual(self._builder.count, self._total_builds)
+        self.assertEqual(self._builder.fail, 0)