Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.cmmi
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
Dmitry Blinov
slapos.recipe.cmmi
Commits
50958d2e
Commit
50958d2e
authored
Feb 21, 2013
by
Jondy Zhao
Committed by
Cédric de Saint Martin
Apr 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for multiple platforms.
parent
f10c38e3
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
813 additions
and
11 deletions
+813
-11
slapos/recipe/cmmi/README.txt
slapos/recipe/cmmi/README.txt
+549
-3
slapos/recipe/cmmi/__init__.py
slapos/recipe/cmmi/__init__.py
+158
-8
slapos/recipe/cmmi/tests.py
slapos/recipe/cmmi/tests.py
+106
-0
No files found.
slapos/recipe/cmmi/README.txt
View file @
50958d2e
This diff is collapsed.
Click to expand it.
slapos/recipe/cmmi/__init__.py
View file @
50958d2e
This diff is collapsed.
Click to expand it.
slapos/recipe/cmmi/tests.py
View file @
50958d2e
...
...
@@ -60,6 +60,7 @@ class NonInformativeTests(unittest.TestCase):
}
}
bo
.
update
(
buildout
)
bo
[
'buildout'
].
update
(
buildout_options
)
return
Recipe
(
bo
,
name
,
options
)
def
test_working_directory_restored_after_failure
(
self
):
...
...
@@ -199,6 +200,111 @@ class NonInformativeTests(unittest.TestCase):
except
ValueError
as
e
:
self
.
assertEqual
(
str
(
e
),
'sentinel bar'
)
def
no_test_make_target_with_prefix
(
self
):
recipe
=
self
.
make_recipe
({},
'test'
,
{
'url'
:
'file://%s/testdata/package-0.0.0.tar.gz'
%
os
.
path
.
dirname
(
__file__
),
'configure-command'
:
'./configure'
,
'pre-install'
:
'sed -i -e "s/installing package/installing package at
\
$
\
$prefix /g" Makefile'
,
})
os
.
chdir
(
self
.
dir
)
recipe
.
install
()
recipe
=
self
.
make_recipe
({},
'test'
,
{
'url'
:
'file://%s/testdata/package-0.0.0.tar.gz'
%
os
.
path
.
dirname
(
__file__
),
'pre-install'
:
'sed -i -e "s/installing package/installing package at
\
$
\
$prefix /g" Makefile'
,
'make-targets'
:
'install-lib prefix=%(prefix)s'
,
})
recipe
.
install
()
def
test_download_file
(
self
):
recipe
=
self
.
make_recipe
({},
'test'
,
{
'url'
:
'file://%s/testdata/package-0.0.0.tar.gz'
%
os
.
path
.
dirname
(
__file__
),
})
url
=
'%s/testdata/package-0.0.0.tar.gz'
%
os
.
path
.
dirname
(
__file__
)
file
,
is_temp
=
recipe
.
download_file
(
url
)
self
.
assertFalse
(
is_temp
)
self
.
assertEquals
(
file
,
url
)
url
=
'ftp://ftp.gnu.org/welcome.msg'
file
,
is_temp
=
recipe
.
download_file
(
url
)
self
.
assertTrue
(
is_temp
)
self
.
assertTrue
(
os
.
path
.
exists
(
file
))
url
=
'ftp://ftp.gnu.org/welcome.msg#ec7ab8024467ba3b6e173c57fd4990f6'
file
,
is_temp
=
recipe
.
download_file
(
url
)
self
.
assertTrue
(
is_temp
)
self
.
assertTrue
(
os
.
path
.
exists
(
file
))
url
=
'ftp://ftp.gnu.org/welcome.msg#0205'
self
.
assertRaises
(
zc
.
buildout
.
download
.
ChecksumError
,
recipe
.
download_file
,
url
)
def
test_buildout_prefix
(
self
):
buildout_prefix
=
os
.
path
.
join
(
self
.
dir
,
'test_parts/test_local'
)
os
.
makedirs
(
buildout_prefix
)
recipe
=
self
.
make_recipe
({},
'test'
,
{
'url'
:
'file://%s/testdata/package-0.0.0.tar.gz'
%
os
.
path
.
dirname
(
__file__
),
},
prefix
=
buildout_prefix
)
self
.
assertEquals
(
recipe
.
options
.
get
(
'prefix'
),
buildout_prefix
)
recipe
=
self
.
make_recipe
({},
'test'
,
{
'url'
:
'file://%s/testdata/package-0.0.0.tar.gz'
%
os
.
path
.
dirname
(
__file__
),
'prefix'
:
self
.
dir
,
},
prefix
=
buildout_prefix
)
self
.
assertEquals
(
recipe
.
options
.
get
(
'prefix'
),
self
.
dir
)
def
test_get_installed_files
(
self
):
prefix
=
os
.
path
.
join
(
self
.
dir
,
'test_parts/test_local'
)
os
.
makedirs
(
prefix
)
recipe
=
self
.
make_recipe
({},
'test'
,
{
'url'
:
'file://%s/testdata/package-0.0.0.tar.gz'
%
os
.
path
.
dirname
(
__file__
),
})
os
.
chdir
(
self
.
dir
)
# The hook script does not return anything so we (ab)use exceptions
# as a mechanism for asserting the function behaviour.
no_installed_files
=
(
'a.txt'
,
'b.txt'
,
'c'
,
'c/d.txt'
)
installed_files
=
[
'e.txt'
,
'f.txt'
,
'g'
,
'g/h.txt'
]
for
s
in
no_installed_files
:
if
s
.
endswith
(
'.txt'
):
f
=
open
(
os
.
path
.
join
(
prefix
,
s
),
'w'
)
f
.
write
(
s
)
f
.
close
()
else
:
os
.
makedirs
(
os
.
path
.
join
(
prefix
,
s
))
sleep
(
2
)
ref_path
=
os
.
path
.
join
(
self
.
dir
,
'refs'
)
os
.
makedirs
(
ref_path
)
sleep
(
2
)
for
s
in
installed_files
:
if
s
.
endswith
(
'.txt'
):
f
=
open
(
os
.
path
.
join
(
prefix
,
s
),
'w'
)
f
.
write
(
s
)
f
.
close
()
else
:
os
.
makedirs
(
os
.
path
.
join
(
prefix
,
s
))
recipe
.
buildout_prefix
=
prefix
file_list
=
recipe
.
get_installed_files
(
ref_path
)
installed_files
.
pop
(
2
)
self
.
assertEquals
([
os
.
path
.
relpath
(
f
,
prefix
)
for
f
in
file_list
],
installed_files
)
def
test_honor_buidlout_keep_compile_directory
(
self
):
buildout
=
{
'keep-compile-dir'
:
'true'
}
recipe
=
self
.
make_recipe
({},
'test'
,
{
'url'
:
'file://%s/testdata/package-0.0.0.tar.gz'
%
os
.
path
.
dirname
(
__file__
),
},
**
buildout
)
os
.
chdir
(
self
.
dir
)
recipe
.
install
()
build_directory
=
os
.
path
.
join
(
self
.
dir
,
'test_parts/test__compile__'
)
self
.
assertTrue
(
os
.
path
.
exists
(
build_directory
))
def
test_suite
():
suite
=
unittest
.
TestSuite
((
...
...
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