diff --git a/etc/logging.conf.sample b/etc/logging.conf.sample
new file mode 100644
index 0000000..5c1ea5f
--- /dev/null
+++ b/etc/logging.conf.sample
@@ -0,0 +1,30 @@
+[loggers]
+keys=root
+
+[formatters]
+keys=normal,debug
+
+[handlers]
+keys=file,devel
+
+[logger_root]
+level=NOTSET
+handlers=file
+
+[handler_file]
+class=FileHandler
+level=DEBUG
+formatter=normal
+args=('tempest.log', 'w')
+
+[handler_devel]
+class=StreamHandler
+level=DEBUG
+formatter=debug
+args=(sys.stdout,)
+
+[formatter_normal]
+format=%(asctime)s %(levelname)s %(message)s
+
+[formatter_debug]
+format=%(asctime)s %(levelname)s %(module)s %(funcName)s %(message)s
diff --git a/run_tests.sh b/run_tests.sh
index 25b9729..6fcdd90 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -17,6 +17,8 @@
   echo "  -h, --help               Print this usage message"
   echo "  -d, --debug              Debug this script -- set -o xtrace"
   echo "  -S, --stdout             Don't capture stdout"
+  echo "  -l, --logging            Enable logging"
+  echo "  -L, --logging-config     Logging config file location.  Default is etc/logging.conf"
   echo "  -- [NOSEOPTIONS]         After the first '--' you can pass arbitrary arguments to nosetests "
 }
 
@@ -32,8 +34,10 @@
 nova_coverage=0
 config_file=""
 update=0
+logging=0
+logging_config=etc/logging.conf
 
-if ! options=$(getopt -o VNnfuswcphdSC: -l virtual-env,no-virtual-env,no-site-packages,force,update,smoke,whitebox,nova-coverage,pep8,help,debug,stdout,config: -- "$@")
+if ! options=$(getopt -o VNnfuswcphdSC:lL: -l virtual-env,no-virtual-env,no-site-packages,force,update,smoke,whitebox,nova-coverage,pep8,help,debug,stdout,config:,logging,logging-config: -- "$@")
 then
     # parse error
     usage
@@ -57,6 +61,8 @@
     -s|--smoke) noseargs="$noseargs --attr=type=smoke";;
     -w|--whitebox) noseargs="$noseargs --attr=type=whitebox";;
     -S|--stdout) noseargs="$noseargs -s";;
+    -l|--logging) logging=1;;
+    -L|--logging-config) logging_config=$2; shift;;
     --) [ "yes" == "$first_uu" ] || noseargs="$noseargs $1"; first_uu=no  ;;
     *) noseargs="$noseargs $1"
   esac
@@ -78,6 +84,14 @@
 export NOSE_OPENSTACK_SHOW_ELAPSED=1
 export NOSE_OPENSTACK_STDOUT=1
 
+if [ $logging -eq 1 ]; then
+    if [ ! -f "$logging_config" ]; then
+        echo "No such logging config file: $logging_config"
+        exit
+    fi
+    noseargs="$noseargs --logging-config=$logging_config"
+fi
+
 if [ $no_site_packages -eq 1 ]; then
   installvenvopts="--no-site-packages"
 fi
diff --git a/tempest/clients.py b/tempest/clients.py
index 38334d7..8f8d5e6 100644
--- a/tempest/clients.py
+++ b/tempest/clients.py
@@ -20,6 +20,8 @@
 from tempest import config
 from tempest import exceptions
 from tempest.services import botoclients
+from tempest.services.compute.json.aggregates_client import \
+    AggregatesClientJSON
 from tempest.services.compute.json.extensions_client import \
     ExtensionsClientJSON
 from tempest.services.compute.json.fixed_ips_client import FixedIPsClientJSON
@@ -251,6 +253,7 @@
         self.custom_object_client = ObjectClientCustomizedHeader(*client_args)
         self.custom_account_client = \
             AccountClientCustomizedHeader(*client_args)
