@@ -0,0 +1,2047 @@
+# 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 openstack.compute.v2 import server%0Afrom openstack.tests.functional import base%0A%0A%0Aclass TestServer(base.BaseFunctionalTest):%0A%0A    NAME = uuid.uuid4().hex%0A    ID = None%0A%0A    @classmethod%0A    def setUpClass(cls):%0A        super(TestServer, cls).setUpClass()%0A        # TODO(thowe): These values should be able to be set in clouds.yaml%0A        flavor = '4'%0A        image = cls.conn.image.find_image('fedora-20.x86_64')%0A        if image is None:%0A            image = cls.conn.image.find_image('cirros-0.3.4-x86_64-uec')%0A        if image is None:%0A            image = cls.conn.image.images().next()%0A        netid = ''%0A        if netid:%0A            args = %7B'networks': %5B%7B%22uuid%22: netid%7D%5D%7D%0A        else:%0A            args = %7B%7D%0A        sot = cls.conn.compute.create_server(%0A            name=cls.NAME, flavor=flavor, image=image.id, **args)%0A        assert isinstance(sot, server.Server)%0A        cls.assertIs(cls.NAME, sot.name)%0A        cls.ID = sot.id%0A%0A    @classmethod%0A    def tearDownClass(cls):%0A        sot = cls.conn.compute.delete_server(cls.ID)%0A        cls.assertIs(None, sot)%0A%0A    def test_find(self):%0A        sot = self.conn.compute.find_server(self.NAME)%0A        self.assertEqual(self.ID, sot.id)%0A%0A    def test_get(self):%0A        sot = self.conn.compute.get_server(self.ID)%0A        self.assertEqual(self.NAME, sot.name)%0A        self.assertEqual(self.ID, sot.id)%0A%0A    def test_list(self):%0A        names = %5Bo.name for o in self.conn.compute.servers()%5D%0A        self.assertIn(self.NAME, names)%0A

Add functional tests for servers