monotone

monotone Mtn Source Tree

Root/testsuite.at

1# -*- Autoconf -*-
2#
3# the monotone integration testsuite is written in bourne shell,
4# strung together with the autotest framework (part of autoconf).
5#
6# it's a bit icky but it's better than the hand-written thing we were
7# using before, and it's *certainly* more user friendly than dejagnu,
8# and we need *some* tests which run "as the user would run them".
9# bourne shell scripts are pretty close to that.
10#
11
12AT_INIT([integration tests])
13AT_TESTED([monotone])
14
15# some command abbreviations to make life easier
16
17m4_define([MONOTONE], [monotone --rcfile=test_hooks.lua --nostd --norc --db=test.db --key=tester@test.net])
18m4_define([SHA1], [sha1sum $1 | cut -d ' ' -f 1])
19
20# the MONOTONE_SETUP macro deploys the standard lua hooks and loads the
21# standard testing key, which we use for further tests.
22
23m4_define([MONOTONE_SETUP], [
24
25AT_DATA(test_keys, [@<:@pubkey tester@test.net@:>@
26MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQCfN/cAMabgb6T7m8ksGnpQ7LO6hOdnc/7V
27yivrRGtmpwSItljht1bmgLQF37KiSPoMEDUb1stfKxaMsYiy8iTyoQ+M2EVFP37n2rtnNZ0H
28oVcQd2sRsCerQFh9nslRPymlkQXUlOiNFN6RlFNcdjkucqNe+YorFX21EYw7XuT5XwIBEQ==
29@<:@end@:>@
30@<:@privkey tester@test.net@:>@
31npy0jyqbZdylFkMjdR9OvlqmDHuBGXpGFPt94h96aG+Lp+OdBCmWx8GueHk8FKkexwPqhRBM
32PPopUeuwqxuSX+yEodMl5IHBmin0nLnbOeBjtasjemBFEmdNl/jPDF/AeQ2WHhanB731dSQc
33vzLOQfKAYmfk56PPULi9oJJNUxaCkvsWtvaI+HUHZrjyyV7dA4Vsc6Jvx2Yf1+MdDAEGk/Rw
34ZtP0LmuoiyvRDFqBF8aTmnotyb4kRKohnJ7VF+y6hYvmtMpM3TKnpR7EbojBzNPqKuO7nPUz
35jGxA7F84O24Vbf128PNSI5vj4istow26aPjn28qPjfRrkV30WLL/dXfYJkfkTqglYnoEXvF/
36xZoVxxNeAX58mgy0A1ErVxv8U7TwuP983GHEpLwy3gbiP+9akAJCr8r823DHmQqq5QDELibP
37cuXZfOttpfVRkcbMhjeF0M6czc4HoKgHTAnf/18hzdZwGX/WWvRIBHImbUJ+mDbp2ByDTfKf
38ErGXSvZ3HxCqBD8yx1SnXhV8IDHaBmV9wwYcN+H2cxOWGZk7g7xJS19+a3UQB3c3sSXQVJBp
396QpCZgysxkZwzuXDzzLZPT9SLZz4K2p7+7BwMbpy9ZxcyAzmiEtpA24UP06jtjFN7WcXAdx/
40E5Gmoe9b1EiXWdReHjUGpc6k0LQ0PPXAwqrcGdwYbOLDZ5xsQ5AsEYSFtyTS60D1nHBcdNmW
41M0eOUJFdJf/uNe/2EApc3a8TyEkZtVqiYtOVV3qDB9NmU4bVOkDqzl1F7zJwATWbmasSdkM3
426lxDkczBfCrEjH5p5Y8DU+ge4e4LRtknY9oBOJ7EQO0twYJg3k0=
43@<:@end@:>@
44])
45
46AT_DATA(test_hooks.lua, [
47-- this is the "testing" set of lua hooks for monotone
48-- it's intended to support self-tests, not for use in
49-- production. just overrides some of the std hooks.
50
51function get_passphrase(keyid)
52return keyid
53end
54
55function non_blocking_rng_ok()
56return true
57end
58
59function get_manifest_cert_trust(signers, id, name, val)
60 return true
61end
62
63function get_file_cert_trust(signers, id, name, val)
64 return true
65end
66
67function accept_testresult_change(old_results, new_results)
68 for test,res in pairs(old_results)
69 do
70 if res == true and new_results@<:@test@:>@ ~= true
71 then
72 return false
73 end
74 end
75 return true
76end
77
78function get_author(branchname)
79return "tester@test.net"
80end
81
82function ignore_file(name)
83if (strfind(name, "test_hooks.lua")) then return true end
84if (strfind(name, "test.db")) then return true end
85return false
86end
87
88])
89
90AT_CHECK(MONOTONE db init, [], [ignore], [ignore])
91AT_CHECK(MONOTONE read <test_keys, [], [ignore], [ignore])
92AT_CHECK(rm test_keys)
93])
94
95# run as PROBE_NODE(filename, msha, fsha)
96m4_define([PROBE_NODE], [
97AT_CHECK(rm MT/manifest)
98AT_CHECK(rm $1)
99AT_CHECK(MONOTONE checkout $2 ., [], [ignore])
100PROBE_M_SHA=`SHA1(MT/manifest)`
101PROBE_F_SHA=`SHA1($1)`
102AT_CHECK(test $PROBE_M_SHA == $2)
103AT_CHECK(test $PROBE_F_SHA == $3)
104])
105
106
107# include all the sub-tests we're going to use
108
109m4_include(tests/t_null.at)
110m4_include(tests/t_scan.at)
111m4_include(tests/t_import.at)
112m4_include(tests/t_genkey.at)
113m4_include(tests/t_unidiff.at)
114m4_include(tests/t_persist_phrase.at)
115m4_include(tests/t_versions.at)
116m4_include(tests/t_fork.at)
117m4_include(tests/t_update.at)
118m4_include(tests/t_merge.at)
119m4_include(tests/t_nntp.at)
120m4_include(tests/t_http.at)
121m4_include(tests/t_unidiff2.at)
122m4_include(tests/t_cwork.at)
123m4_include(tests/t_revert.at)
124m4_include(tests/t_drop.at)
125m4_include(tests/t_cross.at)
126m4_include(tests/t_rename.at)
127m4_include(tests/t_renamed.at)
128m4_include(tests/t_erename.at)
129m4_include(tests/t_smtp.at)
130m4_include(tests/t_cvsimport.at)
131m4_include(tests/t_proxy.at)
132m4_include(tests/t_i18n_file.at)
133m4_include(tests/t_fmerge.at)
134m4_include(tests/t_netsync.at)
135m4_include(tests/t_disapprove.at)
136m4_include(tests/t_testresult.at)

Archive Download this file

Branches

Tags

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