monotone

monotone Mtn Source Tree

Root/tests/t_netsync.at

1# -*- Autoconf -*-
2
3AT_SETUP([communicating with another monotone via netsync])
4
5MONOTONE_SETUP
6AT_CHECK(cp test.db test2.db)
7
8AT_DATA(netsync.lua, [
9function get_netsync_read_permitted(collection, identity)
10return true
11end
12
13function get_netsync_write_permitted(collection, identity)
14return true
15end
16])
17
18AT_DATA(testfile, [version 0 of test file
19])
20AT_CHECK(MONOTONE add testfile, [], [ignore], [ignore])
21AT_CHECK(MONOTONE --branch=testbranch --rcfile=netsync.lua commit blah-blah, [], [ignore], [ignore])
22F_VER0=`SHA1(testfile)`
23VER0=`SHA1(MT/manifest)`
24
25AT_DATA(testfile, [version 1 of test file
26])
27AT_CHECK(MONOTONE --rcfile=netsync.lua commit blah-blah, [], [ignore], [ignore])
28F_VER1=`SHA1(testfile)`
29VER1=`SHA1(MT/manifest)`
30
31killall -q -QUIT monotone
32
33 MONOTONE --rcfile=netsync.lua netsync server readonly 127.0.0.1:5555 testbranch >/dev/null 2>&1 &
34AT_CHECK(MONOTONE --rcfile=netsync.lua --db=test2.db netsync client writeonly 127.0.0.1:5555 testbranch, [], [ignore], [ignore])
35
36AT_CHECK(MONOTONE --db=test2.db ls certs manifest $VER0, [], [stdout])
37AT_CHECK(mv stdout certs, [], [ignore])
38AT_CHECK(grep date certs, [], [ignore])
39AT_CHECK(grep author certs, [], [ignore])
40AT_CHECK(grep branch certs, [], [ignore])
41AT_CHECK(grep changelog certs, [], [ignore])
42AT_CHECK(grep bad certs, [1], [ignore])
43
44AT_CHECK(MONOTONE --db=test2.db ls certs manifest $VER1, [], [stdout])
45AT_CHECK(mv stdout certs, [], [ignore])
46AT_CHECK(grep date certs, [], [ignore])
47AT_CHECK(grep author certs, [], [ignore])
48AT_CHECK(grep branch certs, [], [ignore])
49AT_CHECK(grep changelog certs, [], [ignore])
50AT_CHECK(grep ancestor certs, [], [ignore])
51AT_CHECK(grep bad certs, [1], [ignore])
52
53AT_CHECK(MONOTONE --db=test2.db cat manifest $VER0, [], [stdout])
54CHK=`SHA1(stdout)`
55AT_CHECK(test $CHK == $VER0)
56
57AT_CHECK(MONOTONE --db=test2.db cat manifest $VER1, [], [stdout])
58CHK=`SHA1(stdout)`
59AT_CHECK(test $CHK == $VER1)
60
61AT_CHECK(MONOTONE --db=test2.db cat file $F_VER0, [], [stdout])
62CHK=`SHA1(stdout)`
63AT_CHECK(test $CHK == $F_VER0)
64
65AT_CHECK(MONOTONE --db=test2.db cat file $F_VER1, [], [stdout])
66CHK=`SHA1(stdout)`
67AT_CHECK(test $CHK == $F_VER1)
68
69AT_CHECK(MONOTONE db info, [], [stdout])
70INFO1=`SHA1(stdout)`
71AT_CHECK(MONOTONE --db=test2.db db info, [], [stdout])
72INFO2=`SHA1(stdout)`
73AT_CHECK(test $INFO1 == $INFO2)
74
75killall -q -QUIT monotone
76
77AT_CLEANUP

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status