Patchwork [1,of,4] test-inotify: test symlink indirection for unix sockets

login
register
mail settings
Submitter Bryan O'Sullivan
Date Dec. 19, 2012, 6:47 p.m.
Message ID <c8dfa0f461967438222e.1355942840@fedora>
Download mbox | patch
Permalink /patch/199/
State Accepted
Commit 8cbe0fed0c1fee0689f3ed2b8413033c9efb0353
Headers show

Comments

Bryan O'Sullivan - Dec. 19, 2012, 6:47 p.m.
# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1355942434 28800
# Node ID c8dfa0f461967438222e919afe39ef175a5bb7f6
# Parent  0127366df8fef5f1b1889f4387de341b94128b92
test-inotify: test symlink indirection for unix sockets

The inotify code performs a delicate dance to work around the 108-byte
limit on unix domain socket path names on Linux.

This change sets us up to safely refactor that code without breaking
it. (It is redundant with part of test-inotify-issue1208.t, but we will
shortly make that test go away.)

Patch

diff --git a/tests/test-inotify.t b/tests/test-inotify.t
--- a/tests/test-inotify.t
+++ b/tests/test-inotify.t
@@ -160,3 +160,16 @@ 
   $ kill `cat hg.pid`
 
   $ cd ..
+
+Ensure that if the repo is in a directory whose name is too long, the
+unix domain socket is reached through a symlink (issue1208).
+
+  $ mkdir 0_3456789_10_456789_20_456789_30_456789_40_456789_50_45678_
+  $ cd 0_3456789_10_456789_20_456789_30_456789_40_456789_50_45678_
+  $ mkdir 60_456789_70_456789_80_456789_90_456789_100_56789_
+  $ cd 60_456789_70_456789_80_456789_90_456789_100_56789_
+
+  $ hg --config inotify.pidfile=hg3.pid clone -q ../../repo1
+  $ readlink repo1/.hg/inotify.sock
+  */inotify.sock (glob)
+  $ kill `cat hg3.pid`