How to use shutdown_host method in tempest

Best Python code snippet using tempest_python

hosts.py

Source:hosts.py Github

copy

Full Screen

1# Copyright 2014 NEC Corporation. All rights reserved.2#3# Licensed under the Apache License, Version 2.0 (the "License"); you may4# not use this file except in compliance with the License. You may obtain5# a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the12# License for the specific language governing permissions and limitations13# under the License.14import copy15from tempest.api_schema.response.compute import hosts16startup_host = {17 'status_code': [200],18 'response_body': hosts.common_start_up_body19}20# The 'power_action' attribute of 'shutdown_host' API is 'shutdown'21shutdown_host = copy.deepcopy(startup_host)22shutdown_host['response_body']['properties']['power_action'] = {23 'enum': ['shutdown']24}25# The 'power_action' attribute of 'reboot_host' API is 'reboot'26reboot_host = copy.deepcopy(startup_host)27reboot_host['response_body']['properties']['power_action'] = {28 'enum': ['reboot']29}30update_host = {31 'status_code': [200],32 'response_body': hosts.update_host_common...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful