/
verify_kits.py
62 lines (53 loc) · 2.25 KB
/
verify_kits.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env python
import os, sys, shutil
from fabric.api import run, cd, local, get, settings, lcd
from fabric_ssh_config import getSSHInfoForHost
verifydir = "/tmp/" + os.getenv('USER') + "/verifytemp"
version = "2.8.1"
################################################
# SETUP A DIST & TOOLS IN A TEMP DIR
################################################
def setupVerifyDir(operatingsys, kitname):
global verifydir
global version
# clean out the existing dir
run("rm -rf " + verifydir)
# make the build dir again
run("mkdir -p " + verifydir)
with cd(verifydir):
run("svn co https://svn.voltdb.com/eng/trunk/tools/kit_tools")
run("curl -C - -O http://volt0/kits/candidate/%s-%s.tar.gz" % (operatingsys, kitname))
run("tar -xzf %s-%s.tar.gz" % (operatingsys, kitname))
run("rm %s-%s.tar.gz" % (operatingsys, kitname))
run("mv %s dist" % (kitname))
################################################
# RUN TESTS
################################################
def runTests():
global verifydir
global version
buildString = "Build: " + version
with cd(verifydir + "/dist/doc/tutorials/auction"):
run("%s/kit_tools/auction.exp \"%s\" || exit 1" % (verifydir, buildString))
run("%s/kit_tools/auction.sh || exit 1" % (verifydir))
with cd(verifydir + "/dist/tools"):
run("%s/kit_tools/generate.exp \"%s\" || exit 1" % (verifydir, buildString))
with cd(verifydir + "/dist/examples/voter"):
run("%s/kit_tools/voter.exp \"%s\" || exit 1" % (verifydir, buildString))
with cd(verifydir + "/dist/examples/voltkv"):
run("%s/kit_tools/voltkv.exp \"%s\" || exit 1" % (verifydir, buildString))
# get ssh config
volt5f = getSSHInfoForHost("volt5f")
voltmini = getSSHInfoForHost("voltmini")
# test kits on 5f
with settings(host_string=volt5f[1],disable_known_hosts=True,key_filename=volt5f[0]):
setupVerifyDir("LINUX", "voltdb-%s" % version)
runTests()
setupVerifyDir("LINUX", "voltdb-ent-%s" % version)
runTests()
# test kits on mini
with settings(host_string=voltmini[1],disable_known_hosts=True,key_filename=voltmini[0]):
setupVerifyDir("MAC", "voltdb-%s" % version)
runTests()
setupVerifyDir("MAC", "voltdb-ent-%s" % version)
runTests()