diff --git a/bindep.txt b/bindep.txt
index a2cc02e..b0c4c3b 100644
--- a/bindep.txt
+++ b/bindep.txt
@@ -1 +1,2 @@
 libjpeg-dev [test]
+zookeeperd [platform:dpkg]
diff --git a/requirements.txt b/requirements.txt
index ec0b76a..4c5adc7 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -16,3 +16,4 @@
 babel>=1.0
 six>=1.6.0
 ansible>=2.0.0.1
+kazoo
diff --git a/tests/base.py b/tests/base.py
index 603fba3..9845484 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 
 # Copyright 2012 Hewlett-Packard Development Company, L.P.
+# Copyright 2016 Red Hat, Inc.
 #
 # 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
@@ -39,6 +40,7 @@
 import git
 import gear
 import fixtures
+import kazoo.client
 import statsd
 import testtools
 from git.exc import NoSuchPathError
@@ -869,6 +871,57 @@
         return endpoint, ''
 
 
+class ChrootedKazooFixture(fixtures.Fixture):
+    def __init__(self):
+        super(ChrootedKazooFixture, self).__init__()
+
+        zk_host = os.environ.get('NODEPOOL_ZK_HOST', 'localhost')
+        if ':' in zk_host:
+            host, port = zk_host.split(':')
+        else:
+            host = zk_host
+            port = None
+
+        self.zookeeper_host = host
+
+        if not port:
+            self.zookeeper_port = 2181
+        else:
+            self.zookeeper_port = int(port)
+
+    def _setUp(self):
+        # Make sure the test chroot paths do not conflict
+        random_bits = ''.join(random.choice(string.ascii_lowercase +
+                                            string.ascii_uppercase)
+                              for x in range(8))
+
+        rand_test_path = '%s_%s' % (random_bits, os.getpid())
+        self.zookeeper_chroot = "/nodepool_test/%s" % rand_test_path
+
+        # Ensure the chroot path exists and clean up any pre-existing znodes.
+        _tmp_client = kazoo.client.KazooClient(
+            hosts='%s:%s' % (self.zookeeper_host, self.zookeeper_port))
+        _tmp_client.start()
+
+        if _tmp_client.exists(self.zookeeper_chroot):
+            _tmp_client.delete(self.zookeeper_chroot, recursive=True)
+
+        _tmp_client.ensure_path(self.zookeeper_chroot)
+        _tmp_client.stop()
+        _tmp_client.close()
+
+        self.addCleanup(self._cleanup)
+
+    def _cleanup(self):
+        '''Remove the chroot path.'''
+        # Need a non-chroot'ed client to remove the chroot path
+        _tmp_client = kazoo.client.KazooClient(
+            hosts='%s:%s' % (self.zookeeper_host, self.zookeeper_port))
+        _tmp_client.start()
+        _tmp_client.delete(self.zookeeper_chroot, recursive=True)
+        _tmp_client.stop()
+
+
 class BaseTestCase(testtools.TestCase):
     log = logging.getLogger("zuul.test")
 
@@ -989,6 +1042,9 @@
 
     def setUp(self):
         super(ZuulTestCase, self).setUp()
+
+        self.setupZK()
+
         if USE_TEMPDIR:
             tmp_root = self.useFixture(fixtures.TempDir(
                 rootdir=os.environ.get("ZUUL_TEST_ROOT"))
@@ -1186,6 +1242,12 @@
                     self.copyDirToRepo(project,
                                        os.path.join(git_path, reponame))
 
+    def setupZK(self):
+        self.zk_chroot_fixture = self.useFixture(ChrootedKazooFixture())
+        self.zookeeper_host = self.zk_chroot_fixture.zookeeper_host
+        self.zookeeper_port = self.zk_chroot_fixture.zookeeper_port
+        self.zookeeper_chroot = self.zk_chroot_fixture.zookeeper_chroot
+
     def copyDirToRepo(self, project, source_path):
         self.init_repo(project)
 
