diff --git a/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.params b/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.params
index 3ca917f..7f0e058 100644
--- a/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.params
+++ b/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.params
@@ -11,7 +11,7 @@
     # 9 - Update Virtualport northbound test
     #10 - Delete Virtualport northbound test
 
-    <testcases>1,2,3,4</testcases>
+    <testcases>1,2,3,4,5,6,7</testcases>
 
     <SLEEP>
         <startup>15</startup>
diff --git a/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.py b/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.py
index e3c3cc4..b8c592c 100644
--- a/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.py
+++ b/TestON/tests/FUNCvirNetNB/FUNCvirNetNB.py
@@ -69,7 +69,7 @@
 
         #FIXME:this is short term fix
         main.log.info( "Removing raft logs" )
-        main.ONOSbench.onosRemoveRaftlogs()
+        main.ONOSbench.onosRemoveRaftLogs()
 
         main.CLIs = []
         main.nodes = []
@@ -176,7 +176,7 @@
                      onfail="Install onos-app-vtnrsc app failed" )
 
         time.sleep( main.startUpSleep )
-        
+
         main.step( "Install onos-app-vtnweb app" )
         installResults = main.ONOScli1.featureInstall( "onos-app-vtnweb" )
         utilities.assert_equals( expect=main.TRUE, actual=installResults,
@@ -190,13 +190,15 @@
         """
         Test Post Network
         """
-        import os,sys
-        sys.path.append("..")
+        import os
+
         try:
             from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData
         except ImportError:
             main.log.exception( "Something wrong with import file or code error." )
-            main.log.info( "Import Error,please check!" )
+            main.log.info( "Import Error, please check!" )
+            main.cleanup()
+            main.exit()
 
         main.log.info( "ONOS Network Post test Start" )
         main.case( "Virtual Network NBI Test - Network" )
@@ -254,7 +256,7 @@
                 onpass="Delete Network Success",
                 onfail="Delete Network Failed")
 
-        if Cmpresult !=True:
+        if Cmpresult != True:
             main.log.error( "Post Network compare failed" )
 
     def CASE3( self,main ):
@@ -262,13 +264,15 @@
         """
         Test Update Network
         """
-        import os,sys
-        sys.path.append("..")
+        import os
+
         try:
             from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData
         except ImportError:
             main.log.exception( "Something wrong with import file or code error." )
-            main.log.info( "Import Error,please check!" )
+            main.log.info( "Import Error, please check!" )
+            main.cleanup()
+            main.exit()
 
         main.log.info( "ONOS Network Update test Start" )
         main.case( "Virtual Network NBI Test - Network" )
@@ -339,7 +343,7 @@
                 onpass="Delete Network Success",
                 onfail="Delete Network Failed" )
 
-        if Cmpresult!=True:
+        if Cmpresult != True:
             main.log.error( "Update Network compare failed" )
 
     def CASE4( self,main ):
@@ -347,13 +351,15 @@
         """
         Test Delete Network
         """
-        import os,sys
-        sys.path.append("..")
+        import os
+
         try:
             from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData
         except ImportError:
             main.log.exception( "Something wrong with import file or code error." )
-            main.log.info( "Import Error,please check!" )
+            main.log.info( "Import Error, please check!" )
+            main.cleanup()
+            main.exit()
 
         main.log.info( "ONOS Network Delete test Start" )
         main.case( "Virtual Network NBI Test - Network" )
@@ -371,9 +377,8 @@
         postdata = network.DictoJson()
 
         main.step( "Post Data via HTTP" )
-        Poststatus, result = main.ONOSrest.send( ctrlip, port , '' , path + 'networks/',
-                                                 'POST', None , postdata )
-
+        Poststatus, result = main.ONOSrest.send( ctrlip, port, '', path + 'networks/',
+                                                 'POST', None, postdata )
         utilities.assert_equals(
                 expect='200',
                 actual=Poststatus,
@@ -381,7 +386,7 @@
                 onfail="Post Failed " + str( Poststatus ) + str( result ) )
 
         main.step( "Delete Data via HTTP" )
