Merge "[ONOS-7475] Refactoring SR tests"
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
index 54728ce..0e4de46 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
@@ -1,5 +1,5 @@
 <PARAMS>
-    <testcases>1,2</testcases>
+    <testcases>1,2,3</testcases>
 
     <GRAPH>
         <nodeCluster>VM</nodeCluster>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py
index c24ca81..d5a928c 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.py
@@ -11,13 +11,13 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import SRRoutingTest
 
         SRRoutingTest.runTest( main,
-                                test_idx = 1,
-                                onosNodes = 3,
-                                dhcp=1,
-                                routers=0,
-                                ipv4=1,
-                                ipv6=0,
-                                description = "Ping between all ipv4 hosts in the topology")
+                               test_idx=1,
+                               onosNodes=3,
+                               dhcp=1,
+                               routers=0,
+                               ipv4=1,
+                               ipv6=0,
+                               description="Ping between all ipv4 hosts in the topology")
 
     def CASE2( self, main ):
         """
@@ -27,12 +27,26 @@
         from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import SRRoutingTest
 
         SRRoutingTest.runTest( main,
-                                test_idx = 2,
-                                onosNodes = 3,
-                                dhcp=1,
-                                routers=0,
-                                ipv4=0,
-                                ipv6=1,
-                                description = "Ping between all ipv6 hosts in the topology")
+                               test_idx=2,
+                               onosNodes=3,
+                               dhcp=1,
+                               routers=0,
+                               ipv4=0,
+                               ipv6=1,
+                               description="Ping between all ipv6 hosts in the topology")
 
+    def CASE3( self, main ):
+        """
+        Ping between all ipv4 and ipv6 hosts in the topology.
+        """
 
+        from tests.USECASE.SegmentRouting.SRRouting.dependencies.SRRoutingTest import SRRoutingTest
+
+        SRRoutingTest.runTest( main,
+                               test_idx=3,
+                               onosNodes=3,
+                               dhcp=1,
+                               routers=0,
+                               ipv4=1,
+                               ipv6=1,
+                               description="Ping between all ipv4 and ipv6 hosts in the topology")
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=0.json b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=0.json
index 70f1894..8264f29 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=0.json
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=0.json
@@ -120,7 +120,7 @@
                 }
             ]
        } ,
-        "of:0000000000000102/10" : {
+        "of:0000000000000005/9" : {
             "interfaces" : [
                 {
                     "ips" : [ "2000::3ff/120" ],
@@ -306,7 +306,7 @@
         "org.onosproject.dhcprelay" : {
             "default": [
                 {
-                    "dhcpServerConnectPoint": "of:0000000000000102/10",
+                    "dhcpServerConnectPoint": "of:0000000000000005/9",
                     "serverIps": ["2000::3fd"]
                 }
             ]
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=1.json b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=1.json
index e5f1856..293829e 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=1.json
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=0_ipv6=1_dhcp=1_routers=1.json
@@ -119,14 +119,6 @@
                     "vlan-tagged": [40]
                 }
             ]
-       } ,
-        "of:0000000000000102/10" : {
-            "interfaces" : [
-                {
-                    "ips" : [ "2000::3ff/120" ],
-                    "vlan-untagged": 15
-                }
-            ]
         },
         "of:0000000000000004/9" : {
             "interfaces" : [
@@ -178,6 +170,14 @@
 	               "vlan-untagged": 160
                 }
             ]
+        },
+        "of:0000000000000005/12" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "2000::3ff/120" ],
+                    "vlan-untagged": 15
+                }
+            ]
         }
     },
     "hosts" : { 
@@ -357,7 +357,7 @@
         "org.onosproject.dhcprelay" : {
             "default": [
                 {
-                    "dhcpServerConnectPoint": "of:0000000000000102/10",
+                    "dhcpServerConnectPoint": "of:0000000000000005/12",
                     "serverIps": ["2000::3fd"]
                 }
             ]
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=0.json b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=0.json
index 968884f..66e5103 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=0.json
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=0.json
@@ -120,7 +120,7 @@
                 }
             ]
        } ,
-        "of:0000000000000102/10" : {
+        "of:0000000000000005/9" : {
             "interfaces" : [
                 {
                     "ips" : [ "10.0.3.254/24" ],
@@ -248,7 +248,7 @@
        "org.onosproject.dhcprelay" : {
             "default": [
                 {
-                    "dhcpServerConnectPoint": "of:0000000000000102/10",
+                    "dhcpServerConnectPoint": "of:0000000000000005/9",
                     "serverIps": ["10.0.3.253"]
                 }
             ]
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=1.json b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=1.json
index e06e3ab..59284ba 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=1.json
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=0_dhcp=1_routers=1.json
@@ -119,14 +119,6 @@
                     "vlan-tagged": [40]
                 }
             ]
-       } ,
-        "of:0000000000000102/10" : {
-            "interfaces" : [
-                {
-                    "ips" : [ "10.0.3.254/24" ],
-                    "vlan-untagged": 15
-                }
-            ]
         },
         "of:0000000000000004/9" : {
             "interfaces" : [
@@ -178,6 +170,14 @@
 	               "vlan-untagged": 160
                 }
             ]
+        },
+        "of:0000000000000005/12" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.0.3.254/24" ],
+                    "vlan-untagged": 15
+                }
+            ]
         }
     },
     "devices" : {
@@ -299,7 +299,7 @@
        "org.onosproject.dhcprelay" : {
             "default": [
                 {
-                    "dhcpServerConnectPoint": "of:0000000000000102/10",
+                    "dhcpServerConnectPoint": "of:0000000000000005/12",
                     "serverIps": ["10.0.3.253"]
                 }
             ]
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=1_dhcp=1_routers=0.chart b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=1_dhcp=1_routers=0.chart
new file mode 100644
index 0000000..cf98771
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=1_dhcp=1_routers=0.chart
@@ -0,0 +1,6 @@
+{
+  "ipv6": {"expect": "True", 
+	   "hosts": ["h1v6", "h2v6" ,"h3v6", "h4v6", "h5v6", "h6v6", "h7v6", "h8v6", "h9v6", "h10v6", "h11v6"]},
+  "ipv4": {"expect": "True",
+           "hosts": ["h1v4", "h2v4" ,"h3v4", "h4v4", "h5v4", "h6v4", "h7v4", "h8v4", "h9v4", "h10v4", "h11v4"]}
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=1_dhcp=1_routers=0.json b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=1_dhcp=1_routers=0.json
new file mode 100644
index 0000000..4566a0a
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/json/COMCAST_CONFIG_ipv4=1_ipv6=1_dhcp=1_routers=0.json
@@ -0,0 +1,435 @@
+{
+    "ports" : {
+        "of:0000000000000001/3" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1000::3ff/120" ],
+                    "vlan-untagged": 10
+                }
+            ]
+        },
+        "of:0000000000000001/4" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1001::3ff/120" ],
+                    "vlan-untagged": 10
+                }
+            ]
+        },
+        "of:0000000000000001/5" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.1.0.254/24" ],
+                    "vlan-untagged": 10
+                }
+            ]
+        },
+        "of:0000000000000001/6" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.1.10.254/24" ],
+                    "vlan-untagged": 10
+                }
+            ]
+        },
+        "of:0000000000000002/6" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1002::3ff/120" ],
+                    "vlan-untagged": 10
+                }
+            ]
+        },
+        "of:0000000000000002/7" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1003::3ff/120" ],
+                    "vlan-untagged": 15
+                }
+            ]
+        },
+        "of:0000000000000002/8" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1004::3ff/120" ],
+                    "vlan-tagged": [30]
+                }
+            ]
+        },
+        "of:0000000000000002/9" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.2.0.254/24" ],
+                    "vlan-untagged": 10
+                }
+            ]
+        },
+        "of:0000000000000002/10" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.2.30.254/24" ],
+                    "vlan-untagged": 16
+                }
+            ]
+        },
+        "of:0000000000000002/11" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.2.20.254/24" ],
+                    "vlan-tagged": [30]
+                }
+            ]
+        },
+        "of:0000000000000003/6" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1003::3ff/120" ],
+                    "vlan-untagged": 15
+                }
+            ]
+        },
+        "of:0000000000000003/7" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1004::3ff/120" ],
+                    "vlan-tagged": [30]
+                }
+            ]
+        }, 
+        "of:0000000000000003/8" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1005::3ff/120" ],
+                    "vlan-tagged": [20]
+                }
+            ]
+        },
+	"of:0000000000000003/9" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1006::3ff/120" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000003/10" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.2.30.254/24" ],
+                    "vlan-untagged": 15
+                }
+            ]
+        },
+        "of:0000000000000003/11" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.2.20.254/24" ],
+                    "vlan-tagged": [30]
+                }
+            ]
+        }, 
+        "of:0000000000000003/12" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.2.10.254/24" ],
+                    "vlan-tagged": [20]
+                }
+            ]
+        },
+	"of:0000000000000003/13" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.2.40.254/24" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000004/6" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1007::3ff/120" ],
+                    "vlan-tagged": [30]
+                }
+            ]
+        },
+        "of:0000000000000004/7" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1008::3ff/120" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000004/8" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1009::3ff/120" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000004/9" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.3.0.254/24" ],
+                    "vlan-tagged": [30]
+                }
+            ]
+        },
+        "of:0000000000000004/10" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.3.10.254/24" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000004/11" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.3.30.254/24" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000005/6" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1008::3ff/120" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000005/7" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1009::3ff/120" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000005/8" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "1010::3ff/120" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000005/9" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.3.10.254/24" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000005/10" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.3.30.254/24" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000005/11" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.3.20.254/24" ],
+                    "vlan-tagged": [40]
+                }
+            ]
+        },
+        "of:0000000000000005/12" : {
+            "interfaces" : [
+                {
+                    "ips" : [ "10.0.3.254/24", "2000::3ff/120" ],
+                    "vlan-untagged": 15
+                }
+            ]
+        }
+    },
+    "hosts" : { 
+	"00:bb:00:00:00:04/30" : {
+		"basic": {
+			"locations": ["of:0000000000000003/7","of:0000000000000002/8"],
+			"ips": ["1004::3fe"]
+		     }
+	    },
+	"00:bb:00:00:00:05/20" : {
+		"basic": {
+			"locations": ["of:0000000000000003/8"],
+			"ips": ["1005::3fe"]
+		     }
+	    },
+	"00:bb:00:00:01:05/40" : {
+		"basic": {
+			"locations": ["of:0000000000000003/9"],
+			"ips": ["1006::3fe"]
+		     }
+	    },
+	"00:bb:00:00:00:06/30" : {
+		"basic": {
+			"locations": ["of:0000000000000004/6"],
+			"ips": ["1007::3fe"]
+		     }
+	    },
+	"00:bb:00:00:00:07/40" : {
+		"basic": {
+			"locations": ["of:0000000000000005/6", "of:0000000000000004/7"],
+			"ips": ["1008::3fe"]
+		     }
+	    },
+	"00:bb:00:00:00:08/40" : {
+		"basic": {
+			"locations": ["of:0000000000000004/8","of:0000000000000005/7"],
+			"ips": ["1009::3fe"]
+		     }
+	    },
+	"00:bb:00:00:00:0A/40" : {
+		"basic": {
+			"locations": ["of:0000000000000005/8"],
+			"ips": ["1010::3fe"]
+		     }
+	    }
+    },
+    "devices" : {
+        "of:0000000000000001" : {
+            "segmentrouting" : {
+                "name" : "s001",
+                "ipv4NodeSid" : 1,
+		"ipv6NodeSid" : 101,
+		"ipv6Loopback" : "2000::c0a8:0001",
+                "ipv4Loopback" : "192.168.0.1",
+                "routerMac" : "00:00:00:00:00:01",
+                "isEdgeRouter" : true,
+                "adjacencySids" : []
+            },
+            "basic" : {
+                "driver" : "ofdpa-ovs",
+		"latitude":34,	
+		"longitude":-105
+            }
+        },
+        "of:0000000000000002" : {
+            "segmentrouting" : {
+                "name" : "s002",
+                "ipv4NodeSid" : 2,
+                "ipv4Loopback" : "192.168.0.2",
+		"ipv6NodeSid" : 102,
+		"ipv6Loopback" : "2000::c0a8:0002",
+                "routerMac" : "00:00:00:00:00:02",
+                "isEdgeRouter" : true,
+                "pairLocalPort" : 5,
+                "pairDeviceId": "of:0000000000000003",
+                "adjacencySids" : []
+            },
+            "basic" : {
+                "driver" : "ofdpa-ovs",
+		"latitude":34,	
+		"longitude":-95
+            }
+        },
+        "of:0000000000000003" : {
+            "segmentrouting" : {
+                "name" : "s003",
+                "ipv4NodeSid" : 3,
+                "ipv4Loopback" : "192.168.0.3",
+        	"ipv6NodeSid" : 103,
+		"ipv6Loopback" : "2000::c0a8:0003",
+                "routerMac" : "00:00:00:00:00:02",
+                "isEdgeRouter" : true,
+                "pairLocalPort" : 5,
+                "pairDeviceId": "of:0000000000000002",
+                "adjacencySids" : []
+            },
+            "basic" : {
+                "driver" : "ofdpa-ovs",
+		"latitude":34,	
+		"longitude":-90
+            }
+        },
+        "of:0000000000000004" : {
+            "segmentrouting" : {
+                "name" : "s004",
+                "ipv4NodeSid" : 4,
+                "ipv4Loopback" : "192.168.0.4",
+		"ipv6NodeSid" : 104,
+		"ipv6Loopback" : "2000::c0a8:0004",        
+                "routerMac" : "00:00:00:00:00:04",
+                "isEdgeRouter" : true,
+                "pairLocalPort" : 5,
+                "pairDeviceId": "of:0000000000000005",
+                "adjacencySids" : []
+            },
+            "basic" : {
+                "driver" : "ofdpa-ovs",
+		"latitude":34,	
+		"longitude":-85
+            }
+        },
+        "of:0000000000000005" : {
+            "segmentrouting" : {
+                "name" : "s005",
+                "ipv4NodeSid" : 5,
+                "ipv4Loopback" : "192.168.0.5",
+		"ipv6NodeSid" : 105,
+		"ipv6Loopback" : "2000::c0a8:0005", 
+                "routerMac" : "00:00:00:00:00:04",
+                "isEdgeRouter" : true,
+                "pairLocalPort" : 5,
+                "pairDeviceId": "of:0000000000000004",
+                "adjacencySids" : []
+            },
+            "basic" : {
+                "driver" : "ofdpa-ovs",
+		"latitude":34,	
+		"longitude":-80
+            }
+        },
+        "of:0000000000000101" : {
+            "segmentrouting" : {
+                "name" : "s101",
+                "ipv4NodeSid" : 101,
+                "ipv4Loopback" : "192.168.0.101",
+		"ipv6NodeSid" : 201,
+		"ipv6Loopback" : "2000::c0a8:0101", 
+                "routerMac" : "00:00:00:00:01:01",
+                "isEdgeRouter" : false,
+                "adjacencySids" : []
+            },
+            "basic" : {
+                "driver" : "ofdpa-ovs",
+		"latitude":42,
+                "longitude":-100
+            }
+        },
+        "of:0000000000000102" : {
+            "segmentrouting" : {
+                "name" : "s102",
+                "ipv4NodeSid" : 102,
+                "ipv4Loopback" : "192.168.0.102",
+		"ipv6NodeSid" : 202,
+		"ipv6Loopback" : "2000::c0a8:0202",
+                "routerMac" : "00:00:00:00:01:02",
+                "isEdgeRouter" : false,
+                "adjacencySids" : []
+            },
+            "basic" : {
+                 "driver" : "ofdpa-ovs",
+		 "latitude":42,
+		 "longitude":-95
+            }
+        }   
+    },
+    "apps" : {
+        "org.onosproject.dhcprelay" : {
+            "default": [
+                {
+                    "dhcpServerConnectPoint": "of:0000000000000005/12",
+                    "serverIps": ["10.0.3.253", "2000::3fd"]
+                }
+            ]
+        }
+    }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/comcast_fabric.py b/TestON/tests/USECASE/SegmentRouting/dependencies/comcast_fabric.py
index 0345375..9e2812d 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/comcast_fabric.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/comcast_fabric.py
@@ -248,19 +248,6 @@
         self.addLink(self.leafs[1], self.leafs[2], **linkopts)
         self.addLink(self.leafs[3], self.leafs[4], **linkopts)
 
-        # create dhcp servers
-        if dhcp:
-            if ipv4:
-                dhcp4 = self.addHost( 'dhcp', cls=TrellisHost,
-                                      mac="00:bb:00:00:00:01", ips=["10.0.3.253/24"],
-                                      gateway="10.0.3.254", dhcpServer=True)
-                self.addLink(self.spines[1], dhcp4, **linkopts)
-            if ipv6:
-                dhcp6 = self.addHost( 'dhcp6', cls=TrellisHost,
-                                      mac="00:cc:00:00:00:01", ips=["2000::3fd/120"],
-                                      gateway="2000::3ff", dhcpServer=True, ipv6=True)
-                self.addLink(self.spines[1], dhcp6, **linkopts)
-
         # create hosts
         if ipv6:
             self.createIpv6Hosts(dhcp)
@@ -355,6 +342,21 @@
             rh22v6 = self.addHost('rh22v6', cls=RoutedHost, ips=['2000::8802/120'], gateway='2000::8801')
             self.addLink(r2, rh22v6)
 
+        # create dhcp servers
+        if dhcp:
+            cs1 = self.addSwitch('cs1', cls=OVSBridge)
+            self.addLink(cs1, self.leafs[4])
+            if ipv4:
+                dhcp4 = self.addHost( 'dhcp', cls=TrellisHost,
+                                      mac="00:bb:00:00:00:01", ips=["10.0.3.253/24"],
+                                      gateway="10.0.3.254", dhcpServer=True)
+                self.addLink(dhcp4, cs1, **linkopts)
+            if ipv6:
+                dhcp6 = self.addHost( 'dhcp6', cls=TrellisHost,
+                                      mac="00:cc:00:00:00:01", ips=["2000::3fd/120"],
+                                      gateway="2000::3ff", dhcpServer=True, ipv6=True)
+                self.addLink(dhcp6, cs1, **linkopts)
+
 
 def config( opts ):