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
Léo-Paul Géneau
slapos
Commits
03e3600d
Commit
03e3600d
authored
May 23, 2019
by
Łukasz Nowak
Committed by
Łukasz Nowak
May 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jupyter: Test instantiation
parent
4fb830f3
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
473 additions
and
2 deletions
+473
-2
software/jupyter/test/README.md
software/jupyter/test/README.md
+1
-0
software/jupyter/test/setup.py
software/jupyter/test/setup.py
+50
-0
software/jupyter/test/test.py
software/jupyter/test/test.py
+88
-0
software/jupyter/test/utils.py
software/jupyter/test/utils.py
+326
-0
software/slapos-sr-testing/buildout.hash.cfg
software/slapos-sr-testing/buildout.hash.cfg
+1
-1
software/slapos-sr-testing/instance.cfg
software/slapos-sr-testing/instance.cfg
+1
-1
software/slapos-sr-testing/software.cfg
software/slapos-sr-testing/software.cfg
+6
-0
No files found.
software/jupyter/test/README.md
0 → 100644
View file @
03e3600d
Tests for Jupyter software release
software/jupyter/test/setup.py
0 → 100644
View file @
03e3600d
##############################################################################
#
# Copyright (c) 2019 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
setuptools
import
setup
,
find_packages
version
=
'0.0.1.dev0'
name
=
'slapos.test.jupyter'
long_description
=
open
(
"README.md"
).
read
()
setup
(
name
=
name
,
version
=
version
,
description
=
"Test for SlapOS' Jupter"
,
long_description
=
long_description
,
long_description_content_type
=
'text/markdown'
,
maintainer
=
"Nexedi"
,
maintainer_email
=
"info@nexedi.com"
,
url
=
"https://lab.nexedi.com/nexedi/slapos"
,
packages
=
find_packages
(),
install_requires
=
[
'slapos.core'
,
'slapos.libnetworkcache'
,
'erp5.util'
,
'requests'
,
],
zip_safe
=
True
,
test_suite
=
'test'
,
)
software/jupyter/test/test.py
0 → 100644
View file @
03e3600d
##############################################################################
#
# Copyright (c) 2019 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import
utils
import
httplib
import
json
import
os
import
requests
# for development: debugging logs and install Ctrl+C handler
if
os
.
environ
.
get
(
'SLAPOS_TEST_DEBUG'
):
import
logging
logging
.
basicConfig
(
level
=
logging
.
DEBUG
)
import
unittest
unittest
.
installHandler
()
class
TestJupyter
(
utils
.
SlapOSInstanceTestCase
):
@
classmethod
def
getSoftwareURLList
(
cls
):
return
(
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'software.cfg'
)),)
def
test
(
self
):
parameter_dict
=
self
.
computer_partition
.
getConnectionParameterDict
()
self
.
assertTrue
(
'_'
in
parameter_dict
)
try
:
connection_dict
=
json
.
loads
(
parameter_dict
[
'_'
])
except
Exception
as
e
:
self
.
fail
(
"Can't parse json in %s, error %s"
%
(
parameter_dict
[
'_'
],
e
))
ip
=
os
.
environ
[
'SLAPOS_TEST_IPV6'
]
self
.
assertEqual
(
{
'jupyter-classic-url'
:
'https://[%s]:8888/tree'
%
(
ip
,),
'jupyterlab-url'
:
'https://[%s]:8888/lab'
%
(
ip
,),
'url'
:
'https://[%s]:8888/tree'
%
(
ip
,)
},
connection_dict
)
result
=
requests
.
get
(
connection_dict
[
'url'
],
verify
=
False
,
allow_redirects
=
False
)
self
.
assertEqual
(
[
httplib
.
FOUND
,
True
,
'/login?next=%2Ftree'
],
[
result
.
status_code
,
result
.
is_redirect
,
result
.
headers
[
'Location'
]]
)
result
=
requests
.
get
(
connection_dict
[
'jupyter-classic-url'
],
verify
=
False
,
allow_redirects
=
False
)
self
.
assertEqual
(
[
httplib
.
FOUND
,
True
,
'/login?next=%2Ftree'
],
[
result
.
status_code
,
result
.
is_redirect
,
result
.
headers
[
'Location'
]]
)
result
=
requests
.
get
(
connection_dict
[
'jupyterlab-url'
],
verify
=
False
,
allow_redirects
=
False
)
self
.
assertEqual
(
[
httplib
.
FOUND
,
True
,
'/login?next=%2Flab'
],
[
result
.
status_code
,
result
.
is_redirect
,
result
.
headers
[
'Location'
]]
)
software/jupyter/test/utils.py
0 → 100644
View file @
03e3600d
This diff is collapsed.
Click to expand it.
software/slapos-sr-testing/buildout.hash.cfg
View file @
03e3600d
...
...
@@ -15,4 +15,4 @@
[template]
filename = instance.cfg
md5sum =
72c3b8bfb061a73e7a225c222bb598b4
md5sum =
8b3d678de7fd5333793bc3f4c770b53d
software/slapos-sr-testing/instance.cfg
View file @
03e3600d
...
...
@@ -28,7 +28,7 @@ bin = $${buildout:directory}/bin
working-dir = $${buildout:directory}/tmp
[test-list]
path_list = ${slapos.test.caddy-frontend-setup:setup},${slapos.test.erp5-setup:setup},${slapos.test.slapos-master-setup:setup},${slapos.test.kvm-setup:setup},${slapos.test.monitor-setup:setup},${slapos.test.plantuml-setup:setup},${slapos.test.powerdns-setup:setup},${slapos.test.proftpd-setup:setup},${slapos.test.re6stnet-setup:setup},${slapos.test.seleniumserver-setup:setup},${slapos.test.slaprunner-setup:setup},${slapos.test.helloworld-setup:setup}
path_list = ${slapos.test.caddy-frontend-setup:setup},${slapos.test.erp5-setup:setup},${slapos.test.slapos-master-setup:setup},${slapos.test.kvm-setup:setup},${slapos.test.monitor-setup:setup},${slapos.test.plantuml-setup:setup},${slapos.test.powerdns-setup:setup},${slapos.test.proftpd-setup:setup},${slapos.test.re6stnet-setup:setup},${slapos.test.seleniumserver-setup:setup},${slapos.test.slaprunner-setup:setup},${slapos.test.helloworld-setup:setup}
,${slapos.test.jupyter-setup:setup}
[slapos-test-runner]
recipe = slapos.cookbook:wrapper
...
...
software/slapos-sr-testing/software.cfg
View file @
03e3600d
...
...
@@ -81,6 +81,11 @@ setup = ${slapos-repository:location}/software/slaprunner/test/
egg = slapos.test.helloworld
setup = ${slapos-repository:location}/software/helloworld/test/
[slapos.test.jupyter-setup]
<= setup-develop-egg
egg = slapos.test.jupyter
setup = ${slapos-repository:location}/software/jupyter/test/
[eggs]
recipe = zc.recipe.egg
eggs =
...
...
@@ -102,6 +107,7 @@ eggs =
${slapos.test.re6stnet-setup:egg}
${slapos.test.seleniumserver-setup:egg}
${slapos.test.slaprunner-setup:egg}
${slapos.test.jupyter-setup:egg}
entry-points =
runTestSuite=erp5.util.testsuite:runTestSuite
...
...
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