Migrate basic tests

Change-Id: I33d986a3d9f3367c30f54ebadb03df7fd508b0de
This commit is contained in:
Maor Blaustein 2024-02-15 18:30:38 +02:00
parent 0869dc69df
commit 927788881b

View File

@ -0,0 +1,68 @@
# Copyright 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from tempest.lib import decorators
from neutron_tempest_plugin.common import ssh
from neutron_tempest_plugin import config
from neutron_tempest_plugin.scenario import base
from whitebox_neutron_tempest_plugin.common import constants
CONF = config.CONF
class NetworkBasicTest(base.BaseTempestTestCase):
credentials = ['primary', 'admin']
force_tenant_isolation = False
# Default to ipv4.
_ip_version = 4
@decorators.idempotent_id('df9e38fd-4eb3-4d6c-b26a-a472856fdcb8')
def test_basic_instance_kuku(self):
self.setup_network_and_server()
self.check_connectivity(self.fip['floating_ip_address'],
CONF.validation.image_ssh_user,
self.keypair['private_key'])
@decorators.idempotent_id('c04e26a1-90e9-4099-8375-d55b5d5d55bd')
def test_ping_global_ip_from_vm_with_fip(self):
self.setup_network_and_server()
server_ssh_client = ssh.Client(self.fip['floating_ip_address'],
CONF.validation.image_ssh_user,
pkey=self.keypair['private_key'])
self.check_remote_connectivity(
server_ssh_client,
constants.GLOBAL_IP,
ping_count=1)
@decorators.idempotent_id('ff7f6a84-4705-4638-9fce-cdc79f8b2c73')
def test_soft_hard_vm_reboot(self):
self.setup_network_and_server()
self.check_connectivity(self.fip['floating_ip_address'],
CONF.validation.image_ssh_user,
self.keypair['private_key'])
# TODO(eolivare): restore the original order [HARD, SOFT] once
# BZ2064228 is resolved
reboot_types = ['SOFT', 'HARD']
for reboot_type in reboot_types:
self.os_primary.servers_client.reboot_server(
self.server['server']['id'], type=reboot_type)
self.wait_for_server_active(self.server['server'])
self.check_connectivity(
self.fip['floating_ip_address'],
CONF.validation.image_ssh_user,
self.keypair['private_key'])