-        Deletestatus, result = main.ONOSrest.send( ctrlip,port,network.id,path+'networks/',
+        Deletestatus, result = main.ONOSrest.send( ctrlip, port, network.id, path+'networks/',
                                                 'DELETE', None, None )
         utilities.assert_equals(
                 expect='200',
@@ -400,3 +405,274 @@
 
         if result != 'The tenantNetwork does not exists':
             main.log.error( "Delete Network failed" )
+
+    def CASE5( self, main ):
+
+        """
+        Test Post Subnet
+        """
+        import os
+
+        try:
+            from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData
+            from tests.FUNCvirNetNB.dependencies.Nbdata import SubnetData
+        except ImportError:
+            main.log.exception( "Something wrong with import file or code error." )
+            main.log.info( "Import Error, please check!" )
+            main.cleanup()
+            main.exit()
+
+        main.log.info( "ONOS Subnet Post test Start" )
+        main.case( "Virtual Network NBI Test - Subnet" )
+        main.caseExplanation = "Test Subnet Post NBI " +\
+                                "Verify Stored Data is same with Post Data"
+
+        ctrlip = os.getenv( main.params['CTRL']['ip1'] )
+        port = main.params['HTTP']['port']
+        path = main.params['HTTP']['path']
+
+        main.step( "Generate Post Data" )
+        network = NetworkData()
+        network.id = '030d6d3d-fa36-45bf-ae2b-4f4bc43a54dc'
+        network.tenant_id = '26cd996094344a0598b0a1af1d525cdc'
+        subnet = SubnetData()
+        subnet.id = "e44bd655-e22c-4aeb-b1e9-ea1606875178"
+        subnet.tenant_id = network.tenant_id
+        subnet.network_id = network.id
+
+        networkpostdata = network.DictoJson()
+        subnetpostdata = subnet.DictoJson()
+
+        main.step( "Post Network Data via HTTP(Post Subnet need post network)" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, port, '', path + 'networks/',
+                                                 'POST', None, networkpostdata )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Post Network Success",
+                onfail="Post Network Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Post Subnet Data via HTTP" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, port, '', path + 'subnets/',
+                                                 'POST', None, subnetpostdata )
+        utilities.assert_equals(
+                expect='202',
+                actual=Poststatus,
+                onpass="Post Subnet Success",
+                onfail="Post Subnet Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Get Subnet Data via HTTP" )
+        Getstatus, result = main.ONOSrest.send( ctrlip, port, subnet.id, path + 'subnets/',
+                                                 'GET', None, None )
+        utilities.assert_equals(
+                expect='200',
+                actual=Getstatus,
+                onpass="Get Subnet Success",
+                onfail="Get Subnet Failed " + str( Getstatus ) + "," + str( result ) )
+
+        IDcmpresult = subnet.JsonCompare( subnetpostdata, result, 'subnet', 'id' )
+        TanantIDcmpresult = subnet.JsonCompare( subnetpostdata, result, 'subnet', 'tenant_id' )
+        NetoworkIDcmpresult = subnet.JsonCompare( subnetpostdata, result, 'subnet', 'network_id' )
+
+        main.step( "Compare Post Subnet Data via HTTP" )
+        Cmpresult = IDcmpresult and TanantIDcmpresult and NetoworkIDcmpresult
+        utilities.assert_equals(
+                expect=True,
+                actual=Cmpresult,
+                onpass="Compare Success",
+                onfail="Compare Failed:ID compare:" + str( IDcmpresult ) + \
+                       ",Tenant id compare:"+ str( TanantIDcmpresult ) + \
+                       ",Network id compare:" + str( NetoworkIDcmpresult ) )
+
+        deletestatus,result = main.ONOSrest.send( ctrlip, port, network.id, path+'networks/',
+                                                 'DELETE', None, None )
+        utilities.assert_equals(
+                expect='200',
+                actual=deletestatus,
+                onpass="Delete Network Success",
+                onfail="Delete Network Failed" )
+
+        if Cmpresult != True:
+            main.log.error( "Post Subnet compare failed" )
+
+    def CASE6( self, main ):
+
+        """
+        Test Post Subnet
+        """
+        import os
+
+        try:
+            from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData
+            from tests.FUNCvirNetNB.dependencies.Nbdata import SubnetData
+        except ImportError:
+            main.log.exception( "Something wrong with import file or code error." )
+            main.log.info( "Import Error, please check!" )
+            main.cleanup()
+            main.exit()
+
+        main.log.info( "ONOS Subnet Update test Start" )
+        main.case( "Virtual Network NBI Test - Subnet" )
+        main.caseExplanation = "Test Subnet Update NBI " +\
+                                "Verify Stored Data is same with Update Data"
+
+        ctrlip = os.getenv( main.params['CTRL']['ip1'] )
+        port = main.params['HTTP']['port']
+        path = main.params['HTTP']['path']
+
+        main.step( "Generate Post Data" )
+        network = NetworkData()
+        network.id = '030d6d3d-fa36-45bf-ae2b-4f4bc43a54dc'
+        network.tenant_id = '26cd996094344a0598b0a1af1d525cdc'
+        subnet = SubnetData()
+        subnet.id = "e44bd655-e22c-4aeb-b1e9-ea1606875178"
+        subnet.tenant_id = network.tenant_id
+        subnet.network_id = network.id
+        subnet.start = "192.168.2.1"
+        subnet.end = "192.168.2.255"
+        networkpostdata = network.DictoJson()
+        subnetpostdata = subnet.DictoJson()
+
+        #Change allocation_poolsdata scope
+        subnet.start = "192.168.102.1"
+        subnet.end = "192.168.102.255"
+        #end change
+        newsubnetpostdata = subnet.DictoJson()
+
+        main.step( "Post Network Data via HTTP(Post Subnet need post network)" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, port, '', path + 'networks/',
+                                                 'POST', None, networkpostdata )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Post Network Success",
+                onfail="Post Network Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Post Subnet Data via HTTP" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, port, '', path + 'subnets/',
+                                                 'POST', None, subnetpostdata )
+        utilities.assert_equals(
+                expect='202',
+                actual=Poststatus,
+                onpass="Post Subnet Success",
+                onfail="Post Subnet Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Update Subnet Data via HTTP" )
+        Putstatus, result = main.ONOSrest.send( ctrlip, port, subnet.id, path + 'subnets/',
+                                                 'PUT', None, newsubnetpostdata )
+        utilities.assert_equals(
+                expect='203',
+                actual=Putstatus,
+                onpass="Update Subnet Success",
+                onfail="Update Subnet Failed " + str( Putstatus ) + "," + str( result ) )
+
+        main.step( "Get Subnet Data via HTTP" )
+        Getstatus, result = main.ONOSrest.send( ctrlip, port, subnet.id, path + 'subnets/',
+                                                 'GET', None, None )
+        utilities.assert_equals(
+                expect='200',
+                actual=Getstatus,
+                onpass="Get Subnet Success",
+                onfail="Get Subnet Failed " + str( Getstatus ) + "," + str( result ) )
+
+        IDcmpresult = subnet.JsonCompare( newsubnetpostdata, result, 'subnet', 'id' )
+        TanantIDcmpresult = subnet.JsonCompare( newsubnetpostdata, result, 'subnet', 'tenant_id' )
+        Poolcmpresult = subnet.JsonCompare( newsubnetpostdata, result, 'subnet', 'allocation_pools' )
+
+        main.step( "Compare Subnet Data" )
+        Cmpresult = IDcmpresult and TanantIDcmpresult and Poolcmpresult
+        utilities.assert_equals(
+                expect=True,
+                actual=Cmpresult,
+                onpass="Compare Success",
+                onfail="Compare Failed:ID compare:" + str( IDcmpresult ) + \
+                       ",Tenant id compare:"+ str( TanantIDcmpresult ) + \
+                       ",Pool compare:" + str( Poolcmpresult ) )
+
+        main.step( "Delete Subnet via HTTP" )
+        deletestatus,result = main.ONOSrest.send( ctrlip, port, network.id, path+'networks/',
+                                                 'DELETE', None, None )
+        utilities.assert_equals(
+                expect='200',
+                actual=deletestatus,
+                onpass="Delete Network Success",
+                onfail="Delete Network Failed" )
+
+        if Cmpresult != True:
+            main.log.error( "Update Subnet compare failed" )
+
+    def CASE7( self, main ):
+
+        """
+        Test Delete Subnet
+        """
+        import os
+
+        try:
+            from tests.FUNCvirNetNB.dependencies.Nbdata import NetworkData
+            from tests.FUNCvirNetNB.dependencies.Nbdata import SubnetData
+        except ImportError:
+            main.log.exception( "Something wrong with import file or code error." )
+            main.log.info( "Import Error, please check!" )
+            main.cleanup()
+            main.exit()
+
+        main.log.info( "ONOS Subnet Delete test Start" )
+        main.case( "Virtual Network NBI Test - Subnet" )
+        main.caseExplanation = "Test Subnet Delete NBI " +\
+                                "Verify Stored Data is Null after Delete"
+
+        ctrlip = os.getenv( main.params['CTRL']['ip1'] )
+        port = main.params['HTTP']['port']
+        path = main.params['HTTP']['path']
+
+        main.step( "Generate Post Data" )
+        network = NetworkData()
+        network.id = '030d6d3d-fa36-45bf-ae2b-4f4bc43a54dc'
+        network.tenant_id = '26cd996094344a0598b0a1af1d525cdc'
+        subnet = SubnetData()
+        subnet.id = "e44bd655-e22c-4aeb-b1e9-ea1606875178"
+        subnet.tenant_id = network.tenant_id
+        subnet.network_id = network.id
+
+        networkpostdata = network.DictoJson()
+        subnetpostdata = subnet.DictoJson()
+
+        main.step( "Post Network Data via HTTP(Post Subnet need post network)" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, port, '', path + 'networks/',
+                                                 'POST', None, networkpostdata )
+        utilities.assert_equals(
+                expect='200',
+                actual=Poststatus,
+                onpass="Post Network Success",
+                onfail="Post Network Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Post Subnet Data via HTTP" )
+        Poststatus, result = main.ONOSrest.send( ctrlip, port, '', path + 'subnets/',
+                                                 'POST', None, subnetpostdata )
+        utilities.assert_equals(
+                expect='202',
+                actual=Poststatus,
+                onpass="Post Subnet Success",
+                onfail="Post Subnet Failed " + str( Poststatus ) + "," + str( result ) )
+
+        main.step( "Delete Subnet Data via HTTP" )
+        Deletestatus, result = main.ONOSrest.send( ctrlip, port, subnet.id, path + 'subnets/',
+                                                 'DELETE', None, None )
+        utilities.assert_equals(
+                expect='201',
+                actual=Deletestatus,
+                onpass="Delete Subnet Success",
+                onfail="Delete Subnet Failed " + str( Deletestatus ) + "," + str( result ) )
+
+        main.step( "Get Subnet Data is NULL" )
+        Getstatus, result = main.ONOSrest.send( ctrlip, port, subnet.id, path + 'subnets/',
+                                                 'GET', None, None )
+        utilities.assert_equals(
+                expect='the subnet does not exists',
+                actual=result,
+                onpass="Get Subnet Success",
+                onfail="Get Subnet Failed " + str( Getstatus ) + str( result ) )
+
+        if result != 'the subnet does not exists':
+            main.log.error( "Delete Subnet failed" )
\ No newline at end of file
diff --git a/TestON/tests/FUNCvirNetNB/dependencies/Nbdata.py b/TestON/tests/FUNCvirNetNB/dependencies/Nbdata.py
index c002c4a..dadf6b2 100644
--- a/TestON/tests/FUNCvirNetNB/dependencies/Nbdata.py
+++ b/TestON/tests/FUNCvirNetNB/dependencies/Nbdata.py
@@ -67,12 +67,17 @@
             print "SourceData or DestData is not JSON Type!"
             return False
 
