Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F2822631
runtests.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
runtests.py
View Options
#!/usr/bin/python
import
os
import
re
import
shutil
import
sys
import
tempfile
import
time
import
unittest
from
clienttests
import
ClientConfigTests
from
sitetests
import
SiteConfigTests
from
arbtests
import
ArbitratorConfigTests
if
__name__
==
'__main__'
:
if
os
.
geteuid
()
==
0
:
sys
.
stderr
.
write
(
"Must be run non-root; aborting.
\n
"
)
sys
.
exit
(
1
)
tmp_path
=
'/tmp/booth-tests'
if
not
os
.
path
.
exists
(
tmp_path
):
os
.
makedirs
(
tmp_path
)
test_run_path
=
tempfile
.
mkdtemp
(
prefix
=
'
%d
.'
%
time
.
time
(),
dir
=
tmp_path
)
suite
=
unittest
.
TestSuite
()
testclasses
=
[
SiteConfigTests
,
#ArbitratorConfigTests,
ClientConfigTests
,
]
for
testclass
in
testclasses
:
testclass
.
test_run_path
=
test_run_path
suite
.
addTests
(
unittest
.
TestLoader
()
.
loadTestsFromTestCase
(
testclass
))
runner_args
=
{
#'verbosity' : 2,
}
major
,
minor
,
micro
,
releaselevel
,
serial
=
sys
.
version_info
if
major
>
2
or
(
major
==
2
and
minor
>=
7
):
# New in 2.7
runner_args
[
'buffer'
]
=
True
runner_args
[
'failfast'
]
=
True
pass
runner
=
unittest
.
TextTestRunner
(
**
runner_args
)
result
=
runner
.
run
(
suite
)
if
result
.
wasSuccessful
():
shutil
.
rmtree
(
test_run_path
)
sys
.
exit
(
0
)
else
:
print
"Left
%s
for debugging"
%
test_run_path
sys
.
exit
(
1
)
File Metadata
Details
Attached
Mime Type
text/x-script.python
Expires
Sat, Jan 25, 6:16 AM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1248767
Default Alt Text
runtests.py (1 KB)
Attached To
Mode
rB Booth
Attached
Detach File
Event Timeline
Log In to Comment