diff --git a/src/test/utils/CordContainer.py b/src/test/utils/CordContainer.py
index 88823ff..2ab077b 100644
--- a/src/test/utils/CordContainer.py
+++ b/src/test/utils/CordContainer.py
@@ -279,6 +279,21 @@
         build_cmd = 'cd {} && docker-compose build'.format(self.onos_cord_dir)
         os.system(build_cmd)
 
+class OnosCordStopWrapper(Container):
+    onos_cord_dir = os.path.join(os.getenv('HOME'), 'cord-tester-cord')
+    docker_yaml = os.path.join(onos_cord_dir, 'docker-compose.yml')
+
+    def __init__(self):
+        if os.access(self.docker_yaml, os.F_OK):
+            with open(self.docker_yaml, 'r') as f:
+                yaml_config = yaml.load(f)
+                image = yaml_config['services'].keys()[0]
+                name = 'cordtestercord_{}_1'.format(image)
+            super(OnosCordStopWrapper, self).__init__(name, image, tag = '')
+            if self.exists():
+                print('Killing container %s' %self.name)
+                self.kill()
+
 class Onos(Container):
 
     quagga_config = ( { 'bridge' : 'quagga-br', 'ip': '10.10.0.4', 'mask' : 16 }, )
@@ -337,7 +352,7 @@
                     os.unlink(f)
                 except: pass
 
-    def __init__(self, name = NAME, image = 'onosproject/onos', prefix = '', tag = 'latest',
+    def __init__(self, name = NAME, image = IMAGE, prefix = PREFIX, tag = TAG,
                  boot_delay = 60, restart = False, network_cfg = None, cluster = False):
         if restart is True:
             ##Find the right image to restart
@@ -525,6 +540,19 @@
             print('ONOS app %s, version %s %s' %(app, version, 'installed' if ok else 'failed to install'))
             time.sleep(2)
 
+class OnosStopWrapper(Container):
+    def __init__(self, name):
+        super(OnosStopWrapper, self).__init__(name, Onos.IMAGE, tag = Onos.TAG, prefix = Container.IMAGE_PREFIX)
+        if self.exists():
+            self.kill()
+        else:
+            if Onos.cluster_mode is True:
+                valid_node = filter(lambda onos: name in [ onos.ipaddr, onos.name ], Onos.cluster_instances)
+                if valid_node:
+                    onos = valid_node.pop()
+                    if onos.exists():
+                        onos.kill()
+
 class Radius(Container):
     ports = [ 1812, 1813 ]
     env = {'TIMEZONE':'America/Los_Angeles',
@@ -631,6 +659,13 @@
         super(Quagga, cls).build_image(dockerfile, image)
         print('Done building image %s' %image)
 
+class QuaggaStopWrapper(Container):
+    def __init__(self, name = Quagga.NAME, image = Quagga.IMAGE, tag = 'candidate'):
+        super(QuaggaStopWrapper, self).__init__(name, image, prefix = Container.IMAGE_PREFIX, tag = tag)
+        if self.exists():
+            self.kill()
+
+
 def reinitContainerClients():
     docker_netns.dckr = Client()
     Container.dckr = Client()
@@ -784,7 +819,6 @@
     def build_image(cls, image = IMAGE):
         Xos.build_image(image, cls.dockerfile_path)
 
-
 class XosSyncVtn(Xos):
     ports = [8080,]
     env = None
@@ -870,4 +904,3 @@
     @classmethod
     def build_image(cls, image = IMAGE):
         Xos.build_image(image, cls.dockerfile_path)
-
diff --git a/src/test/utils/CordTestServer.py b/src/test/utils/CordTestServer.py
index e236008..cf280f6 100644
--- a/src/test/utils/CordTestServer.py
+++ b/src/test/utils/CordTestServer.py
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-from CordContainer import Container, Onos, OnosCord, Quagga, Radius, reinitContainerClients
+from CordContainer import Container, Onos, OnosStopWrapper, OnosCord, OnosCordStopWrapper, Quagga, QuaggaStopWrapper, Radius, reinitContainerClients
 from nose.tools import nottest
 from SimpleXMLRPCServer import SimpleXMLRPCServer
 import daemon
@@ -30,12 +30,6 @@
 CORD_TEST_HOST = '172.17.0.1'
 CORD_TEST_PORT = 25000
 
-class QuaggaStopWrapper(Container):
-    def __init__(self, name = Quagga.NAME, image = Quagga.IMAGE, tag = 'candidate'):
-        super(QuaggaStopWrapper, self).__init__(name, image, prefix = Container.IMAGE_PREFIX, tag = tag)
-        if self.exists():
-            self.kill()
-
 class CordTestServer(object):
 
     onos_cord = None
@@ -60,6 +54,15 @@
     def restart_onos(self, kwargs):
         return self.__restart_onos(**kwargs)
 
+    def __shutdown_onos(self, node = None):
+        if node is None:
+            node = Onos.NAME
+        OnosStopWrapper(node)
+        return 'DONE'
+
+    def shutdown_onos(self, kwargs):
+        return self.__shutdown_onos(**kwargs)
+
     def __restart_quagga(self, config = None, boot_delay = 30 ):
         config_file = Quagga.quagga_config_file
         if config is not None:
@@ -161,6 +164,17 @@
     return False
 
 @nottest
+def __cord_test_onos_shutdown(**kwargs):
+    return rpc_server_instance().shutdown_onos(kwargs)
+
+@nottest
+def cord_test_onos_shutdown(node = None):
+    data = __cord_test_onos_shutdown(node = node)
+    if data == 'DONE':
+        return True
+    return False
+
+@nottest
 def __cord_test_quagga_restart(**kwargs):
     return rpc_server_instance().restart_quagga(kwargs)
 
