add test case 2 for I2 deployment

Change-Id: Ic2dbb0566a0cfdc2c0efb276a17a34a880f2bfcf
diff --git a/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.params b/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.params
index b35ef65..2bb87a0 100644
--- a/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.params
+++ b/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.params
@@ -1,6 +1,6 @@
 <PARAMS>
 
-    <testcases>100, 3</testcases>
+    <testcases>100, 2</testcases>
 
     #Environment variables
     <ENV>
@@ -24,6 +24,10 @@
         <nextHop>nextHop</nextHop>
     </JSON>
 
+    <config>
+        <peerNum> 3 </peerNum>
+    </config>
+
     <timers>
         <SdnIpSetup>10</SdnIpSetup>
         <PingTestWithRoutes>20</PingTestWithRoutes>
diff --git a/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.py b/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.py
index ab7e002..5db602a 100644
--- a/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.py
+++ b/TestON/tests/USECASE_SdnipI2/USECASE_SdnipI2.py
@@ -85,25 +85,6 @@
             main.cleanup()
             main.exit()
 
-    def CASE1( self, main ):
-        '''
-        ping test from 3 bgp peers to BGP speaker
-        '''
-        main.case( "This case is to check ping between BGP peers and speakers" )
-
-    def CASE2( self, main ):
-        '''
-        point-to-point intents test for each BGP peer and BGP speaker pair
-        '''
-        main.case( "This case is to check point-to-point intents" )
-
-
-    def CASE3( self, main ):
-        '''
-        routes and intents check to all BGP peers
-        '''
-        main.case( "This case is to check routes and intents to all BGP peers" )
-
         main.step( "Get links in the network" )
         listResult = main.ONOScli.links( jsonFormat = False )
         main.log.info( listResult )
@@ -118,6 +99,42 @@
         time.sleep( int( main.params[ 'timers' ][ 'PathAvailable' ] ) )
 
 
+    def CASE1( self, main ):
+        '''
+        ping test from 3 bgp peers to BGP speaker
+        '''
+        main.case( "This case is to check ping between BGP peers and speakers" )
+
+    def CASE2( self, main ):
+        '''
+        point-to-point intents test for each BGP peer and BGP speaker pair
+        '''
+        main.case( "This case is to check point-to-point intents" )
+        main.log.info( "There are %s BGP peers in total "
+                       % main.params[ 'config' ][ 'peerNum' ] )
+        main.step( "Get point-to-point intents from ONOS CLI" )
+
+        getIntentsResult = main.ONOScli.intents( jsonFormat = True )
+        bgpIntentsActualNum = \
+            main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
+        bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * 6
+        main.log.info( "bgpIntentsExpected num is:" )
+        main.log.info( bgpIntentsExpectedNum )
+        main.log.info( "bgpIntentsActual num is:" )
+        main.log.info( bgpIntentsActualNum )
+        utilities.assertEquals( \
+            expect = True,
+            actual = eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
+            onpass = "***PointToPointIntent Intent Num in SDN-IP are correct!***",
+            onfail = "***PointToPointIntent Intent Num in SDN-IP are wrong!***" )
+
+
+    def CASE3( self, main ):
+        '''
+        routes and intents check to all BGP peers
+        '''
+        main.case( "This case is to check routes and intents to all BGP peers" )
+
         allRoutesExpected = []
         allRoutesExpected.append( "4.0.0.0/24" + "/" + "10.0.4.1" )
         allRoutesExpected.append( "5.0.0.0/24" + "/" + "10.0.5.1" )