Merge lp:~verterok/ubuntuone-client/fix-452682 into lp:ubuntuone-client

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: dobey
Approved revision: 522
Merged at revision: 523
Proposed branch: lp:~verterok/ubuntuone-client/fix-452682
Merge into: lp:ubuntuone-client
Diff against target: 45 lines (+17/-0)
2 files modified
tests/syncdaemon/test_vm.py (+13/-0)
ubuntuone/syncdaemon/volume_manager.py (+4/-0)
To merge this branch: bzr merge lp:~verterok/ubuntuone-client/fix-452682
Reviewer Review Type Date Requested Status
Joshua Hoover (community) ran branch and verified fix Approve
Roman Yepishev (community) Approve
dobey (community) Approve
Review via email: mp+25785@code.launchpad.net

This proposal supersedes a proposal from 2010-05-18.

Commit message

Fix 'Shared With Me' symlink if the target was changed and the link is broken.

Description of the change

Fix 'Shared With Me' symlink if the target was changed and the link is broken.

To post a comment you must log in.
Revision history for this message
Joshua Hoover (joshuahoover) wrote : Posted in a previous version of this proposal

Passed test in bug #452682.

review: Approve (ran branch and verified fix)
Revision history for this message
Roman Yepishev (rye) wrote : Posted in a previous version of this proposal

Tested locally - 'Shared With Me' link is recreated properly.

review: Approve
Revision history for this message
dobey (dobey) wrote : Posted in a previous version of this proposal
Download full text (122.3 KiB)

The attempt to merge lp:~verterok/ubuntuone-client/fix-452682 into lp:ubuntuone-client failed.Below is the output from the failed tests.

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
(B testing autoconf2.50... not found.
  testing autoconf... found 2.65
checking for automake >= 1.10...
(B testing automake-1.11... found 1.11.1
checking for libtool >= 1.5...
(B testing libtoolize... found 2.2.6b
checking for intltool >= 0.30...
(B testing intltoolize... found 0.41.0
checking for pkg-config >= 0.14.0...
(B testing pkg-config... found 0.22
Checking for required M4 macros...
(BChecking for forbidden M4 macros...
(BProcessing ./configure.ac
(BRunning libtoolize...
(Blibtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
Running intltoolize...
(BRunning aclocal-1.11...
(BRunning autoconf...
(BRunning autoheader...
(BRunning automake-1.11...
(BRunning ./configure --with-protocol=/tmp/ubuntuone-storage-protocol ...
(Bchecking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for library containing strerror... none required
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... ...

Revision history for this message
Guillermo Gonzalez (verterok) wrote : Posted in a previous version of this proposal

Hi,

I can't reproduce this failure :(
I tried to run the tests outside my home and all tests pass.

Revision history for this message
dobey (dobey) wrote : Posted in a previous version of this proposal
Download full text (97.8 KiB)

The attempt to merge lp:~verterok/ubuntuone-client/fix-452682 into lp:ubuntuone-client failed.Below is the output from the failed tests.

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
(B testing autoconf2.50... not found.
  testing autoconf... found 2.65
checking for automake >= 1.10...
(B testing automake-1.11... found 1.11.1
checking for libtool >= 1.5...
(B testing libtoolize... found 2.2.6b
checking for intltool >= 0.30...
(B testing intltoolize... found 0.41.0
checking for pkg-config >= 0.14.0...
(B testing pkg-config... found 0.22
Checking for required M4 macros...
(BChecking for forbidden M4 macros...
(BProcessing ./configure.ac
(BRunning libtoolize...
(Blibtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
Running intltoolize...
(BRunning aclocal-1.11...
(BRunning autoconf...
(BRunning autoheader...
(BRunning automake-1.11...
(BRunning ./configure --with-protocol=/tmp/ubuntuone-storage-protocol ...
(Bchecking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for library containing strerror... none required
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... ...

Revision history for this message
dobey (dobey) wrote : Posted in a previous version of this proposal

I can reliably recreate these test failures when running make test in /tmp/ubuntuone-client where tarmac attempts to merge the tree.

review: Needs Fixing
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Roman Yepishev (rye) wrote :

<rye> verterok, is it supposed to fix ln -s /tmp "$HOME/Ubuntu One/Shared With Me" ?
<verterok> rye: only broken symlinks not poiting to the real shares directory
<verterok> rye: e.g: ln -s foobar "$HOME/Ubuntu One/Shared With Me"

review: Approve
Revision history for this message
Joshua Hoover (joshuahoover) wrote :

Passed test case for #452682. Tested updated branch.

review: Approve (ran branch and verified fix)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/syncdaemon/test_vm.py'
2--- tests/syncdaemon/test_vm.py 2010-05-17 16:17:26 +0000
3+++ tests/syncdaemon/test_vm.py 2010-05-21 15:00:55 +0000
4@@ -1785,6 +1785,7 @@
5 self.assertEquals(result[0], udf_path)
6 self.assertEquals(result[1], "UDFs can not be a symlink")
7
8+
9 class MetadataTestCase(BaseTwistedTestCase):
10 md_version_None = False
11 main = None
12@@ -2677,6 +2678,18 @@
13 self.assertTrue(isinstance(share, _Share))
14 self.assertTrue(isinstance(old_share, _Share))
15
16+ def test_broken_symlink_latest_metadata(self):
17+ """Test vm startup with latest metadata and a broken symlink."""
18+ self._build_layout_version_4()
19+ os.unlink(self.shares_dir_link)
20+ # create a broken link
21+ os.symlink('foo', self.shares_dir_link)
22+ # we want to keep a refernece to main in order to shutdown
23+ # pylint: disable-msg=W0201
24+ self.main = FakeMain(self.root_dir, self.shares_dir,
25+ self.data_dir, self.partials_dir)
26+ self.check_version()
27+
28
29 class BrokenOldMDVersionUpgradeTests(MetadataOldLayoutTests):
30 """MetadataOldLayoutTests with broken .version file."""
31
32=== modified file 'ubuntuone/syncdaemon/volume_manager.py'
33--- ubuntuone/syncdaemon/volume_manager.py 2010-05-17 14:44:03 +0000
34+++ ubuntuone/syncdaemon/volume_manager.py 2010-05-21 15:00:55 +0000
35@@ -309,6 +309,10 @@
36 if not os.path.exists(self.m.shares_dir_link):
37 self.log.debug('creating Shares symlink: %r -> %r',
38 self.m.shares_dir_link, self.m.shares_dir)
39+ # remove the symlink if it's broken
40+ if os.path.islink(self.m.shares_dir_link) and \
41+ os.readlink(self.m.shares_dir_link) != self.m.shares_dir:
42+ os.remove(self.m.shares_dir_link)
43 os.symlink(self.m.shares_dir, self.m.shares_dir_link)
44 # make the shares_dir read only
45 os.chmod(self.m.shares_dir, 0555)

Subscribers

People subscribed via source and target branches