monotone

monotone Commit Details

Date:2010-11-20 07:25:56 (8 years 6 months ago)
Author:Timothy Brownawell
Branch:net.venge.monotone
Commit:b97a29163d6166d6d5e1d15f437f8325ac987070
Parents: c26b91d1884512efa7adf1b209f207d142c03606
Message:Fix netsync_negotiation test to actually work with real previous-version monotones.

Changes:
Atests/netsync_negotiation/netsync7.lua (full)
Mtests/netsync_negotiation/__driver__.lua (3 diffs)
Mtests/netsync_negotiation/netsync6.lua (1 diff)

File differences

tests/netsync_negotiation/__driver__.lua
1515
1616
1717
18
19
20
21
1822
19
23
2024
2125
2226
......
7680
7781
7882
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
7999
80100
81101
......
96116
97117
98118
99
100
119
120
101121
102122
103123
else
rcfile = "test_hooks.lua"
end
local nostd = "--no-standard-rcfiles"
if ver < 8 then
nostd = "--nostd"
end
local fn = function (...)
return {exe, "--no-standard-rcfiles", "--root=.",
return {exe, nostd, "--root=.",
"--confdir=.",
"--rcfile="..rcfile,
"--key=tester@test.net",
check(my_mtn("commit", "--message=child commit"), 0, nil, false)
end
function check_same_revs(cmd1, cmd2)
check(cmd1, 0, true, false)
local data1 = {}
for l in io.lines("stdout") do table.insert(data1, l) end
check(cmd2, 0, true, false)
local data2 = {}
for l in io.lines("stdout") do table.insert(data2, l) end
L("Command 1 has ", table.getn(data1), " lines.")
L("Command 2 has ", table.getn(data2), " lines.")
check(table.getn(data1) == table.getn(data2))
for i = 1, table.getn(data1) do
local hash_len = 40
check(data1[i]:sub(1, hash_len) == data2[i]:sub(1, hash_len))
end
end
function check_pair(client, server)
-- setup database contents
client.reset()
-- check for correct/matching contents
check_same_stdout(client.fn("automate", "select", "i:"),
server.fn("automate", "select", "i:"))
check_same_stdout(client.fn("heads", "--branch=testbranch"),
server.fn("heads", "--branch=testbranch"))
check_same_revs(client.fn("heads", "--branch=testbranch"),
server.fn("heads", "--branch=testbranch"))
-- there should be 13 certs - 4 per rev, plus an extra date cert
-- on the common base revision
check(client.fn("db", "info"), 0, true)
tests/netsync_negotiation/netsync6.lua
22
33
44
5
6
7
function get_passphrase(key)
return key
end
function get_revision_cert_trust()
return true
end
tests/netsync_negotiation/netsync7.lua
1
2
3
4
include("test_hooks.lua")
function get_revision_cert_trust()
return true
end

Archive Download the corresponding diff file

Branches

Tags

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