Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
a61e0639
Commit
a61e0639
authored
Sep 13, 2014
by
Sofia Papagiannaki
Browse files
burnin: Test copy/move images
parent
5678e65c
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-tools/synnefo_tools/burnin/images_tests.py
View file @
a61e0639
...
...
@@ -188,6 +188,59 @@ class ImagesTestSuite(BurninTests):
self
.
assertEqual
(
found_img
[
'name'
],
uni_name
)
self
.
info
(
"Image registered with id %s"
,
found_img
[
'id'
])
self
.
info
(
"Checking if image is listed "
"under the specific container in pithos"
)
self
.
_set_pithos_account
(
self
.
_get_uuid
())
pithos
=
self
.
clients
.
pithos
pithos
.
container
=
'burnin-images'
self
.
assertTrue
(
self
.
temp_image_name
in
(
o
[
'name'
]
for
o
in
pithos
.
list_objects
()))
self
.
info
(
"Checking copying image to "
"another pithos container."
)
pithos
.
container
=
other_container
=
'burnin-images-backup'
pithos
.
create_container
()
pithos
.
copy_object
(
src_container
=
'burnin-images'
,
src_object
=
self
.
temp_image_name
,
dst_container
=
other_container
,
dst_object
=
'%s_copy'
%
self
.
temp_image_name
)
# Verify quotas
file_size
=
os
.
path
.
getsize
(
self
.
temp_image_file
)
changes
=
\
{
self
.
_get_uuid
():
[(
QPITHOS
,
QADD
,
file_size
,
None
)]}
self
.
_check_quotas
(
changes
)
self
.
info
(
"Checking copied image "
"is listed among the images."
)
images
=
self
.
_get_list_of_images
(
detail
=
True
)
locations
=
[
i
[
'location'
]
for
i
in
images
]
location2
=
"pithos://"
+
self
.
_get_uuid
()
+
\
"/burnin-images-backup/"
+
'%s_copy'
%
self
.
temp_image_name
self
.
assertTrue
(
location2
in
locations
)
self
.
info
(
"Set image metadata in the pithos domain"
)
pithos
.
set_object_meta
(
'%s_copy'
%
self
.
temp_image_name
,
{
'foo'
:
'bar'
})
self
.
info
(
"Checking copied image "
"is still listed among the images."
)
images
=
self
.
_get_list_of_images
(
detail
=
True
)
locations
=
[
i
[
'location'
]
for
i
in
images
]
location2
=
"pithos://"
+
self
.
_get_uuid
()
+
\
"/burnin-images-backup/"
+
'%s_copy'
%
self
.
temp_image_name
self
.
assertTrue
(
location2
in
locations
)
# delete copied object
self
.
clients
.
pithos
.
del_object
(
'%s_copy'
%
self
.
temp_image_name
)
# Verify quotas
file_size
=
os
.
path
.
getsize
(
self
.
temp_image_file
)
changes
=
\
{
self
.
_get_uuid
():
[(
QPITHOS
,
QREMOVE
,
file_size
,
None
)]}
self
.
_check_quotas
(
changes
)
def
test_010_cleanup_image
(
self
):
"""Remove uploaded image from Pithos"""
# Remove uploaded image
...
...
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