Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos.toolbox
Commits
21ec5a9e
Commit
21ec5a9e
authored
Aug 21, 2013
by
Cédric de Saint Martin
Committed by
Cédric Le Ninivin
Sep 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ability to easily add other resiliency tests.
parent
1accd6d8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
32 deletions
+30
-32
setup.py
setup.py
+1
-1
slapos/resiliencytest/__init__.py
slapos/resiliencytest/__init__.py
+26
-28
slapos/resiliencytest/suites/__init__.py
slapos/resiliencytest/suites/__init__.py
+0
-0
slapos/resiliencytest/suites/kvm.py
slapos/resiliencytest/suites/kvm.py
+3
-3
No files found.
setup.py
View file @
21ec5a9e
...
@@ -63,7 +63,7 @@ setup(name=name,
...
@@ -63,7 +63,7 @@ setup(name=name,
'equeue = slapos.equeue:main'
,
'equeue = slapos.equeue:main'
,
'htpasswd = slapos.htpasswd:main'
,
'htpasswd = slapos.htpasswd:main'
,
'killpidfromfile = slapos.systool:killpidfromfile'
,
'killpidfromfile = slapos.systool:killpidfromfile'
,
'run
KVMResiliencyTestSuite = slapos.runkvmresiliencytestsuite:main
'
,
'run
ResiliencyTest = slapos.resiliencytest:runResiliencyTest
'
,
'lampconfigure = slapos.lamp:run [lampconfigure]'
,
'lampconfigure = slapos.lamp:run [lampconfigure]'
,
'onetimedownload = slapos.onetimedownload:main'
,
'onetimedownload = slapos.onetimedownload:main'
,
'onetimeupload = slapos.onetimeupload:main'
,
'onetimeupload = slapos.onetimeupload:main'
,
...
...
slapos/r
unkvmresiliencytestsuite
/__init__.py
→
slapos/r
esiliencytest
/__init__.py
View file @
21ec5a9e
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
import
argparse
import
argparse
import
json
import
json
import
importlib
import
logging
import
logging
import
os
import
os
import
sys
import
sys
...
@@ -36,13 +37,20 @@ import traceback
...
@@ -36,13 +37,20 @@ import traceback
from
erp5.util
import
taskdistribution
from
erp5.util
import
taskdistribution
from
erp5.util.testnode
import
Utils
from
erp5.util.testnode
import
Utils
from
.
import
kvmresiliencytestsuite
MAX_INSTALLATION_TIME
=
60
*
50
MAX_INSTALLATION_TIME
=
60
*
50
MAX_TESTING_TIME
=
60
MAX_TESTING_TIME
=
60
MAX_GETTING_CONNECTION_TIME
=
60
*
5
MAX_GETTING_CONNECTION_TIME
=
60
*
5
def
importFrom
(
name
):
"""
Import a test suite module (in the suites module) and return it.
"""
return
importlib
.
import_module
(
'.suites.%s'
%
name
,
package
=
__name__
)
def
parseArguments
():
def
parseArguments
():
"""
Parse arguments.
"""
parser
=
argparse
.
ArgumentParser
()
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'--test-result-path'
,
parser
.
add_argument
(
'--test-result-path'
,
metavar
=
'ERP5_TEST_RESULT_PATH'
,
metavar
=
'ERP5_TEST_RESULT_PATH'
,
...
@@ -69,14 +77,7 @@ def parseArguments():
...
@@ -69,14 +77,7 @@ def parseArguments():
metavar
=
'LOG_PATH'
,
metavar
=
'LOG_PATH'
,
help
=
'Log Path'
)
help
=
'Log Path'
)
parser
.
add_argument
(
'--server-url'
,
type
=
str
)
parser
.
add_argument
(
'additional_arguments'
,
nargs
=
argparse
.
REMAINDER
)
parser
.
add_argument
(
'--key-file'
,
type
=
str
)
parser
.
add_argument
(
'--cert-file'
,
type
=
str
)
parser
.
add_argument
(
'--computer-id'
,
type
=
str
)
parser
.
add_argument
(
'--partition-id'
,
type
=
str
)
parser
.
add_argument
(
'--software'
,
type
=
str
)
parser
.
add_argument
(
'--namebase'
,
type
=
str
)
parser
.
add_argument
(
'--kvm-rootinstance-name'
,
type
=
str
)
return
parser
.
parse_args
()
return
parser
.
parse_args
()
...
@@ -130,6 +131,19 @@ class ScalabilityLauncher(object):
...
@@ -130,6 +131,19 @@ class ScalabilityLauncher(object):
next_test
=
ScalabilityTest
(
decoded_data
,
self
.
test_result
)
next_test
=
ScalabilityTest
(
decoded_data
,
self
.
test_result
)
return
next_test
return
next_test
def
runCurrentTestSuite
(
self
):
try
:
# Generate the additional arguments that were given using the syntax
# additionalargument1=value1 additionalargument2=value2
additional_arguments
=
dict
(
key
.
split
(
'='
)
for
key
in
self
.
_argumentNamespace
.
additional_arguments
)
test_suite_module
=
importFrom
(
self
.
_argumentNamespace
.
test_suite
)
success
=
test_suite_module
.
runTestSuite
(
**
additional_arguments
)
except
:
self
.
log
(
'Impossible to run resiliency test:'
)
self
.
log
(
traceback
.
print_exc
())
success
=
False
return
success
def
run
(
self
):
def
run
(
self
):
self
.
log
(
'Resiliency Launcher started, with:'
)
self
.
log
(
'Resiliency Launcher started, with:'
)
self
.
log
(
'Test suite master url: %s'
%
self
.
_argumentNamespace
.
test_suite_master_url
)
self
.
log
(
'Test suite master url: %s'
%
self
.
_argumentNamespace
.
test_suite_master_url
)
...
@@ -158,23 +172,7 @@ class ScalabilityLauncher(object):
...
@@ -158,23 +172,7 @@ class ScalabilityLauncher(object):
current_test
.
title
current_test
.
title
)
)
success
=
self
.
runCurrentTestSuite
()
try
:
# XXX: How to be generic? Here, we just call the kvm resiliency test. Period.
success
=
kvmresiliencytestsuite
.
runTestCase
(
server_url
=
self
.
_argumentNamespace
.
server_url
,
key_file
=
self
.
_argumentNamespace
.
key_file
,
cert_file
=
self
.
_argumentNamespace
.
cert_file
,
computer_id
=
self
.
_argumentNamespace
.
computer_id
,
partition_id
=
self
.
_argumentNamespace
.
partition_id
,
software
=
self
.
_argumentNamespace
.
software
,
namebase
=
self
.
_argumentNamespace
.
namebase
,
kvm_rootinstance_name
=
self
.
_argumentNamespace
.
kvm_rootinstance_name
,
)
except
:
self
.
log
(
'Impossible to run resiliency test:'
)
self
.
log
(
traceback
.
print_exc
())
success
=
False
if
success
:
if
success
:
error_count
=
0
error_count
=
0
...
@@ -190,7 +188,7 @@ class ScalabilityLauncher(object):
...
@@ -190,7 +188,7 @@ class ScalabilityLauncher(object):
return
error_message_set
,
exit_status
return
error_message_set
,
exit_status
def
main
():
def
runResiliencyTest
():
error_message_set
,
exit_status
=
ScalabilityLauncher
().
run
()
error_message_set
,
exit_status
=
ScalabilityLauncher
().
run
()
for
error_message
in
error_message_set
:
for
error_message
in
error_message_set
:
print
>>
sys
.
stderr
,
'ERROR: %s'
%
error_message
print
>>
sys
.
stderr
,
'ERROR: %s'
%
error_message
...
...
slapos/resiliencytest/suites/__init__.py
0 → 100644
View file @
21ec5a9e
slapos/r
unkvmresiliencytestsuite/kvmresiliencytestsuite
.py
→
slapos/r
esiliencytest/suites/kvm
.py
View file @
21ec5a9e
...
@@ -85,9 +85,9 @@ def fetchKey(ip):
...
@@ -85,9 +85,9 @@ def fetchKey(ip):
return
new_key
return
new_key
def
runTest
Cas
e
(
server_url
,
key_file
,
cert_file
,
def
runTest
Suit
e
(
server_url
,
key_file
,
cert_file
,
computer_id
,
partition_id
,
software
,
computer_id
,
partition_id
,
software
,
namebase
,
kvm_rootinstance_name
):
namebase
,
kvm_rootinstance_name
):
"""
"""
Run KVM Resiliency Test.
Run KVM Resiliency Test.
Requires a specific KVM environment (virtual hard drive), see KVM SR for more
Requires a specific KVM environment (virtual hard drive), see KVM SR for more
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment