Merge lp:~verterok/ubuntuone-client/fix-674092-stable-1-4 into lp:ubuntuone-client/stable-1-4

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: dobey
Approved revision: 739
Merged at revision: 740
Proposed branch: lp:~verterok/ubuntuone-client/fix-674092-stable-1-4
Merge into: lp:ubuntuone-client/stable-1-4
Diff against target: 96 lines (+75/-0)
2 files modified
tests/syncdaemon/test_vm.py (+71/-0)
ubuntuone/syncdaemon/volume_manager.py (+4/-0)
To merge this branch: bzr merge lp:~verterok/ubuntuone-client/fix-674092-stable-1-4
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
John O'Brien (community) Approve
Review via email: mp+40657@code.launchpad.net

Commit message

Fix server rescan to also cleanup dead volumes after the actual volumes rescan.

Description of the change

This branch fix server rescan to also cleanup dead volumes after the actual volumes rescan.

To post a comment you must log in.
Revision history for this message
John O'Brien (jdobrien) wrote :

works on my machine

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (46.4 KiB)

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

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
  testing autoconf2.50... not found.
  testing autoconf... found 2.67
checking for automake >= 1.10...
  testing automake-1.11... found 1.11.1
checking for libtool >= 1.5...
  testing libtoolize... found 2.2.6b
checking for intltool >= 0.30...
  testing intltoolize... found 0.41.1
checking for pkg-config >= 0.14.0...
  testing pkg-config... found 0.25
Checking for required M4 macros...
Checking for forbidden M4 macros...
Processing ./configure.ac
Running libtoolize...
libtoolize: 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...
Running aclocal-1.11...
Running autoconf...
Running autoheader...
Running automake-1.11...
Running ./configure --enable-debug --with-protocol=/var/cache/tarmac/ubuntuone-storage-protocol/stable-1-4 --with-sso=/var/cache/tarmac/ubuntu-sso-client/stable-1-0 ...
checking 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... -r
checking for objdump... obj...

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (46.4 KiB)

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

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
  testing autoconf2.50... not found.
  testing autoconf... found 2.67
checking for automake >= 1.10...
  testing automake-1.11... found 1.11.1
checking for libtool >= 1.5...
  testing libtoolize... found 2.2.6b
checking for intltool >= 0.30...
  testing intltoolize... found 0.41.1
checking for pkg-config >= 0.14.0...
  testing pkg-config... found 0.25
Checking for required M4 macros...
Checking for forbidden M4 macros...
Processing ./configure.ac
Running libtoolize...
libtoolize: 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...
Running aclocal-1.11...
Running autoconf...
Running autoheader...
Running automake-1.11...
Running ./configure --enable-debug --with-protocol=/var/cache/tarmac/ubuntuone-storage-protocol/stable-1-4 --with-sso=/var/cache/tarmac/ubuntu-sso-client/stable-1-0 ...
checking 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... -r
checking for objdump... obj...

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

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

