Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
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
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos
Commits
c141e54f
Commit
c141e54f
authored
Sep 09, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into zope4py2
parents
7338b096
c132790b
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
88 additions
and
35 deletions
+88
-35
component/zodbtools/test-py2.cfg
component/zodbtools/test-py2.cfg
+2
-0
component/zodbtools/test-zodb4-py2.cfg
component/zodbtools/test-zodb4-py2.cfg
+6
-0
component/zodbtools/test-zodb4-wc2-py2.cfg
component/zodbtools/test-zodb4-wc2-py2.cfg
+6
-0
component/zodbtools/test-zodb4-wc2.cfg
component/zodbtools/test-zodb4-wc2.cfg
+1
-1
component/zodbtools/test-zodb4.cfg
component/zodbtools/test-zodb4.cfg
+7
-0
component/zodbtools/test-zodb5-py2.cfg
component/zodbtools/test-zodb5-py2.cfg
+6
-0
component/zodbtools/test-zodb5.cfg
component/zodbtools/test-zodb5.cfg
+1
-1
component/zodbtools/test.cfg
component/zodbtools/test.cfg
+0
-4
setup.py
setup.py
+1
-1
slapos/recipe/simplehttpserver/simplehttpserver.py
slapos/recipe/simplehttpserver/simplehttpserver.py
+22
-7
slapos/test/recipe/test_simplehttpserver.py
slapos/test/recipe/test_simplehttpserver.py
+27
-6
software/buildout-testing/software-py2.cfg
software/buildout-testing/software-py2.cfg
+1
-1
software/buildout-testing/software.cfg
software/buildout-testing/software.cfg
+0
-3
software/erp5testnode/testsuite/deploy-test/runTestSuite.py
software/erp5testnode/testsuite/deploy-test/runTestSuite.py
+2
-2
software/erp5testnode/testsuite/deploy-test/software.cfg
software/erp5testnode/testsuite/deploy-test/software.cfg
+1
-1
software/slapos-testing/README.md
software/slapos-testing/README.md
+3
-3
software/slapos-testing/software-py2.cfg
software/slapos-testing/software-py2.cfg
+1
-1
software/slapos-testing/software.cfg
software/slapos-testing/software.cfg
+0
-3
stack/slapos.cfg
stack/slapos.cfg
+1
-1
No files found.
component/zodbtools/test-py2.cfg
0 → 100644
View file @
c141e54f
[python]
part = python2.7
component/zodbtools/test-zodb4-py2.cfg
0 → 100644
View file @
c141e54f
# SlapOS software release to test zodbtools/ZODB4-py2 on Nexedi testing infrastructure.
[buildout]
extends =
test-zodb4.cfg
test-py2.cfg
component/zodbtools/test-zodb4-wc2-py2.cfg
0 → 100644
View file @
c141e54f
# SlapOS software release to test zodbtools/ZODB4-wc2-py2 on Nexedi testing infrastructure.
[buildout]
extends =
test-zodb4-wc2.cfg
test-py2.cfg
component/zodbtools/test-zodb4-wc2.cfg
View file @
c141e54f
# SlapOS software release to test zodbtools/ZODB4-wc2 on Nexedi testing infrastructure.
# SlapOS software release to test zodbtools/ZODB4-wc2
-py3
on Nexedi testing infrastructure.
[buildout]
extends = test-common.cfg
...
...
component/zodbtools/test-zodb4.cfg
0 → 100644
View file @
c141e54f
# SlapOS software release to test zodbtools/ZODB4-py3 on Nexedi testing infrastructure.
[buildout]
extends = test-common.cfg
[ZODB]
major = 4
component/zodbtools/test-zodb5-py2.cfg
0 → 100644
View file @
c141e54f
# SlapOS software release to test zodbtools/ZODB5-py2 on Nexedi testing infrastructure.
[buildout]
extends =
test-zodb5.cfg
test-py2.cfg
component/zodbtools/test-zodb5.cfg
View file @
c141e54f
# SlapOS software release to test zodbtools/ZODB5 on Nexedi testing infrastructure.
# SlapOS software release to test zodbtools/ZODB5
-py3
on Nexedi testing infrastructure.
[buildout]
extends = test-common.cfg
...
...
component/zodbtools/test.cfg
deleted
100644 → 0
View file @
7338b096
# SlapOS software release to test zodbtools on Nexedi testing infrastructure.
[buildout]
extends = test-common.cfg
setup.py
View file @
c141e54f
...
...
@@ -28,7 +28,7 @@ from setuptools import setup, find_packages
import
glob
import
os
version
=
'1.0.2
53
'
version
=
'1.0.2
72
'
name
=
'slapos.cookbook'
long_description
=
open
(
"README.rst"
).
read
()
...
...
slapos/recipe/simplehttpserver/simplehttpserver.py
View file @
c141e54f
...
...
@@ -36,6 +36,15 @@ class ServerHandler(SimpleHTTPRequestHandler):
SimpleHTTPRequestHandler
.
do_GET
(
self
)
def
do_POST
(
self
):
"""Write to a file on the server.
request keys:
path: the path of the file
content: content of the file
clear: (0|1 default 1) overwrite the file if 1
request can be encoded as application/x-www-form-urlencoded or multipart/form-data
"""
logging
.
info
(
'%s - POST: %s
\
n
%s'
%
(
self
.
client_address
[
0
],
self
.
path
,
self
.
headers
))
if
self
.
restrictedRootAccess
():
return
...
...
@@ -46,14 +55,20 @@ class ServerHandler(SimpleHTTPRequestHandler):
environ
=
{
'REQUEST_METHOD'
:
'POST'
,
'CONTENT_TYPE'
:
self
.
headers
[
'Content-Type'
]}
)
name
=
form
[
'path'
].
value
.
decode
(
'utf-8'
)
content
=
form
[
'content'
].
value
method
=
'ab'
if
'clear'
in
form
and
form
[
'clear'
].
value
==
'1'
:
method
=
'wb'
self
.
writeFile
(
name
,
content
,
method
)
file_content
=
form
[
'content'
].
value
file_path
=
form
[
'path'
].
value
if
form
[
'content'
].
file
:
# post data as multipart/form-data , values are bytes
file_path
=
file_path
.
decode
(
'utf-8'
)
else
:
# application/x-www-form-urlencoded , values are str
file_content
=
file_content
.
encode
(
'utf-8'
)
file_open_mode
=
'wb'
if
(
'clear'
in
form
and
form
[
'clear'
].
value
in
(
'1'
,
b'1'
))
else
'ab'
self
.
writeFile
(
file_path
,
file_content
,
file_open_mode
)
self
.
respond
(
200
,
type
=
self
.
headers
[
'Content-Type'
])
self
.
wfile
.
write
(
b"Content written to %s"
%
str2bytes
(
name
))
self
.
wfile
.
write
(
b"Content written to %s"
%
str2bytes
(
file_path
))
def
writeFile
(
self
,
filename
,
content
,
method
=
'ab'
):
file_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
document_path
,
filename
))
...
...
slapos/test/recipe/test_simplehttpserver.py
View file @
c141e54f
...
...
@@ -71,22 +71,43 @@ class SimpleHTTPServerTest(unittest.TestCase):
'server did not start.
\
n
out: %s error: %s'
%
self
.
process
.
communicate
())
self
.
assertIn
(
'Directory listing for /'
,
resp
.
text
)
# post with multipart/form-data encoding
resp
=
requests
.
post
(
server_base_url
,
files
=
{
'path'
:
'hello.txt'
,
'content'
:
b'hello
'
,
'path'
:
'hello
-form-data
.txt'
,
'content'
:
'hello-form-data
'
,
},
)
self
.
assertEqual
(
resp
.
status_code
,
requests
.
codes
.
ok
)
self
.
assertEqual
(
resp
.
text
,
'Content written to hello-form-data.txt'
)
with
open
(
os
.
path
.
join
(
self
.
base_path
,
self
.
recipe
.
options
[
'path'
],
'hello.txt'
))
as
f
:
self
.
assertEqual
(
f
.
read
(),
'hello'
)
'hello
-form-data
.txt'
))
as
f
:
self
.
assertEqual
(
f
.
read
(),
'hello
-form-data
'
)
self
.
assertIn
(
'hello.txt'
,
requests
.
get
(
server_base_url
).
text
)
self
.
assertIn
(
'hello
-form-data
.txt'
,
requests
.
get
(
server_base_url
).
text
)
self
.
assertEqual
(
requests
.
get
(
server_base_url
+
'/hello.txt'
).
text
,
'hello'
)
requests
.
get
(
server_base_url
+
'/hello-form-data.txt'
).
text
,
'hello-form-data'
)
# post as application/x-www-form-urlencoded
resp
=
requests
.
post
(
server_base_url
,
data
=
{
'path'
:
'hello-form-urlencoded.txt'
,
'content'
:
'hello-form-urlencoded'
,
},
)
self
.
assertEqual
(
resp
.
status_code
,
requests
.
codes
.
ok
)
with
open
(
os
.
path
.
join
(
self
.
base_path
,
self
.
recipe
.
options
[
'path'
],
'hello-form-urlencoded.txt'
))
as
f
:
self
.
assertEqual
(
f
.
read
(),
'hello-form-urlencoded'
)
self
.
assertIn
(
'hello-form-urlencoded.txt'
,
requests
.
get
(
server_base_url
).
text
)
self
.
assertEqual
(
resp
.
text
,
'Content written to hello-form-urlencoded.txt'
)
self
.
assertEqual
(
requests
.
get
(
server_base_url
+
'/hello-form-urlencoded.txt'
).
text
,
'hello-form-urlencoded'
)
# incorrect paths are refused
for
path
in
'/hello.txt'
,
'../hello.txt'
:
...
...
software/buildout-testing/software-py
3
.cfg
→
software/buildout-testing/software-py
2
.cfg
View file @
c141e54f
...
...
@@ -3,4 +3,4 @@ extends =
software.cfg
[python]
part = python
3
part = python
2.7
software/buildout-testing/software.cfg
View file @
c141e54f
...
...
@@ -6,9 +6,6 @@ parts =
slapos-cookbook
template
[python]
part = python2.7
[slapos.buildout-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/slapos.buildout.git
...
...
software/erp5testnode/testsuite/deploy-test/runTestSuite.py
View file @
c141e54f
...
...
@@ -181,8 +181,8 @@ def main():
# Create the site
status_dict
=
waitForSite
(
args
.
partition_path
)
status_file
=
tempfile
.
NamedTemporaryFile
()
status_file
.
write
(
json
.
dumps
(
status_dict
)
)
status_file
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w'
)
json
.
dump
(
status_dict
,
status_file
)
status_file
.
flush
()
os
.
fsync
(
status_file
.
fileno
())
os
.
environ
[
'TEST_SITE_STATUS_JSON'
]
=
status_file
.
name
...
...
software/erp5testnode/testsuite/deploy-test/software.cfg
View file @
c141e54f
[buildout]
extends =
buildout.hash.cfg
https://lab.nexedi.com/nexedi/slapos/raw/1.0.27
1
/software/kvm/software.cfg
https://lab.nexedi.com/nexedi/slapos/raw/1.0.27
4
/software/kvm/software.cfg
parts =
python-with-eggs
template-deploy-test
...
...
software/slapos-testing/README.md
View file @
c141e54f
...
...
@@ -5,7 +5,7 @@ This software release is used to run unit test of slapos eggs.
The approach is to use nxdtest test runner, which will run tests for each
projects, as described in
`.nxdtest`
file.
The results of this test suite running on Nexedi ERP5 are published as
The results of this test suite running on Nexedi ERP5 are published as
`SlapOS.Eggs.UnitTest-Master.Python3`
and
`SlapOS.Eggs.UnitTest-Master.Python2`
.
...
...
@@ -36,14 +36,14 @@ source ( environment script from step above )
cd
~/srv/runner/instance/slappartXXX/parts/slapos.core/
# make some changes to the code
vim
slapos/tests/client.py
$EDITOR
slapos/tests/client.py
# run slapos.core tests
runTestSuite
--run
slapos.core
# ... or run all eggs tests
runTestSuite
# when satified, commit changes
# when sati
s
fied, commit changes
git add
-p
&&
git commit
# add developer's fork remote (this is only needed the first time)
...
...
software/slapos-testing/software-py
3
.cfg
→
software/slapos-testing/software-py
2
.cfg
View file @
c141e54f
...
...
@@ -3,4 +3,4 @@ extends =
software.cfg
[python]
part = python
3
part = python
2.7
software/slapos-testing/software.cfg
View file @
c141e54f
...
...
@@ -30,9 +30,6 @@ parts =
phantomjs
template
[python]
part = python2.7
[bootstrap-slapos.recipe.cmmi]
# install our develop version of slapos.recipe.cmmi before anything else,
# otherwise it will be installed from pypi by dependencies.
...
...
stack/slapos.cfg
View file @
c141e54f
...
...
@@ -193,7 +193,7 @@ setproctitle = 1.1.10
setuptools-dso = 1.7
rubygemsrecipe = 0.4.3
six = 1.16.0
slapos.cookbook = 1.0.2
53
slapos.cookbook = 1.0.2
72
slapos.core = 1.8.1
slapos.extension.shared = 1.0
slapos.libnetworkcache = 0.25
...
...
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