+        self.aggregates_client = AggregatesClientJSON(*client_args)
 
 
 class AltManager(Manager):
diff --git a/tempest/services/compute/json/aggregates_client.py b/tempest/services/compute/json/aggregates_client.py
new file mode 100644
index 0000000..7ae1eee
--- /dev/null
+++ b/tempest/services/compute/json/aggregates_client.py
@@ -0,0 +1,86 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2013 NEC Corporation.
+# 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.
+
+import json
+
+from tempest.common.rest_client import RestClient
+from tempest import exceptions
+
+
+class AggregatesClientJSON(RestClient):
+
+    def __init__(self, config, username, password, auth_url, tenant_name=None):
+        super(AggregatesClientJSON, self).__init__(config, username, password,
+                                                   auth_url, tenant_name)
+        self.service = self.config.compute.catalog_type
+
+    def list_aggregates(self):
+        """Get aggregate list."""
+        resp, body = self.get("os-aggregates")
+        body = json.loads(body)
+        return resp, body['aggregates']
+
+    def get_aggregate(self, aggregate_id):
+        """Get details of the given aggregate."""
+        resp, body = self.get("os-aggregates/%s" % str(aggregate_id))
+        body = json.loads(body)
+        return resp, body['aggregate']
+
+    def create_aggregate(self, name, availability_zone=None):
+        """Creates a new aggregate."""
+        post_body = {
+            'name': name,
+            'availability_zone': availability_zone,
+        }
+        post_body = json.dumps({'aggregate': post_body})
+        resp, body = self.post('os-aggregates', post_body, self.headers)
+
+        body = json.loads(body)
+        return resp, body['aggregate']
+
+    def delete_aggregate(self, aggregate_id):
+        """Deletes the given aggregate."""
+        return self.delete("os-aggregates/%s" % str(aggregate_id))
+
+    def is_resource_deleted(self, id):
+        try:
+            self.get_aggregate(id)
+        except exceptions.NotFound:
+            return True
+        return False
+
+    def add_host(self, aggregate_id, host):
+        """Adds a host to the given aggregate."""
+        post_body = {
+            'host': host,
+        }
+        post_body = json.dumps({'add_host': post_body})
+        resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
+                               post_body, self.headers)
+        body = json.loads(body)
+        return resp, body['aggregate']
+
+    def remove_host(self, aggregate_id, host):
+        """Removes a host from the given aggregate."""
+        post_body = {
+            'host': host,
+        }
+        post_body = json.dumps({'remove_host': post_body})
+        resp, body = self.post('os-aggregates/%s/action' % aggregate_id,
+                               post_body, self.headers)
+        body = json.loads(body)
+        return resp, body['aggregate']
diff --git a/tempest/tests/compute/admin/test_aggregates.py b/tempest/tests/compute/admin/test_aggregates.py
new file mode 100644
index 0000000..06acc41
--- /dev/null
+++ b/tempest/tests/compute/admin/test_aggregates.py
@@ -0,0 +1,256 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2013 NEC Corporation.
+# 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.common.utils.data_utils import rand_name
+from tempest import exceptions
+from tempest.test import attr
+from tempest.tests.compute import base
+
+
+class AggregatesAdminTestJSON(base.BaseComputeAdminTest):
+
+    """
+    Tests Aggregates API that require admin privileges
+    """
+
+    _interface = 'json'
+
+    @classmethod
+    def setUpClass(cls):
+        super(AggregatesAdminTestJSON, cls).setUpClass()
+        cls.client = cls.os_adm.aggregates_client
+        cls.user_client = cls.os.aggregates_client
+        cls.aggregate_name_prefix = 'test_aggregate_'
+        cls.az_name_prefix = 'test_az_'
+
+        resp, hosts_all = cls.os_adm.hosts_client.list_hosts()
+        hosts = map(lambda x: x['host_name'],
+                    filter(lambda y: y['service'] == 'compute', hosts_all))
+        cls.host = hosts[0]
+
+    @attr(type='positive')
+    def test_aggregate_create_delete(self):
+        # Create and delete an aggregate.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.assertEquals(200, resp.status)
+        self.assertEquals(aggregate_name, aggregate['name'])
+        self.assertEquals(None, aggregate['availability_zone'])
+
+        resp, _ = self.client.delete_aggregate(aggregate['id'])
+        self.assertEquals(200, resp.status)
+        self.client.wait_for_resource_deletion(aggregate['id'])
+
+    @attr(type='positive')
+    def test_aggregate_create_delete_with_az(self):
+        # Create and delete an aggregate.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        az_name = rand_name(self.az_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name, az_name)
+        self.assertEquals(200, resp.status)
+        self.assertEquals(aggregate_name, aggregate['name'])
+        self.assertEquals(az_name, aggregate['availability_zone'])
+
+        resp, _ = self.client.delete_aggregate(aggregate['id'])
+        self.assertEquals(200, resp.status)
+        self.client.wait_for_resource_deletion(aggregate['id'])
+
+    @attr(type='positive')
+    def test_aggregate_create_verify_entry_in_list(self):
+        # Create an aggregate and ensure it is listed.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+
+        resp, aggregates = self.client.list_aggregates()
+        self.assertEquals(200, resp.status)
+        self.assertIn((aggregate['id'], aggregate['availability_zone']),
+                      map(lambda x: (x['id'], x['availability_zone']),
+                          aggregates))
+
+    @attr(type='positive')
+    def test_aggregate_create_get_details(self):
+        # Create an aggregate and ensure its details are returned.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+
+        resp, body = self.client.get_aggregate(aggregate['id'])
+        self.assertEquals(200, resp.status)
+        self.assertEquals(aggregate['name'], body['name'])
+        self.assertEquals(aggregate['availability_zone'],
+                          body['availability_zone'])
+
+    @attr(type='negative')
+    def test_aggregate_create_as_user(self):
+        # Regular user is not allowed to create an aggregate.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        self.assertRaises(exceptions.Unauthorized,
+                          self.user_client.create_aggregate,
+                          aggregate_name)
+
+    @attr(type='negative')
+    def test_aggregate_delete_as_user(self):
+        # Regular user is not allowed to delete an aggregate.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+
+        self.assertRaises(exceptions.Unauthorized,
+                          self.user_client.delete_aggregate,
+                          aggregate['id'])
+
+    @attr(type='negative')
+    def test_aggregate_list_as_user(self):
+        # Regular user is not allowed to list aggregates.
+        self.assertRaises(exceptions.Unauthorized,
+                          self.user_client.list_aggregates)
+
+    @attr(type='negative')
+    def test_aggregate_get_details_as_user(self):
+        # Regular user is not allowed to get aggregate details.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+
+        self.assertRaises(exceptions.Unauthorized,
+                          self.user_client.get_aggregate,
+                          aggregate['id'])
+
+    @attr(type='negative')
+    def test_aggregate_delete_with_invalid_id(self):
+        # Delete an aggregate with invalid id should raise exceptions.
+        self.assertRaises(exceptions.NotFound,
+                          self.client.delete_aggregate, -1)
+
+    @attr(type='negative')
+    def test_aggregate_get_details_with_invalid_id(self):
+        # Get aggregate details with invalid id should raise exceptions.
+        self.assertRaises(exceptions.NotFound,
+                          self.client.get_aggregate, -1)
+
+    @attr(type='positive')
+    def test_aggregate_add_remove_host(self):
+        # Add an host to the given aggregate and remove.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+
+        resp, body = self.client.add_host(aggregate['id'], self.host)
+        self.assertEquals(200, resp.status)
+        self.assertEquals(aggregate_name, body['name'])
+        self.assertEquals(aggregate['availability_zone'],
+                          body['availability_zone'])
+        self.assertIn(self.host, body['hosts'])
+
+        resp, body = self.client.remove_host(aggregate['id'], self.host)
+        self.assertEquals(200, resp.status)
+        self.assertEquals(aggregate_name, body['name'])
+        self.assertEquals(aggregate['availability_zone'],
+                          body['availability_zone'])
+        self.assertNotIn(self.host, body['hosts'])
+
+    @attr(type='positive')
+    def test_aggregate_add_host_list(self):
+        # Add an host to the given aggregate and list.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+        self.client.add_host(aggregate['id'], self.host)
+        self.addCleanup(self.client.remove_host, aggregate['id'], self.host)
+
+        resp, aggregates = self.client.list_aggregates()
+        aggs = filter(lambda x: x['id'] == aggregate['id'], aggregates)
+        self.assertEquals(1, len(aggs))
+        agg = aggs[0]
+        self.assertEquals(aggregate_name, agg['name'])
+        self.assertEquals(None, agg['availability_zone'])
+        self.assertIn(self.host, agg['hosts'])
+
+    @attr(type='positive')
+    def test_aggregate_add_host_get_details(self):
+        # Add an host to the given aggregate and get details.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+        self.client.add_host(aggregate['id'], self.host)
+        self.addCleanup(self.client.remove_host, aggregate['id'], self.host)
+
+        resp, body = self.client.get_aggregate(aggregate['id'])
+        self.assertEquals(aggregate_name, body['name'])
+        self.assertEquals(None, body['availability_zone'])
+        self.assertIn(self.host, body['hosts'])
+
+    @attr(type='positive')
+    def test_aggregate_add_host_create_server_with_az(self):
+        # Add an host to the given aggregate and create a server.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        az_name = rand_name(self.az_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name, az_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+        self.client.add_host(aggregate['id'], self.host)
+        self.addCleanup(self.client.remove_host, aggregate['id'], self.host)
+
+        server_name = rand_name('test_server_')
+        servers_client = self.servers_client
+        admin_servers_client = self.os_adm.servers_client
+        resp, server = self.create_server(name=server_name,
+                                          availability_zone=az_name)
+        servers_client.wait_for_server_status(server['id'], 'ACTIVE')
+        resp, body = admin_servers_client.get_server(server['id'])
+        self.assertEqual(self.host, body['OS-EXT-SRV-ATTR:host'])
+
+    @attr(type='negative')
+    def test_aggregate_add_non_exist_host(self):
+        # Adding a non-exist host to an aggregate should raise exceptions.
+        resp, hosts_all = self.os_adm.hosts_client.list_hosts()
+        hosts = map(lambda x: x['host_name'], hosts_all)
+        while True:
+            non_exist_host = rand_name('nonexist_host_')
+            if non_exist_host not in hosts:
+                break
+
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+
+        self.assertRaises(exceptions.NotFound, self.client.add_host,
+                          aggregate['id'], non_exist_host)
+
+    @attr(type='negative')
+    def test_aggregate_add_host_as_user(self):
+        # Regular user is not allowed to add a host to an aggregate.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+
+        self.assertRaises(exceptions.Unauthorized,
+                          self.user_client.add_host,
+                          aggregate['id'], self.host)
+
+    @attr(type='negative')
+    def test_aggregate_remove_host_as_user(self):
+        # Regular user is not allowed to remove a host from an aggregate.
+        aggregate_name = rand_name(self.aggregate_name_prefix)
+        resp, aggregate = self.client.create_aggregate(aggregate_name)
+        self.addCleanup(self.client.delete_aggregate, aggregate['id'])
+        self.client.add_host(aggregate['id'], self.host)
+        self.addCleanup(self.client.remove_host, aggregate['id'], self.host)
+
+        self.assertRaises(exceptions.Unauthorized,
+                          self.user_client.remove_host,
+                          aggregate['id'], self.host)
