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
Alexander Emmerich
erp5
Commits
7c598c24
Commit
7c598c24
authored
Aug 27, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testnode: change way to reach repository in scalability case
parent
420b0e57
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
20 deletions
+38
-20
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+2
-2
erp5/util/testnode/ScalabilityTestRunner.py
erp5/util/testnode/ScalabilityTestRunner.py
+29
-15
erp5/util/testnode/Updater.py
erp5/util/testnode/Updater.py
+3
-0
erp5/util/testnode/testnode.py
erp5/util/testnode/testnode.py
+4
-3
No files found.
erp5/tests/testERP5TestNode.py
View file @
7c598c24
...
@@ -243,10 +243,10 @@ branch = foo
...
@@ -243,10 +243,10 @@ branch = foo
extends = %(temp_dir)s/testnode/foo/rep0/software.cfg
extends = %(temp_dir)s/testnode/foo/rep0/software.cfg
[rep1]
[rep1]
re
vision = %(revision1)s
re
pository = <obfuscated_url>/rep1
[rep2]
[rep2]
re
vision = %(revision2)s
re
pository = <obfuscated_url>/rep2
"""
%
{
'temp_dir'
:
self
.
_temp_dir
,
'revision1'
:
revision1
,
'revision2'
:
revision2
}
"""
%
{
'temp_dir'
:
self
.
_temp_dir
,
'revision1'
:
revision1
,
'revision2'
:
revision2
}
self
.
assertEquals
(
expected_profile
,
profile
.
read
())
self
.
assertEquals
(
expected_profile
,
profile
.
read
())
profile
.
close
()
profile
.
close
()
...
...
erp5/util/testnode/ScalabilityTestRunner.py
View file @
7c598c24
...
@@ -160,8 +160,6 @@ ces or already launched.")
...
@@ -160,8 +160,6 @@ ces or already launched.")
if
self
.
testnode
.
test_suite_portal
.
isMasterTestnode
(
if
self
.
testnode
.
test_suite_portal
.
isMasterTestnode
(
self
.
testnode
.
config
[
'test_node_title'
]):
self
.
testnode
.
config
[
'test_node_title'
]):
pass
pass
# software_path_list = []
# software_path_list.append(self.testnode.config.get("software_list"))
return
{
'status_code'
:
0
}
return
{
'status_code'
:
0
}
# Dummy slapos answering
# Dummy slapos answering
...
@@ -276,7 +274,13 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -276,7 +274,13 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self
.
log
(
"ERP5 Master indicates : %s"
%
(
self
.
error_message
,))
self
.
log
(
"ERP5 Master indicates : %s"
%
(
self
.
error_message
,))
# error : wich code to return ?
# error : wich code to return ?
return
{
'status_code'
:
1
}
return
{
'status_code'
:
1
}
# create an obfuscated link to the testsuite directory
involved_nodes_computer_guid
=
test_configuration
[
'involved_nodes_computer_guid'
]
configuration_list
=
test_configuration
[
'configuration_list'
]
node_test_suite
.
edit
(
configuration_list
=
configuration_list
)
self
.
launcher_nodes_computer_guid
=
test_configuration
[
'launcher_nodes_computer_guid'
]
# Create an obfuscated link to the testsuite directory
path_to_suite
=
os
.
path
.
join
(
path_to_suite
=
os
.
path
.
join
(
self
.
testnode
.
config
[
'working_directory'
],
self
.
testnode
.
config
[
'working_directory'
],
node_test_suite
.
reference
)
node_test_suite
.
reference
)
...
@@ -293,22 +297,32 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
...
@@ -293,22 +297,32 @@ late a SlapOS (positive) answer." %(str(os.getpid()),str(os.getpid()),))
self
.
log
(
"testnode, Unable to create symbolic link to the testsuite."
)
self
.
log
(
"testnode, Unable to create symbolic link to the testsuite."
)
raise
ValueError
(
"testnode, Unable to create symbolic link to the testsuite."
)
raise
ValueError
(
"testnode, Unable to create symbolic link to the testsuite."
)
self
.
log
(
"Sym link : %s %s"
%
(
path_to_suite
,
self
.
obfuscated_link_path
))
self
.
log
(
"Sym link : %s %s"
%
(
path_to_suite
,
self
.
obfuscated_link_path
))
involved_nodes_computer_guid
=
test_configuration
[
'involved_nodes_computer_guid'
]
configuration_list
=
test_configuration
[
'configuration_list'
]
node_test_suite
.
edit
(
configuration_list
=
configuration_list
)
self
.
launcher_nodes_computer_guid
=
test_configuration
[
'launcher_nodes_computer_guid'
]
software_path_list
=
[]
# Construct the ipv6 obfuscated url of the software profile reachable from outside
# Construct the ipv6 obfuscated url of the software profile reachable from outside
self
.
reachable_
profile
=
os
.
path
.
join
(
self
.
reachable_
address
=
os
.
path
.
join
(
"https://"
,
"["
+
self
.
testnode
.
config
[
'httpd_ip'
]
+
"]"
+
":"
+
self
.
testnode
.
config
[
'httpd_software_access_port'
],
"https://"
,
"["
+
self
.
testnode
.
config
[
'httpd_ip'
]
+
"]"
+
":"
+
self
.
testnode
.
config
[
'httpd_software_access_port'
],
self
.
randomized_path
,
"software.cfg"
)
self
.
randomized_path
)
self
.
reachable_profile
=
os
.
path
.
join
(
self
.
reachable_address
,
"software.cfg"
)
# Write the reachable address in the software.cfg file,
# by replacing <obfuscated_url> occurences by the current reachable address.
software_file
=
open
(
node_test_suite
.
custom_profile_path
,
"r"
)
file_content
=
software_file
.
readlines
()
new_file_content
=
[]
for
line
in
file_content
:
new_file_content
.
append
(
line
.
replace
(
'<obfuscated_url>'
,
self
.
reachable_address
))
software_file
.
close
()
os
.
remove
(
node_test_suite
.
custom_profile_path
)
software_file
=
open
(
node_test_suite
.
custom_profile_path
,
"w"
)
for
line
in
new_file_content
:
software_file
.
write
(
line
)
software_file
.
close
()
self
.
log
(
"Software reachable profile path is : %s "
self
.
log
(
"Software reachable profile path is : %s "
%
(
self
.
reachable_profile
,))
%
(
self
.
reachable_profile
,))
software_path_list
.
append
(
self
.
reachable_profile
)
# Ask for softwares installation
# Ask for SR installation
for
software_path
in
software_path_list
:
for
computer_guid
in
self
.
involved_nodes_computer_guid
:
for
computer_guid
in
self
.
involved_nodes_computer_guid
:
self
.
_prepareSlapOS
(
self
.
reachable_profile
,
computer_guid
)
self
.
_prepareSlapOS
(
software_path
,
computer_guid
)
# From the line below we would not supply any more softwares
# From the line below we would not supply any more softwares
self
.
authorize_supply
=
False
self
.
authorize_supply
=
False
# TODO : remove the line below wich simulate an answer from slapos master
# TODO : remove the line below wich simulate an answer from slapos master
...
...
erp5/util/testnode/Updater.py
View file @
7c598c24
...
@@ -96,6 +96,9 @@ class Updater(object):
...
@@ -96,6 +96,9 @@ class Updater(object):
def _git(self, *args, **kw):
def _git(self, *args, **kw):
return self.spawn(self.git_binary, *args, **kw)['
stdout
'].strip()
return self.spawn(self.git_binary, *args, **kw)['
stdout
'].strip()
def git_update_server_info(self):
return self._git('
update
-
server
-
info
')
def _git_find_rev(self, ref):
def _git_find_rev(self, ref):
try:
try:
return self._git_cache[ref]
return self._git_cache[ref]
...
...
erp5/util/testnode/testnode.py
View file @
7c598c24
...
@@ -163,11 +163,11 @@ extends = %(software_config_path)s
...
@@ -163,11 +163,11 @@ extends = %(software_config_path)s
revision_list
=
[
[
x
.
split
(
'='
)[
0
],
x
.
split
(
'='
)[
1
].
split
(
'-'
)[
1
]]
for
x
in
all_revision
.
split
(
','
)
]
revision_list
=
[
[
x
.
split
(
'='
)[
0
],
x
.
split
(
'='
)[
1
].
split
(
'-'
)[
1
]]
for
x
in
all_revision
.
split
(
','
)
]
# from [[sec1,azer],[sec2,qwer],..] to {sec1:azer,sec2:qwer,..}
# from [[sec1,azer],[sec2,qwer],..] to {sec1:azer,sec2:qwer,..}
revision_dict
=
{
branch
:
revision
for
branch
,
revision
in
revision_list
}
revision_dict
=
{
branch
:
revision
for
branch
,
revision
in
revision_list
}
# <obfuscated_url> word is modified by in runner.prepareSlapOSForTestSuite()
profile_content_list
.
append
(
"""
profile_content_list
.
append
(
"""
[%(buildout_section_id)s]
[%(buildout_section_id)s]
revision = %(revision)s
repository = <obfuscated_url>/%(buildout_section_id)s
"""
%
{
'buildout_section_id'
:
buildout_section_id
,
"""
%
{
'buildout_section_id'
:
buildout_section_id
})
'revision'
:
revision_dict
[
buildout_section_id
]})
else
:
else
:
profile_content_list
.
append
(
"""
profile_content_list
.
append
(
"""
[%(buildout_section_id)s]
[%(buildout_section_id)s]
...
@@ -261,6 +261,7 @@ branch = %(branch)s
...
@@ -261,6 +261,7 @@ branch = %(branch)s
revision
=
revision
,
log
=
log
,
revision
=
revision
,
log
=
log
,
process_manager
=
self
.
process_manager
)
process_manager
=
self
.
process_manager
)
updater
.
checkout
()
updater
.
checkout
()
updater
.
git_update_server_info
()
node_test_suite
.
revision
=
test_result
.
revision
node_test_suite
.
revision
=
test_result
.
revision
def
_cleanupLog
(
self
):
def
_cleanupLog
(
self
):
...
...
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