@@ -0,0 +1,2171 @@
+#    Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A#    not use this file except in compliance with the License. You may obtain%0A#    a copy of the License at%0A#%0A#         http://www.apache.org/licenses/LICENSE-2.0%0A#%0A#    Unless required by applicable law or agreed to in writing, software%0A#    distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A#    License for the specific language governing permissions and limitations%0A#    under the License.%0A%0Aimport uuid%0A%0Afrom functional.common import test%0A%0A%0Aclass FloatingIpTests(test.TestCase):%0A    %22%22%22Functional tests for floating ip. %22%22%22%0A    SUBNET_NAME = uuid.uuid4().hex%0A    NETWORK_NAME = uuid.uuid4().hex%0A    ID = None%0A    HEADERS = %5B'ID'%5D%0A    FIELDS = %5B'id'%5D%0A%0A    @classmethod%0A    def setUpClass(cls):%0A        # Create a network for the floating ip.%0A        cls.openstack('network create --external ' + cls.NETWORK_NAME)%0A        # Create a subnet for the network.%0A        cls.openstack(%0A            'subnet create --network ' + cls.NETWORK_NAME +%0A            ' --subnet-range 10.10.10.0/24 ' +%0A            cls.SUBNET_NAME%0A        )%0A        opts = cls.get_show_opts(cls.FIELDS)%0A        raw_output = cls.openstack(%0A            'ip floating create ' + cls.NETWORK_NAME + opts)%0A        cls.ID = raw_output.strip('%5Cn')%0A%0A    @classmethod%0A    def tearDownClass(cls):%0A        raw_output = cls.openstack('ip floating delete ' + cls.ID)%0A        cls.assertOutput('', raw_output)%0A        raw_output = cls.openstack('subnet delete ' + cls.SUBNET_NAME)%0A        cls.assertOutput('', raw_output)%0A        raw_output = cls.openstack('network delete ' + cls.NETWORK_NAME)%0A        cls.assertOutput('', raw_output)%0A%0A    def test_floating_ip_list(self):%0A        opts = self.get_list_opts(self.HEADERS)%0A        raw_output = self.openstack('ip floating list' + opts)%0A        self.assertIn(self.ID, raw_output)%0A%0A    def test_floating_ip_show(self):%0A        opts = self.get_show_opts(self.FIELDS)%0A        raw_output = self.openstack('ip floating show ' + self.ID + opts)%0A        self.assertEqual(self.ID + %22%5Cn%22, raw_output)%0A

Add functional tests for commands of floating ip