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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alain Takoudjou
slapos
Commits
f8192143
Commit
f8192143
authored
May 03, 2022
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/theia: Fix python3 erp5 resiliency test
parent
b6e4c360
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
software/theia/test/project_tests.py
software/theia/test/project_tests.py
+8
-4
software/theia/test/test_resiliency.py
software/theia/test/test_resiliency.py
+1
-1
No files found.
software/theia/test/project_tests.py
View file @
f8192143
...
@@ -66,6 +66,7 @@ class ERP5Mixin(object):
...
@@ -66,6 +66,7 @@ class ERP5Mixin(object):
out
=
self
.
captureSlapos
(
out
=
self
.
captureSlapos
(
'request'
,
'test_instance'
,
self
.
_test_software_url
,
'request'
,
'test_instance'
,
self
.
_test_software_url
,
stderr
=
subprocess
.
STDOUT
,
stderr
=
subprocess
.
STDOUT
,
text
=
True
,
)
)
print
(
out
)
print
(
out
)
return
json
.
loads
(
self
.
_connexion_parameters_regex
.
search
(
out
).
group
(
0
).
replace
(
"'"
,
'"'
))
return
json
.
loads
(
self
.
_connexion_parameters_regex
.
search
(
out
).
group
(
0
).
replace
(
"'"
,
'"'
))
...
@@ -150,7 +151,9 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
...
@@ -150,7 +151,9 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
subprocess
.
check_call
((
wait_activities_script
,
'erp5'
),
env
=
{
'MYSQL'
:
mysql_bin
})
subprocess
.
check_call
((
wait_activities_script
,
'erp5'
),
env
=
{
'MYSQL'
:
mysql_bin
})
# Check that changes have been catalogued
# Check that changes have been catalogued
output
=
subprocess
.
check_output
((
mysql_bin
,
'erp5'
,
'-e'
,
'SELECT title FROM catalog WHERE id="portal_types"'
))
output
=
subprocess
.
check_output
(
(
mysql_bin
,
'erp5'
,
'-e'
,
'SELECT title FROM catalog WHERE id="portal_types"'
),
universal_newlines
=
True
)
self
.
assertIn
(
new_title
,
output
)
self
.
assertIn
(
new_title
,
output
)
# Compute backup date in the near future
# Compute backup date in the near future
...
@@ -185,7 +188,8 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
...
@@ -185,7 +188,8 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
# Check that mariadb catalog backup contains expected changes
# Check that mariadb catalog backup contains expected changes
with
gzip
.
open
(
os
.
path
.
join
(
mariadb_backup
,
mariadb_backup_dump
))
as
f
:
with
gzip
.
open
(
os
.
path
.
join
(
mariadb_backup
,
mariadb_backup_dump
))
as
f
:
self
.
assertIn
(
new_title
,
f
.
read
(),
"Mariadb catalog backup %s is not up to date"
%
mariadb_backup_dump
)
msg
=
"Mariadb catalog backup %s is not up to date"
%
mariadb_backup_dump
self
.
assertIn
(
new_title
.
encode
(),
f
.
read
(),
msg
)
def
_checkTakeover
(
self
):
def
_checkTakeover
(
self
):
super
(
TestTheiaResilienceERP5
,
self
).
_checkTakeover
()
super
(
TestTheiaResilienceERP5
,
self
).
_checkTakeover
()
...
@@ -205,7 +209,7 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
...
@@ -205,7 +209,7 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
mysql_bin
=
os
.
path
.
join
(
mariadb_partition
,
'bin'
,
'mysql'
)
mysql_bin
=
os
.
path
.
join
(
mariadb_partition
,
'bin'
,
'mysql'
)
query
=
'SELECT title FROM catalog WHERE id="portal_types"'
query
=
'SELECT title FROM catalog WHERE id="portal_types"'
try
:
try
:
out
=
subprocess
.
check_output
((
mysql_bin
,
'erp5'
,
'-e'
,
query
))
out
=
subprocess
.
check_output
((
mysql_bin
,
'erp5'
,
'-e'
,
query
)
,
universal_newlines
=
True
)
except
subprocess
.
CalledProcessError
:
except
subprocess
.
CalledProcessError
:
out
=
''
out
=
''
self
.
assertNotIn
(
self
.
_erp5_new_title
,
out
)
self
.
assertNotIn
(
self
.
_erp5_new_title
,
out
)
...
@@ -226,5 +230,5 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
...
@@ -226,5 +230,5 @@ class TestTheiaResilienceERP5(ERP5Mixin, test_resiliency.TestTheiaResilience):
self
.
_processEmbeddedInstance
(
self
.
test_instance_max_retries
)
self
.
_processEmbeddedInstance
(
self
.
test_instance_max_retries
)
# Check that the mariadb catalog was properly restored
# Check that the mariadb catalog was properly restored
out
=
subprocess
.
check_output
((
mysql_bin
,
'erp5'
,
'-e'
,
query
))
out
=
subprocess
.
check_output
((
mysql_bin
,
'erp5'
,
'-e'
,
query
)
,
universal_newlines
=
True
)
self
.
assertIn
(
self
.
_erp5_new_title
,
out
,
'Mariadb catalog is not properly restored'
)
self
.
assertIn
(
self
.
_erp5_new_title
,
out
,
'Mariadb catalog is not properly restored'
)
software/theia/test/test_resiliency.py
View file @
f8192143
...
@@ -76,7 +76,7 @@ class ResilientTheiaTestCase(ResilientTheiaMixin, TheiaTestCase):
...
@@ -76,7 +76,7 @@ class ResilientTheiaTestCase(ResilientTheiaMixin, TheiaTestCase):
# Sleep a bit as an attempt to workaround monitoring boostrap not being ready
# Sleep a bit as an attempt to workaround monitoring boostrap not being ready
print
(
"Wait before running slapos node instance one last time"
)
print
(
"Wait before running slapos node instance one last time"
)
time
.
sleep
(
120
)
time
.
sleep
(
120
)
cls
.
c
all
Slapos
(
'node'
,
'instance'
,
instance_type
=
instance_type
)
cls
.
c
heck
Slapos
(
'node'
,
'instance'
,
instance_type
=
instance_type
)
@
classmethod
@
classmethod
def
_deployEmbeddedSoftware
(
cls
,
software_url
,
instance_name
,
retries
=
0
,
instance_type
=
'export'
):
def
_deployEmbeddedSoftware
(
cls
,
software_url
,
instance_name
,
retries
=
0
,
instance_type
=
'export'
):
...
...
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