You need to install gnome-common from the GNOME source repository

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-10-20 20:08:33 +0000
3+++ tests/syncdaemon/test_vm.py 2010-11-11 18:48:53 +0000
4@@ -2266,6 +2266,77 @@
5 test_refresh_shares_called_after_server_rescan.timeout = 1
6
7 @defer.inlineCallbacks
8+ def test_server_rescan_clean_dead_udf(self):
9+ """Test cleanup of dead volumes after server_rescan method."""
10+ share_id = uuid.uuid4()
11+ share_volume = volumes.ShareVolume(share_id, 'fake_share_uuid', 1, 100,
12+ 'to_me', 'fake_share', 'username',
13+ 'visible_username', True, 'View')
14+ udf_id = uuid.uuid4()
15+ udf_volume = volumes.UDFVolume(udf_id, 'udf_node_id', 1, 200, u'~/UDF')
16+ root_id = uuid.uuid4()
17+ root_volume = volumes.RootVolume(root_id, 1, 500)
18+ response = [share_volume, udf_volume, root_volume]
19+
20+ # patch fake action queue
21+ self.main.action_q.query_volumes = lambda: defer.succeed(response)
22+ server_rescan_d = defer.Deferred()
23+ self._listen_for('SYS_SERVER_RESCAN_DONE', server_rescan_d.callback)
24+ with environ('HOME', self.home_dir):
25+ yield self.vm.server_rescan()
26+ yield server_rescan_d
27+ self.assertIn(request.ROOT, self.vm.shares)
28+ self.assertIn(str(share_volume.volume_id), self.vm.shares)
29+ self.assertEquals(1, len(self.vm.udfs))
30+ self.assertEquals(2, len(self.vm.shares))
31+ # remove the udf from the response list
32+ response = [share_volume, root_volume]
33+ server_rescan_d = defer.Deferred()
34+ self._listen_for('SYS_SERVER_RESCAN_DONE', server_rescan_d.callback)
35+ with environ('HOME', self.home_dir):
36+ yield self.vm.server_rescan()
37+ yield server_rescan_d
38+ self.assertIn(request.ROOT, self.vm.shares)
39+ self.assertIn(str(share_volume.volume_id), self.vm.shares)
40+ self.assertEquals(0, len(self.vm.udfs))
41+ self.assertEquals(2, len(self.vm.shares))
42+
43+ @defer.inlineCallbacks
44+ def test_server_rescan_clean_dead_shares(self):
45+ """Test cleanup of dead volumes after server_rescan method."""
46+ share_id = uuid.uuid4()
47+ share_volume = volumes.ShareVolume(share_id, 'fake_share_uuid', 1, 100,
48+ 'to_me', 'fake_share', 'username',
49+ 'visible_username', True, 'View')
50+ udf_id = uuid.uuid4()
51+ udf_volume = volumes.UDFVolume(udf_id, 'udf_node_id', 1, 200, u'~/UDF')
52+ root_id = uuid.uuid4()
53+ root_volume = volumes.RootVolume(root_id, 1, 500)
54+ response = [share_volume, udf_volume, root_volume]
55+ # patch fake action queue
56+ self.main.action_q.query_volumes = lambda: defer.succeed(response)
57+ server_rescan_d = defer.Deferred()
58+ self._listen_for('SYS_SERVER_RESCAN_DONE', server_rescan_d.callback)
59+ with environ('HOME', self.home_dir):
60+ yield self.vm.server_rescan()
61+ yield server_rescan_d
62+ self.assertIn(request.ROOT, self.vm.shares)
63+ self.assertIn(str(udf_volume.volume_id), self.vm.udfs)
64+ self.assertEquals(1, len(self.vm.udfs))
65+ self.assertEquals(2, len(self.vm.shares))
66+ # remove the share from the response list
67+ response = [udf_volume, root_volume]
68+ server_rescan_d = defer.Deferred()
69+ self._listen_for('SYS_SERVER_RESCAN_DONE', server_rescan_d.callback)
70+ with environ('HOME', self.home_dir):
71+ yield self.vm.server_rescan()
72+ yield server_rescan_d
73+ self.assertIn(request.ROOT, self.vm.shares)
74+ self.assertIn(str(udf_volume.volume_id), self.vm.udfs)
75+ self.assertEquals(1, len(self.vm.udfs))
76+ self.assertEquals(1, len(self.vm.shares))
77+
78+ @defer.inlineCallbacks
79 def test_volumes_rescan_cb(self):
80 """Test for _volumes_rescan_cb."""
81 share_id = uuid.uuid4()
82
83=== modified file 'ubuntuone/syncdaemon/volume_manager.py'
84--- ubuntuone/syncdaemon/volume_manager.py 2010-10-20 20:08:33 +0000
85+++ ubuntuone/syncdaemon/volume_manager.py 2010-11-11 18:48:53 +0000
86@@ -481,6 +481,10 @@
87 """Do the 'server rescan'"""
88 d = self.m.action_q.query_volumes()
89 d.addCallback(self._volumes_rescan_cb)
90+ def cleanup(result):
91+ shares, udfs = result
92+ self._cleanup_volumes(shares=shares, udfs=udfs)
93+ d.addCallbacks(cleanup)
94 def done(_):
95 self.m.event_q.push('SYS_SERVER_RESCAN_DONE')
96 def error(failure):

Subscribers

People subscribed via source and target branches