Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
synnefo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
itminedu
synnefo
Commits
43e10603
Commit
43e10603
authored
Feb 13, 2014
by
Ilias Tsitsimpis
Committed by
Giorgos Korfiatis
Feb 13, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test 'reassign_server' functionality
parent
126e0938
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
6 deletions
+40
-6
snf-tools/synnefo_tools/burnin/common.py
snf-tools/synnefo_tools/burnin/common.py
+3
-5
snf-tools/synnefo_tools/burnin/projects_tests.py
snf-tools/synnefo_tools/burnin/projects_tests.py
+37
-1
No files found.
snf-tools/synnefo_tools/burnin/common.py
View file @
43e10603
...
...
@@ -249,10 +249,9 @@ class BurninTests(unittest.TestCase):
self
.
info
(
"Pithos url is %s"
,
self
.
clients
.
pithos_url
)
self
.
info
(
"Image url is %s"
,
self
.
clients
.
image_url
)
user_uuid
=
self
.
_get_uuid
()
self
.
quotas
=
self
.
_get_quotas
()
for
puuid
,
quotas
in
self
.
quotas
.
items
():
project_name
=
self
.
_get_project_name
(
puuid
,
user_uuid
)
project_name
=
self
.
_get_project_name
(
puuid
)
self
.
info
(
" Project %s:"
,
project_name
)
self
.
info
(
" Disk usage is %s bytes"
,
quotas
[
'cyclades.disk'
][
'usage'
])
...
...
@@ -580,10 +579,9 @@ class BurninTests(unittest.TestCase):
# ----------------------------------
# Projects
def
_get_project_name
(
self
,
puuid
,
uuid
=
None
):
def
_get_project_name
(
self
,
puuid
):
"""Get the name of a project"""
if
uuid
is
None
:
uuid
=
self
.
_get_uuid
()
uuid
=
self
.
_get_uuid
()
if
puuid
==
uuid
:
return
"base"
else
:
...
...
snf-tools/synnefo_tools/burnin/projects_tests.py
View file @
43e10603
...
...
@@ -39,7 +39,8 @@ This is the burnin class that tests the Projects functionality
import
random
from
synnefo_tools.burnin.common
import
Proper
from
synnefo_tools.burnin.cyclades_common
import
CycladesTests
from
synnefo_tools.burnin.cyclades_common
import
CycladesTests
,
\
QADD
,
QREMOVE
,
MB
,
GB
,
QDISK
,
QVM
,
QRAM
,
QCPU
# pylint: disable=too-many-public-methods
...
...
@@ -69,3 +70,38 @@ class QuotasTestSuite(CycladesTests):
# Wait for server to become active
self
.
_insist_on_server_transition
(
self
.
server
,
[
"BUILD"
],
"ACTIVE"
)
def
test_003_assign
(
self
):
"""Re-Assign the machine to a different project"""
# We will use the base project for now
new_project
=
self
.
_get_uuid
()
project_name
=
self
.
_get_project_name
(
new_project
)
self
.
info
(
"Assign %s to project %s"
,
self
.
server
[
'name'
],
project_name
)
# Reassign server
old_project
=
self
.
server
[
'tenant_id'
]
self
.
clients
.
cyclades
.
reassign_server
(
self
.
server
[
'id'
],
new_project
)
# Check tenant_id
self
.
server
=
self
.
_get_server_details
(
self
.
server
,
quiet
=
True
)
self
.
assertEqual
(
self
.
server
[
'tenant_id'
],
new_project
)
# Check new quotas
flavor
=
self
.
clients
.
compute
.
get_flavor_details
(
self
.
server
[
'flavor'
][
'id'
])
changes
=
\
{
old_project
:
[(
QDISK
,
QREMOVE
,
flavor
[
'disk'
],
GB
),
(
QVM
,
QREMOVE
,
1
,
None
),
(
QRAM
,
QREMOVE
,
flavor
[
'ram'
],
MB
),
(
QCPU
,
QREMOVE
,
flavor
[
'vcpus'
],
None
)],
new_project
:
[(
QDISK
,
QADD
,
flavor
[
'disk'
],
GB
),
(
QVM
,
QADD
,
1
,
None
),
(
QRAM
,
QADD
,
flavor
[
'ram'
],
MB
),
(
QCPU
,
QADD
,
flavor
[
'vcpus'
],
None
)]}
self
.
_check_quotas
(
changes
)
def
test_004_cleanup
(
self
):
"""Remove test server"""
self
.
_delete_servers
([
self
.
server
])
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