Rev 4678: (vila) Fix some test failures on FreeBSD in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Tue Sep 8 04:56:17 BST 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4678 [merge]
revision-id: pqm at pqm.ubuntu.com-20090908035617-cim7fx49sqgmbv6f
parent: pqm at pqm.ubuntu.com-20090907145517-70waesydou0uk4tk
parent: v.ladeuil+lp at free.fr-20090908032031-7f4x11h3evc4bx82
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Tue 2009-09-08 04:56:17 +0100
message:
  (vila) Fix some test failures on FreeBSD
modified:
  bzrlib/tests/blackbox/test_breakin.py test_breakin.py-20070424043903-qyy6zm4pj3h4sbp3-1
  bzrlib/tests/blackbox/test_remove.py test_remove.py-20060530011439-fika5rm84lon0goe-1
  bzrlib/tests/per_branch/test_permissions.py test_permissions.py-20060210110243-245c01403bf0fde6
  bzrlib/tests/test_permissions.py test_permissions.py-20051215004520-ccf475789c80e80c
=== modified file 'bzrlib/tests/blackbox/test_breakin.py'
--- a/bzrlib/tests/blackbox/test_breakin.py	2009-07-31 14:56:55 +0000
+++ b/bzrlib/tests/blackbox/test_breakin.py	2009-09-07 08:41:47 +0000
@@ -127,7 +127,7 @@
                 #       instead. Most notably, the WNOHANG isn't allowed, so
                 #       this can hang indefinitely.
                 pid_killed, returncode = os.waitpid(pid, opts)
-                if (pid_killed, returncode) != (0, 0):
+                if pid_killed != 0 and returncode != 0:
                     if sig is not None:
                         # high bit in low byte says if core was dumped; we
                         # don't care

=== modified file 'bzrlib/tests/blackbox/test_remove.py'
--- a/bzrlib/tests/blackbox/test_remove.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/blackbox/test_remove.py	2009-09-07 08:52:04 +0000
@@ -61,15 +61,18 @@
         f.write("\nsome other new content!")
         f.close()
 
-    def run_bzr_remove_changed_files(self, error_regexes, files_to_remove):
+    def run_bzr_remove_changed_files(self, error_regexes, files_to_remove,
+                                     working_dir=None):
         error_regexes.extend(["Can't safely remove modified or unknown files:",
             'Use --keep to not delete them,'
             ' or --force to delete them regardless.'
             ])
         self.run_bzr_error(error_regexes,
-            ['remove'] + list(files_to_remove))
+                           ['remove'] + list(files_to_remove),
+                           working_dir=working_dir)
         #see if we can force it now
-        self.run_bzr(['remove', '--force'] + list(files_to_remove))
+        self.run_bzr(['remove', '--force'] + list(files_to_remove),
+                     working_dir=working_dir)
 
     def test_remove_new_no_files_specified(self):
         tree = self.make_branch_and_tree('.')
@@ -196,10 +199,9 @@
         self.run_bzr("commit -m 'added files'")
         self.changeFile(a)
         self.changeFile(c)
-        os.chdir('b')
-        self.run_bzr_remove_changed_files(['modified:[.\s]*a[.\s]*b/c'],
-            ['../a', 'c', '.', '../d'])
-        os.chdir('..')
+        self.run_bzr_remove_changed_files(
+            ['modified:[.\s]*a[.\s]*b/c'],
+            ['../a', 'c', '.', '../d'], working_dir='b')
         self.assertNotInWorkingTree(files)
         self.failIfExists(files)
 

=== modified file 'bzrlib/tests/per_branch/test_permissions.py'
--- a/bzrlib/tests/per_branch/test_permissions.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/per_branch/test_permissions.py	2009-09-07 08:46:00 +0000
@@ -91,10 +91,10 @@
                                           ' permission logic')
         if sys.platform == 'win32':
             raise tests.TestNotApplicable('chmod has no effect on win32')
-        elif sys.platform == 'darwin':
-            # OS X creates temp dirs with the 'wheel' group, which users are
-            # not likely to be in, and this prevents us from setting the sgid
-            # bit
+        elif sys.platform == 'darwin' or sys.platform.startswith('freebsd'):
+            # OS X (and FreeBSD) create temp dirs with the 'wheel' group, which
+            # users are not likely to be in, and this prevents us from setting
+            # the sgid bit
             os.chown(self.test_dir, os.getuid(), os.getgid())
         # also, these are BzrBranch format specific things..
         t = self.make_branch_and_tree('.')

=== modified file 'bzrlib/tests/test_permissions.py'
--- a/bzrlib/tests/test_permissions.py	2009-03-23 14:59:43 +0000
+++ b/bzrlib/tests/test_permissions.py	2009-09-07 08:46:00 +0000
@@ -140,10 +140,10 @@
     def test_new_files_group_sticky_bit(self):
         if sys.platform == 'win32':
             raise TestSkipped('chmod has no effect on win32')
-        elif sys.platform == 'darwin':
-            # OS X creates temp dirs with the 'wheel' group, which users are
-            # not likely to be in, and this prevents us from setting the sgid
-            # bit
+        elif sys.platform == 'darwin' or sys.platform.startswith('freebsd'):
+            # OS X (and FreeBSD) create temp dirs with the 'wheel' group, which
+            # users are not likely to be in, and this prevents us from setting
+            # the sgid bit
             os.chown(self.test_dir, os.getuid(), os.getgid())
 
         t = self.make_branch_and_tree('.')




More information about the bazaar-commits mailing list