def test_resize(self): wait_for_active(self.nova_cloud_client, self.SERVER_MEMBER) #Everyone on the project can reboot novautils.resize(self.nova_member_client, self.SERVER_MEMBER, self.FLAVOR_SMALL_ID) wait_for_verify_resize(self.nova_cloud_client, self.SERVER_MEMBER) novautils.confirm_resize(self.nova_cloud_client, self.SERVER_MEMBER) novautils.start(self.nova_cloud_client, self.SERVER_MEMBER) wait_for_active(self.nova_cloud_client, self.SERVER_MEMBER) novautils.pause(self.nova_member_client, self.SERVER_MEMBER) wait_for_status(self.nova_cloud_client, self.SERVER_MEMBER, "PAUSED") novautils.resize(self.nova_cloud_client, self.SERVER_MEMBER, self.FLAVOR_TINY_ID) novautils.confirm_resize(self.nova_cloud_client, self.SERVER_MEMBER) wait_for_active(self.nova_cloud_client, self.SERVER_MEMBER) # Member from another project can't self.assertAnyRaise( lambda: novautils.resize(self.other_member_client, self. SERVER_MEMBER, self.FLAVOR_SMALL_ID))
def test_pause_unpause(self): print 'test_pause_unpause' # Member can, since he is the owner wait_for_active(self.nova_cloud_client, self.SERVER_MEMBER) novautils.pause(self.nova_member_client, self.SERVER_MEMBER) wait_for_status(self.nova_cloud_client, self.SERVER_MEMBER, "PAUSED") self.assertTrue(self.SERVER_MEMBER.status == "PAUSED") novautils.unpause(self.nova_cloud_client, self.SERVER_MEMBER) wait_for_status(self.nova_cloud_client, self.SERVER_MEMBER, "ACTIVE") # From other project can' do self.assertAnyRaise(lambda: novautils.pause(self.other_member_client, self.SERVER_MEMBER)) self.assertAnyRaise(lambda: novautils.unpause( self.other_nova_project_admin_client, self.SERVER_MEMBER))
def test_pause_unpause(self): print 'test_pause_unpause' # Member can, since he is the owner wait_for_active(self.nova_cloud_client, self.SERVER_MEMBER) novautils.pause(self.nova_member_client, self.SERVER_MEMBER) wait_for_status(self.nova_cloud_client, self.SERVER_MEMBER, "PAUSED") self.assertTrue(self.SERVER_MEMBER.status == "PAUSED") novautils.unpause(self.nova_cloud_client, self.SERVER_MEMBER) wait_for_status(self.nova_cloud_client, self.SERVER_MEMBER, "ACTIVE") # From other project can' do self.assertAnyRaise(lambda: novautils.pause(self.other_member_client, self.SERVER_MEMBER)) self.assertAnyRaise(lambda: novautils.unpause(self.other_nova_project_admin_client, self.SERVER_MEMBER))
def test_resize(self): wait_for_active(self.nova_cloud_client, self.SERVER_MEMBER) #Everyone on the project can reboot novautils.resize(self.nova_member_client, self.SERVER_MEMBER, self.FLAVOR_SMALL_ID) wait_for_verify_resize(self.nova_cloud_client, self.SERVER_MEMBER) novautils.confirm_resize(self.nova_cloud_client, self.SERVER_MEMBER) novautils.start(self.nova_cloud_client, self.SERVER_MEMBER) wait_for_active(self.nova_cloud_client, self.SERVER_MEMBER) novautils.pause(self.nova_member_client, self.SERVER_MEMBER) wait_for_status(self.nova_cloud_client, self.SERVER_MEMBER, "PAUSED") novautils.resize(self.nova_cloud_client, self.SERVER_MEMBER, self.FLAVOR_TINY_ID) novautils.confirm_resize(self.nova_cloud_client, self.SERVER_MEMBER) wait_for_active(self.nova_cloud_client, self.SERVER_MEMBER) # Member from another project can't self.assertAnyRaise(lambda: novautils.resize(self.other_member_client, self.SERVER_MEMBER, self.FLAVOR_SMALL_ID))