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
Boxiang Sun
slapos
Commits
929143e3
Commit
929143e3
authored
Nov 16, 2022
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
theia: peertube test fixup
parent
bd007c64
Pipeline
#24802
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
software/theia/test/project_tests.py
software/theia/test/project_tests.py
+19
-6
No files found.
software/theia/test/project_tests.py
View file @
929143e3
...
@@ -253,28 +253,33 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
...
@@ -253,28 +253,33 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
postgresql_partition
=
self
.
_getPeertubePartitionPath
(
'export'
,
'postgres'
)
postgresql_partition
=
self
.
_getPeertubePartitionPath
(
'export'
,
'postgres'
)
postgresql_bin
=
os
.
path
.
join
(
postgresql_partition
,
'bin'
,
'psql'
)
postgresql_bin
=
os
.
path
.
join
(
postgresql_partition
,
'bin'
,
'psql'
)
postgres_bin
=
os
.
path
.
join
(
postgresql_partition
,
'bin'
,
'postgres'
)
postgres_bin
=
os
.
path
.
join
(
postgresql_partition
,
'bin'
,
'postgres'
)
postgresql_srv
=
self
.
getPartitionPath
(
postgresql_partition
,
'postgresql'
)
# Change the email address of the user 'peertube'
# Change the email address of the user 'peertube'
output
=
subprocess
.
check_output
(
output
=
subprocess
.
check_output
(
(
postgresql_bin
,
'-c'
,
'UPDATE "user" SET "email"=
\
'
aaa
\
'
WHERE "username"=
\
'
root
\
'
'
),
(
postgresql_bin
,
'-h'
,
postgresql_srv
,
'-U'
,
'peertube'
,
'-d'
,
'peertube_prod'
,
'-c'
,
'UPDATE "user" SET "email"=
\
'
aaa
\
'
WHERE "username"=
\
'
root
\
'
'
),
universal_newlines
=
True
)
universal_newlines
=
True
)
self
.
assertIn
(
"UPDATE"
,
output
)
self
.
assertIn
(
"UPDATE"
,
output
)
# Checked the modification has been updated in the database
# Checked the modification has been updated in the database
output
=
subprocess
.
check_output
(
output
=
subprocess
.
check_output
(
(
postgresql_bin
,
'-c'
,
'SELECT * FROM "user"'
),
(
postgresql_bin
,
'-h'
,
postgresql_srv
,
'-U'
,
'peertube'
,
'-d'
,
'peertube_prod'
,
'-c'
,
'SELECT * FROM "user"'
),
universal_newlines
=
True
)
universal_newlines
=
True
)
self
.
assertIn
(
"aaa"
,
output
)
self
.
assertIn
(
"aaa"
,
output
)
# Change the email address of the user 'peertube'
# Change the email address of the user 'peertube'
output
=
subprocess
.
check_output
(
output
=
subprocess
.
check_output
(
(
postgresql_bin
,
'-c'
,
'UPDATE "user" SET "email"=
\
'
bbb
\
'
WHERE "username"=
\
'
root
\
'
'
),
(
postgresql_bin
,
'-h'
,
postgresql_srv
,
'-U'
,
'peertube'
,
'-d'
,
'peertube_prod'
,
'-c'
,
'UPDATE "user" SET "email"=
\
'
bbb
\
'
WHERE "username"=
\
'
root
\
'
'
),
universal_newlines
=
True
)
universal_newlines
=
True
)
self
.
assertIn
(
"UPDATE"
,
output
)
self
.
assertIn
(
"UPDATE"
,
output
)
# Checked the modification has been updated in the database
# Checked the modification has been updated in the database
output
=
subprocess
.
check_output
(
output
=
subprocess
.
check_output
(
(
postgresql_bin
,
'-c'
,
'SELECT * FROM "user"'
),
(
postgresql_bin
,
'-h'
,
postgresql_srv
,
'-U'
,
'peertube'
,
'-d'
,
'peertube_prod'
,
'-c'
,
'SELECT * FROM "user"'
),
universal_newlines
=
True
)
universal_newlines
=
True
)
self
.
assertIn
(
"bbb"
,
output
)
self
.
assertIn
(
"bbb"
,
output
)
...
@@ -316,10 +321,12 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
...
@@ -316,10 +321,12 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
postgresql_partition
=
self
.
_getPeertubePartitionPath
(
'export'
,
'postgres'
)
postgresql_partition
=
self
.
_getPeertubePartitionPath
(
'export'
,
'postgres'
)
postgresql_bin
=
os
.
path
.
join
(
postgresql_partition
,
'bin'
,
'psql'
)
postgresql_bin
=
os
.
path
.
join
(
postgresql_partition
,
'bin'
,
'psql'
)
postgres_bin
=
os
.
path
.
join
(
postgresql_partition
,
'bin'
,
'postgres'
)
postgres_bin
=
os
.
path
.
join
(
postgresql_partition
,
'bin'
,
'postgres'
)
postgresql_srv
=
self
.
getPartitionPath
(
postgresql_partition
,
'postgresql'
)
# Check that the mariadb catalog is not yet restored
# Check that the mariadb catalog is not yet restored
output
=
subprocess
.
check_output
(
output
=
subprocess
.
check_output
(
(
postgresql_bin
,
'-c'
,
'SELECT * FROM "user"'
),
(
postgresql_bin
,
'-h'
,
postgresql_srv
,
'-U'
,
'peertube'
,
'-d'
,
'peertube_prod'
,
'-c'
,
'SELECT * FROM "user"'
),
universal_newlines
=
True
)
universal_newlines
=
True
)
self
.
assertNotIn
(
"bbb"
,
output
)
self
.
assertNotIn
(
"bbb"
,
output
)
...
@@ -340,7 +347,8 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
...
@@ -340,7 +347,8 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
# Check that the postgresql catalog was properly restored
# Check that the postgresql catalog was properly restored
output
=
subprocess
.
check_output
(
output
=
subprocess
.
check_output
(
(
postgresql_bin
,
'-c'
,
'SELECT * FROM "user"'
),
(
postgresql_bin
,
'-h'
,
postgresql_srv
,
'-U'
,
'peertube'
,
'-d'
,
'peertube_prod'
,
'-c'
,
'SELECT * FROM "user"'
),
universal_newlines
=
True
)
universal_newlines
=
True
)
self
.
assertIn
(
"bbb"
,
output
)
self
.
assertIn
(
"bbb"
,
output
)
...
@@ -363,3 +371,8 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
...
@@ -363,3 +371,8 @@ class TestTheiaResiliencePeertube(test_resiliency.TestTheiaResilience):
partition
=
self
.
_getPeertubePartition
(
servicename
)
partition
=
self
.
_getPeertubePartition
(
servicename
)
return
self
.
getPartitionPath
(
return
self
.
getPartitionPath
(
instance_type
,
'srv'
,
'runner'
,
'instance'
,
partition
,
*
paths
)
instance_type
,
'srv'
,
'runner'
,
'instance'
,
partition
,
*
paths
)
def
_getPostgresSrvPartitionPath
(
self
,
instance_type
,
servicename
,
*
paths
):
partition
=
self
.
_getPeertubePartition
(
servicename
)
return
self
.
getPartitionPath
(
instance_type
,
'srv'
,
'runner'
,
'instance'
,
partition
,
*
paths
)
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