Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Jérome Perrin
slapos.core
Commits
54612b28
Commit
54612b28
authored
11 years ago
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include more tests for check configuration and promises on a configured site.
parent
ed443054
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
17 deletions
+89
-17
master/bt5/slapos_configurator/TestTemplateItem/testSlapOSConfigurator.py
...s_configurator/TestTemplateItem/testSlapOSConfigurator.py
+88
-16
master/bt5/slapos_configurator/bt/revision
master/bt5/slapos_configurator/bt/revision
+1
-1
No files found.
master/bt5/slapos_configurator/TestTemplateItem/testSlapOSConfigurator.py
View file @
54612b28
...
...
@@ -14,10 +14,69 @@ import time
class
TestSlapOSConfigurator
(
testSlapOSMixin
):
def
testConfiguredVolatileCache
(
self
):
def
_testConfiguredPromiseViaAlarm
(
self
,
alarm_id
):
"""
Make sue one alarm is configured.
"""
Make sure Memcached is configured
alarm
=
getattr
(
self
.
portal
.
portal_alarms
,
alarm_id
,
None
)
self
.
assertNotEquals
(
alarm
,
None
)
alarm
.
activeSense
()
self
.
tic
()
self
.
failIf
(
alarm
.
sense
())
def
testConfiguredPAS
(
self
):
""" Make sure PAS is well configured, in this case
we trust on promise outcome."""
self
.
_testConfiguredPromiseViaAlarm
(
"promise_slapos_pas"
)
def
testConfiguredPASExternal
(
self
):
""" Make sure External PAS (Facebook, Google, Browser ID)
is well configured, in this case we trust on promise outcome."""
self
.
_testConfiguredPromiseViaAlarm
(
"promise_slapos_pas_external"
)
def
testConfiguredModuleGeneratorID
(
self
):
""" Make sure Generator ID is well configured, in this
case we trust on promise outcome."""
self
.
_testConfiguredPromiseViaAlarm
(
"promise_slapos_module_id_generator"
)
def
testConfiguredShacacheWebSite
(
self
):
""" Make sure Shacache WebSite is setuped by Alarm
case we trust on promise outcome."""
self
.
_testConfiguredPromiseViaAlarm
(
"promise_slapos_shacache_website"
)
def
testConfiguredVolatileCacheViaPromise
(
self
):
""" Make sure Volitile Cache was configured well,
invoking the alarm to check """
self
.
_testConfiguredPromiseViaAlarm
(
"promise_memcached_server"
)
def
testConfiguredPersistentCacheViaPromise
(
self
):
""" Make sure Persistent Cache was configured well,
invoking the alarm to check """
self
.
_testConfiguredPromiseViaAlarm
(
"promise_kumofs_server"
)
def
testConfiguredConversionServerViaPromise
(
self
):
""" Make sure Conversion Server was configured well,
invoking the alarm to check """
self
.
_testConfiguredPromiseViaAlarm
(
"promise_conversion_server"
)
def
testConfiguredCertificateAuthoringViaPromise
(
self
):
"""Make sure Certificate Authoring was configured well,
invoking the alarm to check. """
self
.
_testConfiguredPromiseViaAlarm
(
"promise_certificate_autority_tool"
)
def
testConfiguredTemplateToolViaPromise
(
self
):
""" Make sure Template Tool Repositories was configured well,
invoking the alarm to check """
self
.
_testConfiguredPromiseViaAlarm
(
"promise_template_tool_configuration"
)
def
testConfiguredVolatileCache
(
self
):
""" Make sure Memcached is configured
"""
if
self
.
isLiveTest
():
# This test is redundant with testConfiguredVolatileCacheViaPromise
# and it is only aims to verify if test environment is behaving as
# expected, nothing else, and if alamrs were invoked.
return
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
\
_getVolatileMemcachedServerDict
...
...
@@ -28,9 +87,14 @@ class TestSlapOSConfigurator(testSlapOSMixin):
url_string
)
def
testConfiguredPersistentCache
(
self
):
""" Make sure Kumofs is configured
"""
Make sure Kumofs is configured
"""
if
self
.
isLiveTest
():
# This test is redundant with testConfiguredVolatileCacheViaPromise
# and it is only aims to verify if test environment is behaving as
# expected, nothing else, and if alamrs were invoked.
return
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
\
_getPersistentMemcachedServerDict
memcached_tool
=
self
.
getPortal
().
portal_memcached
...
...
@@ -40,10 +104,14 @@ class TestSlapOSConfigurator(testSlapOSMixin):
url_string
)
def
testConfiguredConversionServer
(
self
):
"""
Make sure Conversion Server (Cloudooo) is
well configured
"""
""" Make sure Conversion Server (Cloudooo) is
well configured """
if
self
.
isLiveTest
():
# This test is redundant with testConfiguredVolatileCacheViaPromise
# and it is only aims to verify if test environment is behaving as
# expected, nothing else, and if alamrs were invoked.
return
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
\
_getConversionServerDict
# set preference
...
...
@@ -53,19 +121,23 @@ class TestSlapOSConfigurator(testSlapOSMixin):
self
.
assertEquals
(
preference_tool
.
getPreferredOoodocServerPortNumber
(),
conversion_dict
[
'port'
])
def
testConfiguredCertificateAuthoring
(
self
):
"""
Make sure Certificate Authoting is
well configured.
"""
""" Make sure Certificate Authoting is
well configured. """
if
self
.
isLiveTest
():
# This test is redundant with testConfiguredVolatileCacheViaPromise
# and it is only aims to verify if test environment is behaving as
# expected, nothing else, and if alamrs were invoked.
return
self
.
assertTrue
(
self
.
portal
.
hasObject
(
'portal_certificate_authority'
))
self
.
assertEquals
(
os
.
environ
[
'TEST_CA_PATH'
],
self
.
portal
.
portal_certificate_authority
.
certificate_authority_path
)
def
testConfiguredBusinessTemplateList
(
self
):
"""
Make sure Installed business Templates are
what it is expected.
"""
""" Make sure Installed business Templates are
what it is expected. """
expected_business_template_list
=
[
'erp5_core'
,
'erp5_xhtml_style'
,
...
...
This diff is collapsed.
Click to expand it.
master/bt5/slapos_configurator/bt/revision
View file @
54612b28
7
\ No newline at end of file
8
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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