Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Xavier Thompson
slapos
Commits
7b75e526
Commit
7b75e526
authored
Apr 16, 2021
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
html5as: Add test for replicate behaviour
parent
cc5a223b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
software/html5as/test/test.py
software/html5as/test/test.py
+48
-0
No files found.
software/html5as/test/test.py
View file @
7b75e526
...
...
@@ -132,3 +132,51 @@ class TestGracefulWithPortChange(HTML5ASTestCase):
self
.
checkUrlAndGetResponse
(
url
)
class
TestReplicateHTML5AS
(
HTML5ASTestCase
):
"""
This class test the instance with the parameter "port"
"""
instance_parameter_dict
=
{
"port-1"
:
8088
,
"title-1"
:
"Title 1"
,
}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
'replicate'
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
cls
.
instance_parameter_dict
def
test_replicate_instance
(
self
):
# Check First instance is deployed with proper parameters
connection_parameter_dict
=
self
.
computer_partition
.
getConnectionParameterDict
()
url
=
connection_parameter_dict
[
'instance-1-server_url'
]
self
.
assertEqual
(
urlparse
(
url
).
port
,
8088
)
response
=
self
.
checkUrlAndGetResponse
(
url
)
result
=
response
.
text
self
.
assertTrue
(
"<h1>Title 1</h1>"
in
result
)
# Check only one instance is deployed by default
self
.
assertTrue
(
"instance-2-server_url"
not
in
connection_parameter_dict
)
# Update replicate quantity parameter
self
.
instance_parameter_dict
.
update
({
'replicate-quantity'
:
2
,
'port-2'
:
8089
,
'sla-2-computer_guid'
:
self
.
slap
.
_computer_id
,
"title-2"
:
"Title 314"
,
})
# Request instance with the one more replicate
self
.
requestDefaultInstance
()
self
.
slap
.
waitForInstance
(
self
.
instance_max_retry
)
# Check the second replicate
connection_parameter_dict
=
self
.
requestDefaultInstance
().
getConnectionParameterDict
()
url
=
connection_parameter_dict
[
'instance-2-server_url'
]
self
.
assertEqual
(
urlparse
(
url
).
port
,
8089
)
response
=
self
.
checkUrlAndGetResponse
(
url
)
result
=
response
.
text
self
.
assertTrue
(
"<h1>Title 314</h1>"
in
result
)
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