blob: 508ff6e006e8961bcff1899b21149ffc7c35f6b6 (
plain)
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
|
#!/usr/bin/env python3
# stdlib imports
import atexit
import sys
import subprocess
# stdlib "from" imports
from pathlib import Path
# local imports
from config import Config
assert __name__ == "__main__", "Can't determine script dir"
_SCRIPT_DIR = Path(sys.argv[0]).parent.resolve()
subprocess.check_call([_SCRIPT_DIR.joinpath("setup")])
config = Config.load_json(Path(_SCRIPT_DIR).joinpath("arti.run.json"))
config.export_env()
# initialize the network
subprocess.check_call([_SCRIPT_DIR.joinpath("init")])
# Try to ensure we tear down the network on exit, including failure, ctrl-c, etc.
atexit.register(lambda: subprocess.check_call([_SCRIPT_DIR.joinpath("teardown")]))
# bootstrap the network
subprocess.check_call([config.chutney, "bootstrap"])
# test the network
subprocess.check_call([_SCRIPT_DIR.joinpath("test"), "-v"])
|