-
Notifications
You must be signed in to change notification settings - Fork 6
/
fabfile.py
91 lines (64 loc) · 1.98 KB
/
fabfile.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from fabric.api import local, run, cd, env, hosts, put
from io import BytesIO
import git
import re
from six.moves import shlex_quote
env.hosts = ["venti", "ventiquattro", "ventotto", "sette", "otto"]
env.use_ssh_config = True
def cmd(*args):
return " ".join(shlex_quote(a) for a in args)
def configure():
res = run(cmd("rpm", "--eval", "%configure --enable-arpae-tests"))
put(BytesIO(b"\n".join(res.stdout.splitlines())), "rpm-config")
run(cmd("chmod", "0755", "rpm-config"))
run(cmd("./rpm-config"))
def push(host):
repo = git.Repo()
remote = repo.remote(host)
push_url = remote.config_reader.get("url")
remote_dir = re.sub(r"^ssh://[^/]+", "", push_url)
local(cmd("git", "push", host, "HEAD", "--force"))
with cd(remote_dir):
run(cmd("git", "reset", "--hard"))
run(cmd("git", "clean", "-fx"))
run(cmd("git", "checkout", "-B", "test_" + host, repo.head.commit.hexsha))
run(cmd("git", "clean", "-fx"))
run(cmd("autoreconf", "-if"))
configure()
def run_test(host):
push(host)
repo = git.Repo()
remote = repo.remote(host)
push_url = remote.config_reader.get("url")
remote_dir = re.sub(r"^ssh://[^/]+", "", push_url)
with cd(remote_dir):
run(cmd("make", "-j2"))
run(cmd("make", "check", "-j2", "TEST_VERBOSE=1"))
@hosts("venti")
def test_venti():
run_test("venti")
@hosts("ventiquattro")
def test_ventiquattro():
run_test("ventiquattro")
@hosts("ventotto")
def test_ventotto():
run_test("ventotto")
@hosts("sette")
def test_sette():
run_test("sette")
@hosts("otto")
def test_otto():
run_test("otto")
@hosts("trentadue")
def test_trentadue():
run_test("trentadue")
@hosts("trentaquattro")
def test_trentaquattro():
run_test("trentaquattro")
def test():
test_venti()
test_ventiquattro()