@@ -35,6 +35,8 @@ def test_write_empty_file_a():
35
35
assert_equals (local_stat .st_uid , 0 )
36
36
assert_equals (local_stat .st_gid , 0 )
37
37
38
+ time .sleep (1 )
39
+
38
40
# what does boto say?
39
41
k = settings .mount ['a' ]['conn_bucket' ].get_key (s3_file )
40
42
s3_stat = json .loads (k .metadata ['attr' ])
@@ -262,3 +264,36 @@ def test_make_directory_a():
262
264
local_b_stat = os .stat (local_b_file )
263
265
assert_equals (os .path .exists (local_b_file ), True )
264
266
267
+ def test_create_sym_link_a ():
268
+
269
+ src_fname = "/etc/passwd"
270
+
271
+ fname = "/passwd_sym_link"
272
+ local_file = settings .mount ['a' ]['local_path' ] + fname
273
+ local_b_file = settings .mount ['b' ]['local_path' ] + fname
274
+ s3_file = settings .mount ['a' ]['s3_path' ] + fname
275
+
276
+ p = Popen ("ln -s " + src_fname + " " + local_file , shell = True )
277
+ p .communicate ()
278
+
279
+ src_stat = os .stat (src_fname )
280
+
281
+ # can i access it locally?
282
+ local_stat = os .stat (local_file )
283
+ assert_equals (local_stat .st_size , src_stat .st_size )
284
+
285
+ # takes 1 second to catch up?!
286
+ time .sleep (1 )
287
+
288
+ # what does boto say?
289
+ k = settings .mount ['a' ]['conn_bucket' ].get_key (s3_file )
290
+ s3_stat = json .loads (k .metadata ['attr' ])
291
+ assert_equals (k .size , len (src_fname ))
292
+ assert_equals (s3_stat ['st_size' ], 0 )
293
+ assert_equals (s3_stat ['st_uid' ], 0 )
294
+ assert_equals (s3_stat ['st_gid' ], 0 )
295
+
296
+ # can the other mount see it?
297
+ local_b_stat = os .stat (local_b_file )
298
+ assert_equals (local_b_stat .st_size , src_stat .st_size )
299
+
0 commit comments