~ttx/swift/release-1.4.2

« back to all changes in this revision

Viewing changes to test/probe/test_container_failures.py

  • Committer: Tarmac
  • Author(s): gholt, FUJITA Tomonori, John Dickinson, David Goetz, John Dickinson, Joe Arnold, Scott Simpson, joe at cloudscaling, Thierry Carrez
  • Date: 2011-07-26 09:08:37 UTC
  • mfrom: (305.1.1 milestone-proposed)
  • Revision ID: tarmac-20110726090837-fwlvja8dnk7nkppw
Merge 1.4.2 development from trunk (rev331)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
import eventlet
25
25
import sqlite3
26
26
 
27
 
from swift.common import client
 
27
from swift.common import client, direct_client
28
28
from swift.common.utils import hash_path, readconf
29
29
 
30
30
from test.probe.common import get_to_final_state, kill_pids, reset_environment
72
72
        # This okay because the first node hasn't got the update that the
73
73
        # object was deleted yet.
74
74
        self.assert_(object1 in [o['name'] for o in
75
 
                     client.get_container(self.url, self.token, container)[1]])
 
75
                     direct_client.direct_get_container(cnodes[0], cpart,
 
76
                     self.account, container)[1]])
76
77
 
77
78
        # Unfortunately, the following might pass or fail, depending on the
78
79
        # position of the account server associated with the first container
88
89
        client.put_object(self.url, self.token, container, object2, 'test')
89
90
        # First node still doesn't know object1 was deleted yet; this is okay.
90
91
        self.assert_(object1 in [o['name'] for o in
91
 
                     client.get_container(self.url, self.token, container)[1]])
 
92
                     direct_client.direct_get_container(cnodes[0], cpart,
 
93
                     self.account, container)[1]])
92
94
        # And, of course, our new object2 exists.
93
95
        self.assert_(object2 in [o['name'] for o in
94
96
                     client.get_container(self.url, self.token, container)[1]])
150
152
        # server has to indicate the container exists for the put to continue.
151
153
        client.put_object(self.url, self.token, container, object2, 'test')
152
154
        self.assert_(object1 not in [o['name'] for o in
153
 
                     client.get_container(self.url, self.token, container)[1]])
 
155
                     direct_client.direct_get_container(cnodes[0], cpart,
 
156
                     self.account, container)[1]])
154
157
        # And, of course, our new object2 exists.
155
158
        self.assert_(object2 in [o['name'] for o in
156
159
                     client.get_container(self.url, self.token, container)[1]])
201
204
        # This okay because the first node hasn't got the update that the
202
205
        # object was deleted yet.
203
206
        self.assert_(object1 in [o['name'] for o in
204
 
                     client.get_container(self.url, self.token, container)[1]])
 
207
                     direct_client.direct_get_container(cnodes[0], cpart,
 
208
                     self.account, container)[1]])
205
209
 
206
210
        # This fails because all three nodes have to indicate deletion before
207
211
        # we tell the user it worked. Since the first node 409s (it hasn't got
228
232
        client.put_object(self.url, self.token, container, object2, 'test')
229
233
        # First node still doesn't know object1 was deleted yet; this is okay.
230
234
        self.assert_(object1 in [o['name'] for o in
231
 
                     client.get_container(self.url, self.token, container)[1]])
 
235
                     direct_client.direct_get_container(cnodes[0], cpart,
 
236
                     self.account, container)[1]])
232
237
        # And, of course, our new object2 exists.
233
238
        self.assert_(object2 in [o['name'] for o in
234
239
                     client.get_container(self.url, self.token, container)[1]])
277
282
        self.assert_(container in [c['name'] for c in
278
283
                     client.get_account(self.url, self.token)[1]])
279
284
        self.assert_(object1 not in [o['name'] for o in
280
 
                     client.get_container(self.url, self.token, container)[1]])
 
285
                     direct_client.direct_get_container(cnodes[0], cpart,
 
286
                     self.account, container)[1]])
281
287
 
282
288
        # This fails because all three nodes have to indicate deletion before
283
289
        # we tell the user it worked. Since the first node 409s (it hasn't got
303
309
        # server has to indicate the container exists for the put to continue.
304
310
        client.put_object(self.url, self.token, container, object2, 'test')
305
311
        self.assert_(object1 not in [o['name'] for o in
306
 
                     client.get_container(self.url, self.token, container)[1]])
 
312
                     direct_client.direct_get_container(cnodes[0], cpart,
 
313
                     self.account, container)[1]])
307
314
        # And, of course, our new object2 exists.
308
315
        self.assert_(object2 in [o['name'] for o in
309
316
                     client.get_container(self.url, self.token, container)[1]])