Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Titouan Soulard
erp5
Commits
8f136557
Commit
8f136557
authored
Jun 13, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All test PASSED
parent
1108dad6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
14 deletions
+43
-14
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+43
-14
No files found.
erp5/tests/testERP5TestNode.py
View file @
8f136557
...
@@ -462,8 +462,17 @@ branch = foo
...
@@ -462,8 +462,17 @@ branch = foo
def
test_11_run
(
self
,
my_test_type
=
'UnitTest'
,
grade
=
'master'
):
def
test_11_run
(
self
,
my_test_type
=
'UnitTest'
,
grade
=
'master'
):
def
doNothing
(
self
,
*
args
,
**
kw
):
def
doNothing
(
self
,
*
args
,
**
kw
):
pass
pass
# Used in case of 'ScalabilityTest'
def
patch_getTestType
(
self
,
*
args
,
**
kw
):
def
patch_getTestType
(
self
,
*
args
,
**
kw
):
return
my_test_type
return
my_test_type
def
patch_getSlaposAccountKey
(
self
,
*
args
,
**
kw
):
return
"key"
def
patch_getSlaposAccountCertificate
(
self
,
*
args
,
**
kw
):
return
"Certificate"
def
patch_generateConfiguration
(
self
,
*
args
,
**
kw
):
return
'{"configuration_list": [], "involved_nodes_computer_guid"
\
: [], "error_message": "No error.", "launcher_nodes_computer_guid": {},
\
"launchable": false}'
def
patch_isValidatedMaster
(
self
,
*
args
,
**
kw
):
def
patch_isValidatedMaster
(
self
,
*
args
,
**
kw
):
return
(
grade
==
'master'
)
return
(
grade
==
'master'
)
test_self
=
self
test_self
=
self
...
@@ -476,7 +485,6 @@ branch = foo
...
@@ -476,7 +485,6 @@ branch = foo
config_list
=
[]
config_list
=
[]
# Sclalability slave testnode is not directly in charge of testsuites
# Sclalability slave testnode is not directly in charge of testsuites
if
my_test_type
==
'ScalabilityTest'
and
grade
==
'slave'
:
if
my_test_type
==
'ScalabilityTest'
and
grade
==
'slave'
:
count
+=
5
return
[]
return
[]
def
_checkExistingTestSuite
(
reference_set
):
def
_checkExistingTestSuite
(
reference_set
):
...
@@ -523,8 +531,14 @@ branch = foo
...
@@ -523,8 +531,14 @@ branch = foo
self
.
generateTestRepositoryList
()
self
.
generateTestRepositoryList
()
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
RunnerClass
=
self
.
returnGoodClassRunner
(
my_test_type
)
# Patch
# Patch
if
my_test_type
==
'ScalabilityTest'
:
if
my_test_type
==
"ScalabilityTest"
:
original_getSlaposAccountKey
=
TaskDistributor
.
getSlaposAccountKey
original_getSlaposAccountCertificate
=
TaskDistributor
.
getSlaposAccountCertificate
original_generateConfiguration
=
TaskDistributor
.
generateConfiguration
original_isValidatedMaster
=
TaskDistributor
.
isValidatedMaster
original_isValidatedMaster
=
TaskDistributor
.
isValidatedMaster
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
patch_getSlaposAccountCertificate
TaskDistributor
.
generateConfiguration
=
patch_generateConfiguration
TaskDistributor
.
isValidatedMaster
=
patch_isValidatedMaster
TaskDistributor
.
isValidatedMaster
=
patch_isValidatedMaster
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_subscribeNode
=
TaskDistributor
.
subscribeNode
...
@@ -545,10 +559,18 @@ branch = foo
...
@@ -545,10 +559,18 @@ branch = foo
SlapOSControler
.
initializeSlapOSControler
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
# Inside test_node a runner is created using new UnitTestRunner methods
# Inside test_node a runner is created using new UnitTestRunner methods
test_node
.
run
()
test_node
.
run
()
# Doesn't have to install sofwtare themself
if
my_test_type
==
'ScalabilityTest'
and
grade
==
'slave'
:
self
.
assertEquals
(
0
,
counter
)
else
:
self
.
assertEquals
(
5
,
counter
)
self
.
assertEquals
(
5
,
counter
)
time
.
sleep
=
original_sleep
time
.
sleep
=
original_sleep
# Restore old class methods
# Restore old class methods
if
my_test_type
==
'ScalabilityTest'
:
if
my_test_type
==
"ScalabilityTest"
:
TaskDistributor
.
getSlaposAccountKey
=
original_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
original_getSlaposAccountCertificate
TaskDistributor
.
generateConfiguration
=
original_generateConfiguration
TaskDistributor
.
isValidatedMaster
=
original_isValidatedMaster
TaskDistributor
.
isValidatedMaster
=
original_isValidatedMaster
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
createTestResult
=
original_createTestResult
...
@@ -594,7 +616,7 @@ branch = foo
...
@@ -594,7 +616,7 @@ branch = foo
createFolder
(
folder
,
clean
=
True
)
createFolder
(
folder
,
clean
=
True
)
self
.
assertEquals
(
False
,
os
.
path
.
exists
(
to_drop_path
))
self
.
assertEquals
(
False
,
os
.
path
.
exists
(
to_drop_path
))
def
test_15_suite_log_directory
(
self
,
my_test_type
=
'UnitTest'
):
def
test_15_suite_log_directory
(
self
,
my_test_type
=
'UnitTest'
,
grade
=
'master'
):
def
doNothing
(
self
,
*
args
,
**
kw
):
def
doNothing
(
self
,
*
args
,
**
kw
):
pass
pass
# Used in case of 'ScalabilityTest'
# Used in case of 'ScalabilityTest'
...
@@ -603,11 +625,13 @@ branch = foo
...
@@ -603,11 +625,13 @@ branch = foo
def
patch_getSlaposAccountKey
(
self
,
*
args
,
**
kw
):
def
patch_getSlaposAccountKey
(
self
,
*
args
,
**
kw
):
return
"key"
return
"key"
def
patch_getSlaposAccountCertificate
(
self
,
*
args
,
**
kw
):
def
patch_getSlaposAccountCertificate
(
self
,
*
args
,
**
kw
):
return
"key
"
return
"Certificate
"
def
patch_generateConfiguration
(
self
,
*
args
,
**
kw
):
def
patch_generateConfiguration
(
self
,
*
args
,
**
kw
):
return
'{"configuration_list": [], "involved_nodes_computer_guid"
\
return
'{"configuration_list": [], "involved_nodes_computer_guid"
\
: [], "error_message": "No error.", "launcher_nodes_computer_guid": {},
\
: [], "error_message": "No error.", "launcher_nodes_computer_guid": {},
\
"launchable": false}'
"launchable": false}'
def
patch_isValidatedMaster
(
self
,
*
args
,
**
kw
):
return
(
grade
==
'master'
)
test_self
=
self
test_self
=
self
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
test_result_path_root
=
os
.
path
.
join
(
test_self
.
_temp_dir
,
'test/results'
)
os
.
makedirs
(
test_result_path_root
)
os
.
makedirs
(
test_result_path_root
)
...
@@ -657,9 +681,11 @@ branch = foo
...
@@ -657,9 +681,11 @@ branch = foo
original_getSlaposAccountKey
=
TaskDistributor
.
getSlaposAccountKey
original_getSlaposAccountKey
=
TaskDistributor
.
getSlaposAccountKey
original_getSlaposAccountCertificate
=
TaskDistributor
.
getSlaposAccountCertificate
original_getSlaposAccountCertificate
=
TaskDistributor
.
getSlaposAccountCertificate
original_generateConfiguration
=
TaskDistributor
.
generateConfiguration
original_generateConfiguration
=
TaskDistributor
.
generateConfiguration
original_isValidatedMaster
=
TaskDistributor
.
isValidatedMaster
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountKey
=
patch_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
patch_getSlaposAccountCertificate
TaskDistributor
.
getSlaposAccountCertificate
=
patch_getSlaposAccountCertificate
TaskDistributor
.
generateConfiguration
=
patch_generateConfiguration
TaskDistributor
.
generateConfiguration
=
patch_generateConfiguration
TaskDistributor
.
isValidatedMaster
=
patch_isValidatedMaster
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_startTestSuite
=
TaskDistributor
.
startTestSuite
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_subscribeNode
=
TaskDistributor
.
subscribeNode
original_getTestType
=
TaskDistributor
.
getTestType
original_getTestType
=
TaskDistributor
.
getTestType
...
@@ -684,6 +710,7 @@ branch = foo
...
@@ -684,6 +710,7 @@ branch = foo
TaskDistributor
.
getSlaposAccountKey
=
original_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountKey
=
original_getSlaposAccountKey
TaskDistributor
.
getSlaposAccountCertificate
=
original_getSlaposAccountCertificate
TaskDistributor
.
getSlaposAccountCertificate
=
original_getSlaposAccountCertificate
TaskDistributor
.
generateConfiguration
=
original_generateConfiguration
TaskDistributor
.
generateConfiguration
=
original_generateConfiguration
TaskDistributor
.
isValidatedMaster
=
original_isValidatedMaster
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
createTestResult
=
original_createTestResult
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
TaskDistributionTool
.
subscribeNode
=
original_subscribeNode
...
@@ -810,8 +837,10 @@ branch = foo
...
@@ -810,8 +837,10 @@ branch = foo
self
.
test_13_SlaposControlerResetSoftware
(
my_test_type
)
self
.
test_13_SlaposControlerResetSoftware
(
my_test_type
)
def
test_scalability_14_createFolder
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_14_createFolder
(
self
,
my_test_type
=
'ScalabilityTest'
):
self
.
test_14_createFolder
(
my_test_type
)
self
.
test_14_createFolder
(
my_test_type
)
def
test_scalability_15_suite_log_directory
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_as_master_15_suite_log_directory
(
self
,
my_test_type
=
'ScalabilityTest'
):
self
.
test_15_suite_log_directory
(
my_test_type
)
self
.
test_15_suite_log_directory
(
my_test_type
,
grade
=
'master'
)
def
test_scalability_as_slave_15_suite_log_directory
(
self
,
my_test_type
=
'ScalabilityTest'
):
self
.
test_15_suite_log_directory
(
my_test_type
,
grade
=
'slave'
)
def
test_scalability_16_cleanupLogDirectory
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_16_cleanupLogDirectory
(
self
,
my_test_type
=
'ScalabilityTest'
):
self
.
test_16_cleanupLogDirectory
(
my_test_type
)
self
.
test_16_cleanupLogDirectory
(
my_test_type
)
def
test_scalability_17_cleanupTempDirectory
(
self
,
my_test_type
=
'ScalabilityTest'
):
def
test_scalability_17_cleanupTempDirectory
(
self
,
my_test_type
=
'ScalabilityTest'
):
...
...
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