forked from tempesta-tech/tempesta-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare.py
More file actions
30 lines (22 loc) · 649 Bytes
/
prepare.py
File metadata and controls
30 lines (22 loc) · 649 Bytes
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
#!/usr/bin/python3
import subprocess
import sys
import os
from helpers import tf_cfg, prepare, remote
__author__ = 'Tempesta Technologies, Inc.'
__copyright__ = 'Copyright (C) 2017-2018 Tempesta Technologies, Inc.'
__license__ = 'GPL2'
tf_cfg.cfg.check()
# Redirect stderr into a file
tee = subprocess.Popen(
['tee', '-i', tf_cfg.cfg.get('General', 'log_file')],
stdin=subprocess.PIPE,
stdout=sys.stderr
)
sys.stderr.flush()
os.dup2(tee.stdin.fileno(), sys.stderr.fileno())
tee.stdin.close()
# Verbose level for unit tests must be > 1.
v_level = int(tf_cfg.cfg.get('General', 'Verbose')) + 1
remote.connect()
prepare.configure()