Fix wrong setting of custom hostname by whole node struct

Use another node to validate duplacate hostname case

Change-Id: I755ca0e1c404b0adc35282d4d69639a7ba80db92
Closes-bug: #1610978
This commit is contained in:
Dmitry Kalashnik 2016-08-10 14:17:24 +03:00
parent d0127e34ca
commit f63a1ac4f0
1 changed files with 7 additions and 5 deletions

View File

@ -14,7 +14,7 @@
from random import randrange
from re import match
from keystoneauth1.exceptions import BadRequest
from keystoneauth1.exceptions import BadRequest, Conflict
from proboscis.asserts import assert_equal
from proboscis.asserts import assert_raises
from proboscis.asserts import assert_true
@ -233,12 +233,14 @@ class CustomHostname(TestBasic):
node = self.fuel_web.client.list_nodes()[0]
self.fuel_web.client.set_hostname(node['id'], custom_hostname)
# Try to change the hostname of the provisioned node
# Try to set duplicate hostname for another node
node = self.fuel_web.client.list_nodes()[1]
assert_raises(
BadRequest,
Conflict,
self.fuel_web.client.set_hostname,
node,
custom_hostname)
node["id"],
custom_hostname
)
self.env.make_snapshot("set_duplicate_hostname")