-        Socom = SourceCompareDataDic[FirstPara][SecondPara]
-        Decom = DestiCompareDataDic[FirstPara][SecondPara]
-        if Socom == Decom:
+        try:
+            Socom = SourceCompareDataDic[FirstPara][SecondPara]
+            Decom = DestiCompareDataDic[FirstPara][SecondPara]
+        except KeyError,error:
+            print "Key error ,This key is not found:%s"%error
+            return False            
+
+        if str(Socom).lower()== str(Decom).lower():
             return True
         else:
-            print "Source Compare data:"+FirstPara+"."+SecondPara+"="+Socom
+            print "Source Compare data:"+FirstPara+"."+SecondPara+"="+str(Socom)
             print "Dest Compare data: "+FirstPara+"."+SecondPara+"="+str(Decom)
             return False
 
@@ -139,12 +144,6 @@
 
         return json.dumps(Dicdata,indent=4)
 
-    def Ordered(self,obj):
-        super(NetworkData,self).Ordered(obj)
-
-    def JsonCompare(self,SourceData,DestiData,FirstPara,SecondPara):
-        super(NetworkData,self).JsonCompare(SourceData,DestiData,FirstPara,SecondPara)
-
 class VirtualPortData(NetworkData):
 
     def __init__(self):
@@ -212,10 +211,4 @@
 
             Dicdata = {'virtualport': Dicdata}
 
-            return json.dumps(Dicdata,indent=4)
-
-    def Ordered(self,obj):
-        super(NetworkData,self).Ordered(obj)
-
-    def JsonCompare(self,SourceData,DestiData,FirstPara,SecondPara):
-        super(NetworkData,self).JsonCompare(SourceData,DestiData,FirstPara,SecondPara)
\ No newline at end of file
+            return json.dumps(Dicdata,indent=4)
\ No newline at end of file
