Exemplo n.º 1
0
    def test_list(self):
        """Test that we can list the details of an IP group."""

        # In the actual test, we'll want to create a group or two for
        # list() to act on here

        # Try to list the groups--fails for now (operation not
        # implemented in nova)
        adaptor.assert_raises(novaclient.OpenStackException,
                              self.os.ipgroups.list)
Exemplo n.º 2
0
    def test_create(self):
        """Test that we can create an IP group."""

        # Start by creating a random IP group name
        name = self.randName()

        # Try to create the group--fails for now (operation not
        # implemented in nova)
        adaptor.assert_raises(novaclient.OpenStackException,
                              self.os.ipgroups.create, name)
Exemplo n.º 3
0
    def test_get(self):
        """Test that we can get the details of an IP group."""

        # In the actual test, we'll want to create a group for get()
        # to act on here

        # Try to get the group--fails for now (operation not
        # implemented in nova)
        adaptor.assert_raises(novaclient.OpenStackException,
                              self.os.ipgroups.get, 1)  # change 1 to group
Exemplo n.º 4
0
    def test_rebuild_server(self):
        """Verify that a server is created, rebuilt, and then deleted."""

        # Setup
        server_name = self.randName()
        new_server = self.os.servers.create(name=server_name,
                                            image=FLAGS.image,
                                            flavor=FLAGS.flavor)

        # Legal states...
        states = utils.StatusTracker('active', 'build', 'active')

        # Wait for server to transition to next state and make sure it
        # went to the correct one
        adaptor.assert_true(states.waitForState(self.os.servers.get,
                                                'status', new_server))

        # Verify the server was created correctly
        created_server = self.os.servers.get(new_server.id)
        adaptor.assert_equal(server_name, created_server.name)
        self.os.servers.rebuild(new_server.id, FLAGS.image)

        adaptor.assert_true(states.waitForState(self.os.servers.get,
                                                'status', new_server))

        created_server = self.os.servers.get(new_server.id)
        adaptor.assert_equal(server_name, created_server.name)
        img = self.os.images.get(FLAGS.image)

        adaptor.assert_equal(img.id, created_server.imageId)


        # Delete the server and verify it is removed
        new_server.delete()

        # Legal states...I don't believe it'll ever go to 'deleted',
        # though...
        states = utils.StatusTracker('active', 'build', 'deleted')
        adaptor.assert_raises(novaclient.NotFound, states.waitForState,
                              self.os.servers.get, 'status', new_server.id)