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
625a17d5
Commit
625a17d5
authored
Apr 21, 2021
by
Xavier Thompson
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/*: Adapt tests to slapproxy upgrade
parent
cc5a223b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
30 deletions
+40
-30
software/jupyter/test/test.py
software/jupyter/test/test.py
+14
-27
software/kvm/test/test.py
software/kvm/test/test.py
+1
-1
software/slapos-sr-testing/software.cfg
software/slapos-sr-testing/software.cfg
+2
-2
software/theia/software.cfg
software/theia/software.cfg
+23
-0
No files found.
software/jupyter/test/test.py
View file @
625a17d5
...
...
@@ -158,20 +158,12 @@ class TestJupyterPassword(InstanceTestCase):
)
class
SelectMixin
(
object
):
def
sqlite3_connect
(
self
):
sqlitedb_file
=
os
.
path
.
join
(
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
os
.
pardir
)
),
'var'
,
'proxy.db'
)
return
sqlite3
.
connect
(
sqlitedb_file
)
def
select
(
self
,
fields
,
table
,
where
=
{}):
connection
=
self
.
sqlite3_connect
()
class
Database
(
object
):
def
__init__
(
self
,
db_path
):
self
.
db
=
db_path
def
execute
(
self
,
query
,
*
args
):
connection
=
sqlite3
.
connect
(
self
.
db
)
def
dict_factory
(
cursor
,
row
):
d
=
{}
for
idx
,
col
in
enumerate
(
cursor
.
description
):
...
...
@@ -179,20 +171,11 @@ class SelectMixin(object):
return
d
connection
.
row_factory
=
dict_factory
cursor
=
connection
.
cursor
()
condition
=
" AND "
.
join
(
"%s='%s'"
%
(
k
,
v
)
for
k
,
v
in
where
.
items
())
cursor
.
execute
(
"SELECT %s FROM %s%s"
%
(
", "
.
join
(
fields
),
table
,
" WHERE %s"
%
condition
if
where
else
""
,
)
)
cursor
.
execute
(
query
,
args
)
return
cursor
.
fetchall
()
class
TestJupyterCustomFrontend
(
SelectMixin
,
InstanceTestCase
):
class
TestJupyterCustomFrontend
(
InstanceTestCase
):
instance_parameter_dict
=
{}
frontend_software_url
=
'hello://frontend.url'
frontend_software_type
=
'hello-type'
...
...
@@ -226,7 +209,9 @@ class TestJupyterCustomFrontend(SelectMixin, InstanceTestCase):
except
Exception
:
pass
selection
=
self
.
select
(
fields
=
[
"*"
],
table
=
"slave14"
,
where
=
{
"hosted_by"
:
r
.
_partition_id
})
runner_directory
=
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
os
.
pardir
))
db
=
Database
(
os
.
path
.
join
(
runner_directory
,
'var'
,
'proxy.db'
))
selection
=
db
.
execute
(
'SELECT * FROM slave15 WHERE hosted_by=?'
,
r
.
_partition_id
)
self
.
assertEqual
(
len
(
selection
),
1
)
...
...
@@ -234,7 +219,7 @@ class TestJupyterCustomFrontend(SelectMixin, InstanceTestCase):
r
.
destroyed
()
class
TestJupyterCustomAdditional
(
SelectMixin
,
InstanceTestCase
):
class
TestJupyterCustomAdditional
(
InstanceTestCase
):
instance_parameter_dict
=
{}
frontend_additional_software_url
=
'hello://frontend.url'
frontend_additional_software_type
=
'hello-type'
...
...
@@ -268,7 +253,9 @@ class TestJupyterCustomAdditional(SelectMixin, InstanceTestCase):
except
Exception
:
pass
selection
=
self
.
select
(
fields
=
[
"*"
],
table
=
"slave14"
,
where
=
{
"hosted_by"
:
r
.
_partition_id
})
runner_directory
=
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
slap
.
instance_directory
,
os
.
pardir
))
db
=
Database
(
os
.
path
.
join
(
runner_directory
,
'var'
,
'proxy.db'
))
selection
=
db
.
execute
(
'SELECT * FROM slave15 WHERE hosted_by=?'
,
r
.
_partition_id
)
self
.
assertEqual
(
len
(
selection
),
1
)
...
...
software/kvm/test/test.py
View file @
625a17d5
...
...
@@ -212,7 +212,7 @@ class MonitorAccessMixin(object):
cursor
.
execute
(
"SELECT reference, xml, connection_xml, partition_reference, "
"software_release, requested_state, software_type "
"FROM partition1
4
"
"FROM partition1
5
"
"WHERE slap_state='busy'"
)
return
cursor
.
fetchall
()
...
...
software/slapos-sr-testing/software.cfg
View file @
625a17d5
...
...
@@ -181,8 +181,8 @@ setup = ${slapos-repository:location}/software/jscrawler/test/
[slapos.core-repository]
<= git-clone-repository
repository = https://lab.nexedi.com/
nexedi
/slapos.core.git
branch =
master
repository = https://lab.nexedi.com/
xavier_thompson
/slapos.core.git
branch =
proxy_root_path_migrate
[slapos.test.caucase-setup]
<= setup-develop-egg
...
...
software/theia/software.cfg
View file @
625a17d5
...
...
@@ -20,6 +20,10 @@ extends =
./buildout.hash.cfg
parts =
# >>>>>>>>>>>>
# Use unreleased version of slapos.core
slapos.core-dev
# <<<<<<<<<<<<
theia-wrapper
slapos-cookbook
instance
...
...
@@ -27,6 +31,24 @@ parts =
# default for slapos-standalone
shared-part-list =
# >>>>>>>>>>>>
# Use unreleased version of slapos.core
[slapos.core-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/xavier_thompson/slapos.core.git
branch = proxy_root_path_migrate
git-executable = ${git:location}/bin/git
develop = true
[slapos.core-dev]
recipe = zc.recipe.egg:develop
egg = slapos.core
setup = ${slapos.core-repository:location}
[versions]
slapos.core =
# <<<<<<<<<<<<
# We keep the gcc part in sync with the one from erp5 software, so that when we install
# erp5 inside theia's slapos parts can be shared.
[gcc]
...
...
@@ -97,6 +119,7 @@ initialization =
software_root="%s/software" % args.base_directory,
instance_root="%s/instance" % args.base_directory,
partition_forward_configuration=partition_forward_configuration,
slapos_bin="${buildout:bin-directory}/slapos",
)
standalone.start()
partition_count = 20
...
...
Xavier Thompson
@xavier_thompson
mentioned in merge request
nexedi/slapos.core!288 (merged)
·
Apr 30, 2021
mentioned in merge request
nexedi/slapos.core!288 (merged)
mentioned in merge request nexedi/slapos.core!288
Toggle commit list
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