-
Notifications
You must be signed in to change notification settings - Fork 0
/
reset.py
executable file
·56 lines (51 loc) · 1.64 KB
/
reset.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
# Copyright (C) 2012-2020 MIPS Tech LLC
# Written by Matthew Fortune <[email protected]> and
# Daniel Sanders <[email protected]>
# This file is part of Overtest.
#
# Overtest is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# Overtest is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with overtest; see the file COPYING. If not, write to the Free
# Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
# 02110-1301, USA.
#!/usr/bin/python
import VersionCheck
from OvtDB import OvtDB
import getopt
import signal
from utils.TerminalUtilities import *
from OvertestExceptions import *
from LogManager import LogManager
import resource
resource.setrlimit(resource.RLIMIT_CORE, (0,0))
(slimit, hlimit) = resource.getrlimit(resource.RLIMIT_STACK)
resource.setrlimit(resource.RLIMIT_STACK, (10485760,hlimit))
try:
log = LogManager(None, True)
ovtDB = OvtDB(log)
except Exception, e:
print e
print "Failed to connect to database"
sys.exit(1)
if len(sys.argv) < 2:
usage()
sys.exit(2)
try:
opts, args = getopt.getopt(sys.argv[1:], "i:", ["testrunid="])
except getopt.GetoptError, e:
print e
usage()
sys.exit(2)
testrunid = None
(o,a) = opts[0]
if o in ("-i"):
ovtDB.resetTestrun(int(a))