blob: a8465915db6acc2158cf12e651b5b407aaeb122d [file] [log] [blame]
Itzik Browne67ebb52016-05-15 05:34:41 +00001# Copyright 2016 Red Hat, Inc.
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
Itzik Browne67ebb52016-05-15 05:34:41 +000015from tempest.common import waiters
Miguel Angel Ajocda3f072016-04-01 15:24:54 +020016from tempest import test
Itzik Browne67ebb52016-05-15 05:34:41 +000017
18from neutron.tests.tempest import config
19from neutron.tests.tempest.scenario import base
20from neutron.tests.tempest.scenario import constants
21
22CONF = config.CONF
Itzik Browne67ebb52016-05-15 05:34:41 +000023
24
25class NetworkBasicTest(base.BaseTempestTestCase):
26 credentials = ['primary']
27 force_tenant_isolation = False
28
29 # Default to ipv4.
30 _ip_version = 4
31
Miguel Angel Ajocda3f072016-04-01 15:24:54 +020032 @test.idempotent_id('de07fe0a-e955-449e-b48b-8641c14cd52e')
Itzik Browne67ebb52016-05-15 05:34:41 +000033 def test_basic_instance(self):
34 network = self.create_network()
35 subnet = self.create_subnet(network)
36
37 self.create_router_and_interface(subnet['id'])
38 keypair = self.create_keypair()
39 self.create_loginable_secgroup_rule()
40 server = self.create_server(
41 flavor_ref=CONF.compute.flavor_ref,
42 image_ref=CONF.compute.image_ref,
43 key_name=keypair['name'],
44 networks=[{'uuid': network['id']}])
45 waiters.wait_for_server_status(self.manager.servers_client,
46 server['server']['id'],
47 constants.SERVER_STATUS_ACTIVE)
48 port = self.client.list_ports(network_id=network['id'],
49 device_id=server[
50 'server']['id'])['ports'][0]
51 fip = self.create_and_associate_floatingip(port['id'])
52 self.check_connectivity(fip['floating_ip_address'],
53 CONF.validation.image_ssh_user,
54 keypair['private_key'])