Mercurial > hg
annotate tests/test-chg.t @ 31251:34d57ddaf9f2
vfs: use 'vfs' module directly in 'test-filecache'
Now that the 'vfs' classes moved in their own module, lets use the new module
directly. We update code iteratively to help with possible bisect needs in the
future.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 02 Mar 2017 13:33:28 +0100 |
parents | fbce78c58f1e |
children | ca7af5d15b21 |
rev | line source |
---|---|
29274
148a9a5379f0
test-chg: run only with chg
Yuya Nishihara <yuya@tcha.org>
parents:
29088
diff
changeset
|
1 #require chg |
148a9a5379f0
test-chg: run only with chg
Yuya Nishihara <yuya@tcha.org>
parents:
29088
diff
changeset
|
2 |
29275
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
3 $ cp $HGRCPATH $HGRCPATH.orig |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
4 |
28516
3bf2892f685f
chgserver: handle ParseError during validate
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
5 init repo |
3bf2892f685f
chgserver: handle ParseError during validate
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
6 |
29274
148a9a5379f0
test-chg: run only with chg
Yuya Nishihara <yuya@tcha.org>
parents:
29088
diff
changeset
|
7 $ chg init foo |
28516
3bf2892f685f
chgserver: handle ParseError during validate
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
8 $ cd foo |
3bf2892f685f
chgserver: handle ParseError during validate
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
9 |
3bf2892f685f
chgserver: handle ParseError during validate
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
10 ill-formed config |
3bf2892f685f
chgserver: handle ParseError during validate
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
11 |
29274
148a9a5379f0
test-chg: run only with chg
Yuya Nishihara <yuya@tcha.org>
parents:
29088
diff
changeset
|
12 $ chg status |
28516
3bf2892f685f
chgserver: handle ParseError during validate
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
13 $ echo '=brokenconfig' >> $HGRCPATH |
29274
148a9a5379f0
test-chg: run only with chg
Yuya Nishihara <yuya@tcha.org>
parents:
29088
diff
changeset
|
14 $ chg status |
28516
3bf2892f685f
chgserver: handle ParseError during validate
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
15 hg: parse error at * (glob) |
3bf2892f685f
chgserver: handle ParseError during validate
Jun Wu <quark@fb.com>
parents:
diff
changeset
|
16 [255] |
29088 | 17 |
29275
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
18 $ cp $HGRCPATH.orig $HGRCPATH |
30677 | 19 |
20 long socket path | |
21 | |
22 $ sockpath=$TESTTMP/this/path/should/be/longer/than/one-hundred-and-seven/characters/where/107/is/the/typical/size/limit/of/unix-domain-socket | |
23 $ mkdir -p $sockpath | |
24 $ bakchgsockname=$CHGSOCKNAME | |
25 $ CHGSOCKNAME=$sockpath/server | |
26 $ export CHGSOCKNAME | |
27 $ chg root | |
28 $TESTTMP/foo | |
29 $ rm -rf $sockpath | |
30 $ CHGSOCKNAME=$bakchgsockname | |
31 $ export CHGSOCKNAME | |
32 | |
29275
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
33 $ cd .. |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
34 |
31107
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
35 editor |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
36 ------ |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
37 |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
38 $ cat >> pushbuffer.py <<EOF |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
39 > def reposetup(ui, repo): |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
40 > repo.ui.pushbuffer(subproc=True) |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
41 > EOF |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
42 |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
43 $ chg init editor |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
44 $ cd editor |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
45 |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
46 by default, system() should be redirected to the client: |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
47 |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
48 $ touch foo |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
49 $ CHGDEBUG= HGEDITOR=cat chg ci -Am channeled --edit 2>&1 \ |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
50 > | egrep "HG:|run 'cat" |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
51 chg: debug: run 'cat "*"' at '$TESTTMP/editor' (glob) |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
52 HG: Enter commit message. Lines beginning with 'HG:' are removed. |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
53 HG: Leave message empty to abort commit. |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
54 HG: -- |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
55 HG: user: test |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
56 HG: branch 'default' |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
57 HG: added foo |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
58 |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
59 but no redirection should be made if output is captured: |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
60 |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
61 $ touch bar |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
62 $ CHGDEBUG= HGEDITOR=cat chg ci -Am bufferred --edit \ |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
63 > --config extensions.pushbuffer="$TESTTMP/pushbuffer.py" 2>&1 \ |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
64 > | egrep "HG:|run 'cat" |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
65 [1] |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
66 |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
67 check that commit commands succeeded: |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
68 |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
69 $ hg log -T '{rev}:{desc}\n' |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
70 1:bufferred |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
71 0:channeled |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
72 |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
73 $ cd .. |
fbce78c58f1e
chg: refactor ui.system() to be partly overridden
Yuya Nishihara <yuya@tcha.org>
parents:
30847
diff
changeset
|
74 |
30847
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
75 pager |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
76 ----- |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
77 |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
78 $ cat >> fakepager.py <<EOF |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
79 > import sys |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
80 > for line in sys.stdin: |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
81 > sys.stdout.write('paged! %r\n' % line) |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
82 > EOF |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
83 |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
84 enable pager extension globally, but spawns the master server with no tty: |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
85 |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
86 $ chg init pager |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
87 $ cd pager |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
88 $ cat >> $HGRCPATH <<EOF |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
89 > [extensions] |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
90 > pager = |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
91 > [pager] |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
92 > pager = python $TESTTMP/fakepager.py |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
93 > EOF |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
94 $ chg version > /dev/null |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
95 $ touch foo |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
96 $ chg ci -qAm foo |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
97 |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
98 pager should be enabled if the attached client has a tty: |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
99 |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
100 $ chg log -l1 -q --config ui.formatted=True |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
101 paged! '0:1f7b0de80e11\n' |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
102 $ chg log -l1 -q --config ui.formatted=False |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
103 0:1f7b0de80e11 |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
104 |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
105 $ cd .. |
e12553cfd0a4
pager: wrap _runcommand() no matter if stdout is redirected
Yuya Nishihara <yuya@tcha.org>
parents:
30677
diff
changeset
|
106 |
29275
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
107 server lifecycle |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
108 ---------------- |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
109 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
110 chg server should be restarted on code change, and old server will shut down |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
111 automatically. In this test, we use the following time parameters: |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
112 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
113 - "sleep 1" to make mtime different |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
114 - "sleep 2" to notice mtime change (polling interval is 1 sec) |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
115 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
116 set up repository with an extension: |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
117 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
118 $ chg init extreload |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
119 $ cd extreload |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
120 $ touch dummyext.py |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
121 $ cat <<EOF >> .hg/hgrc |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
122 > [extensions] |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
123 > dummyext = dummyext.py |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
124 > EOF |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
125 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
126 isolate socket directory for stable result: |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
127 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
128 $ OLDCHGSOCKNAME=$CHGSOCKNAME |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
129 $ mkdir chgsock |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
130 $ CHGSOCKNAME=`pwd`/chgsock/server |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
131 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
132 warm up server: |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
133 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
134 $ CHGDEBUG= chg log 2>&1 | egrep 'instruction|start' |
30620
937c52f06709
chg: start server at a unique address
Jun Wu <quark@fb.com>
parents:
29343
diff
changeset
|
135 chg: debug: start cmdserver at $TESTTMP/extreload/chgsock/server.* (glob) |
29275
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
136 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
137 new server should be started if extension modified: |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
138 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
139 $ sleep 1 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
140 $ touch dummyext.py |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
141 $ CHGDEBUG= chg log 2>&1 | egrep 'instruction|start' |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
142 chg: debug: instruction: unlink $TESTTMP/extreload/chgsock/server-* (glob) |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
143 chg: debug: instruction: reconnect |
30620
937c52f06709
chg: start server at a unique address
Jun Wu <quark@fb.com>
parents:
29343
diff
changeset
|
144 chg: debug: start cmdserver at $TESTTMP/extreload/chgsock/server.* (glob) |
29275
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
145 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
146 old server will shut down, while new server should still be reachable: |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
147 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
148 $ sleep 2 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
149 $ CHGDEBUG= chg log 2>&1 | (egrep 'instruction|start' || true) |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
150 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
151 socket file should never be unlinked by old server: |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
152 (simulates unowned socket by updating mtime, which makes sure server exits |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
153 at polling cycle) |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
154 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
155 $ ls chgsock/server-* |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
156 chgsock/server-* (glob) |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
157 $ touch chgsock/server-* |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
158 $ sleep 2 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
159 $ ls chgsock/server-* |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
160 chgsock/server-* (glob) |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
161 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
162 since no server is reachable from socket file, new server should be started: |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
163 (this test makes sure that old server shut down automatically) |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
164 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
165 $ CHGDEBUG= chg log 2>&1 | egrep 'instruction|start' |
30620
937c52f06709
chg: start server at a unique address
Jun Wu <quark@fb.com>
parents:
29343
diff
changeset
|
166 chg: debug: start cmdserver at $TESTTMP/extreload/chgsock/server.* (glob) |
29275
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
167 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
168 shut down servers and restore environment: |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
169 |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
170 $ rm -R chgsock |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
171 $ CHGSOCKNAME=$OLDCHGSOCKNAME |
e53f961ac75f
test-chg: add basic tests for server lifecycle
Yuya Nishihara <yuya@tcha.org>
parents:
29274
diff
changeset
|
172 $ cd .. |