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
Xiaowu Zhang
slapos
Commits
95e7f907
Commit
95e7f907
authored
Jan 24, 2017
by
Tristan Cavelier
Committed by
Rafael Monnerat
Jan 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recipe/generic_cloudooo: add test
parent
63831b39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
slapos/test/recipe/test_generic_cloudooo.py
slapos/test/recipe/test_generic_cloudooo.py
+60
-0
No files found.
slapos/test/recipe/test_generic_cloudooo.py
0 → 100644
View file @
95e7f907
import
os
import
sys
import
unittest
from
tempfile
import
mkdtemp
from
shutil
import
rmtree
from
slapos.recipe
import
generic_cloudooo
class
TestGenericCloudooo
(
unittest
.
TestCase
):
def
new_recipe
(
self
,
options
):
buildout
=
{
'buildout'
:
{
'bin-directory'
:
''
,
'find-links'
:
''
,
'allow-hosts'
:
''
,
'develop-eggs-directory'
:
''
,
'eggs-directory'
:
''
,
'python'
:
'testpython'
,
},
'testpython'
:
{
'executable'
:
sys
.
executable
,
},
'slap-connection'
:
{
'computer-id'
:
''
,
'partition-id'
:
''
,
'server-url'
:
''
,
'software-release-url'
:
''
,
}
}
return
generic_cloudooo
.
Recipe
(
buildout
=
buildout
,
name
=
'generic_cloudooo'
,
options
=
options
)
def
setUp
(
self
):
self
.
test_dir
=
mkdtemp
()
def
tearDown
(
self
):
if
os
.
path
.
exists
(
self
.
test_dir
):
rmtree
(
self
.
test_dir
)
def
test_install
(
self
):
# Basic check
config_file_path
=
os
.
path
.
join
(
self
.
test_dir
,
"test_install_configuration_file_etc_cloudooo-X.cfg"
)
recipe
=
self
.
new_recipe
({
"ip"
:
"test_install_ip"
,
"environment"
:
"test_install=environment"
,
"mimetype_entry_addition"
:
"text/install mimetype/entry addition"
,
"ooo-binary-path"
:
"test_install_ooo_binary_path"
,
"ooo-paster"
:
"test_install_ooo_paster"
,
"ooo-uno-path"
:
"test_ooo_uno_path"
,
"port"
:
"123"
,
"openoffice-port"
:
"234"
,
"configuration-file"
:
config_file_path
,
"data-directory"
:
os
.
path
.
join
(
self
.
test_dir
,
"test_install_data_directory_srv_cloudooo-X"
),
"wrapper"
:
os
.
path
.
join
(
self
.
test_dir
,
"test_install_wrapper_service_cloudooo-X"
),
})
recipe
.
install
()
data
=
open
(
config_file_path
).
read
()
self
.
assertIn
(
"[app:main]"
,
data
)
self
.
assertIn
(
"[server:main]"
,
data
)
# Check if mimetype_registry is well ordered
self
.
assertIn
(
"
\
n
text/install mimetype/entry addition
\
n
text/* * ooo
\
n
"
,
data
)
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