From 860dfe22432da256801cf69480aa0efa9cee9f69 Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Thu, 30 May 2024 12:51:17 +0000
Subject: [PATCH] Dataplane-in-a-box descriptors:

- Added 3rd router
- Generalized paths in scripts
---
 dataplane-in-a-box/clab-deploy.sh       |  2 +-
 dataplane-in-a-box/clab-destroy.sh      |  2 +-
 dataplane-in-a-box/clab-inspect.sh      |  2 +-
 dataplane-in-a-box/tfs-01-topology.json | 42 ++++++++++++++++++++-----
 4 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/dataplane-in-a-box/clab-deploy.sh b/dataplane-in-a-box/clab-deploy.sh
index b66480b9b..a1ce30c25 100755
--- a/dataplane-in-a-box/clab-deploy.sh
+++ b/dataplane-in-a-box/clab-deploy.sh
@@ -13,5 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cd /home/tfs/tfs-ctrl/dataplane-in-a-box
+cd /home/$USER/tfs-ctrl/dataplane-in-a-box
 sudo containerlab deploy --topo arista.clab.yml
diff --git a/dataplane-in-a-box/clab-destroy.sh b/dataplane-in-a-box/clab-destroy.sh
index 1cf83516a..57917900b 100755
--- a/dataplane-in-a-box/clab-destroy.sh
+++ b/dataplane-in-a-box/clab-destroy.sh
@@ -13,6 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cd /home/tfs/tfs-ctrl/dataplane-in-a-box
+cd /home/$USER/tfs-ctrl/dataplane-in-a-box
 sudo containerlab destroy --topo arista.clab.yml
 sudo rm -rf clab-arista/ .arista.clab.yml.bak
diff --git a/dataplane-in-a-box/clab-inspect.sh b/dataplane-in-a-box/clab-inspect.sh
index 7037602cd..a4d51eac4 100755
--- a/dataplane-in-a-box/clab-inspect.sh
+++ b/dataplane-in-a-box/clab-inspect.sh
@@ -13,5 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-cd /home/tfs/tfs-ctrl/dataplane-in-a-box
+cd /home/$USER/tfs-ctrl/dataplane-in-a-box
 sudo containerlab inspect --topo arista.clab.yml
diff --git a/dataplane-in-a-box/tfs-01-topology.json b/dataplane-in-a-box/tfs-01-topology.json
index 6362584ba..ac87af62d 100644
--- a/dataplane-in-a-box/tfs-01-topology.json
+++ b/dataplane-in-a-box/tfs-01-topology.json
@@ -49,21 +49,47 @@
                     "username": "admin", "password": "admin", "use_tls": false
                 }}}
             ]}
+        },
+        {
+            "device_id": {"device_uuid": {"uuid": "r3"}}, "device_type": "packet-router",
+            "device_drivers": ["DEVICEDRIVER_GNMI_OPENCONFIG"],
+            "device_config": {"config_rules": [
+                {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/address", "resource_value": "172.20.20.103"}},
+                {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/port", "resource_value": "6030"}},
+                {"action": "CONFIGACTION_SET", "custom": {"resource_key": "_connect/settings", "resource_value": {
+                    "username": "admin", "password": "admin", "use_tls": false
+                }}}
+            ]}
         }
     ],
     "links": [
         {
-            "link_id": {"link_uuid": {"uuid": "r1/Ethernet1==r2/Ethernet1"}},
+            "link_id": {"link_uuid": {"uuid": "r1/Ethernet2==r2/Ethernet1"}},
             "link_endpoint_ids": [
-                {"device_id": {"device_uuid": {"uuid": "r1"}}, "endpoint_uuid": {"uuid": "Ethernet1"}},
+                {"device_id": {"device_uuid": {"uuid": "r1"}}, "endpoint_uuid": {"uuid": "Ethernet2"}},
                 {"device_id": {"device_uuid": {"uuid": "r2"}}, "endpoint_uuid": {"uuid": "Ethernet1"}}
             ]
         },
         {
-            "link_id": {"link_uuid": {"uuid": "r2/Ethernet1==r1/Ethernet1"}},
+            "link_id": {"link_uuid": {"uuid": "r2/Ethernet1==r1/Ethernet2"}},
             "link_endpoint_ids": [
                 {"device_id": {"device_uuid": {"uuid": "r2"}}, "endpoint_uuid": {"uuid": "Ethernet1"}},
-                {"device_id": {"device_uuid": {"uuid": "r1"}}, "endpoint_uuid": {"uuid": "Ethernet1"}}
+                {"device_id": {"device_uuid": {"uuid": "r1"}}, "endpoint_uuid": {"uuid": "Ethernet2"}}
+            ]
+        },
+
+        {
+            "link_id": {"link_uuid": {"uuid": "r2/Ethernet3==r3/Ethernet2"}},
+            "link_endpoint_ids": [
+                {"device_id": {"device_uuid": {"uuid": "r2"}}, "endpoint_uuid": {"uuid": "Ethernet3"}},
+                {"device_id": {"device_uuid": {"uuid": "r3"}}, "endpoint_uuid": {"uuid": "Ethernet2"}}
+            ]
+        },
+        {
+            "link_id": {"link_uuid": {"uuid": "r3/Ethernet2==r2/Ethernet3"}},
+            "link_endpoint_ids": [
+                {"device_id": {"device_uuid": {"uuid": "r3"}}, "endpoint_uuid": {"uuid": "Ethernet2"}},
+                {"device_id": {"device_uuid": {"uuid": "r2"}}, "endpoint_uuid": {"uuid": "Ethernet3"}}
             ]
         },
 
@@ -83,17 +109,17 @@
         },
 
         {
-            "link_id": {"link_uuid": {"uuid": "r2/Ethernet10==dc2/eth1"}},
+            "link_id": {"link_uuid": {"uuid": "r3/Ethernet10==dc2/eth1"}},
             "link_endpoint_ids": [
-                {"device_id": {"device_uuid": {"uuid": "r2"}}, "endpoint_uuid": {"uuid": "Ethernet10"}},
+                {"device_id": {"device_uuid": {"uuid": "r3"}}, "endpoint_uuid": {"uuid": "Ethernet10"}},
                 {"device_id": {"device_uuid": {"uuid": "dc2"}}, "endpoint_uuid": {"uuid": "eth1"}}
             ]
         },
         {
-            "link_id": {"link_uuid": {"uuid": "dc2/eth1==r2/Ethernet10"}},
+            "link_id": {"link_uuid": {"uuid": "dc2/eth1==r3/Ethernet10"}},
             "link_endpoint_ids": [
                 {"device_id": {"device_uuid": {"uuid": "dc2"}}, "endpoint_uuid": {"uuid": "eth1"}},
-                {"device_id": {"device_uuid": {"uuid": "r2"}}, "endpoint_uuid": {"uuid": "Ethernet10"}}
+                {"device_id": {"device_uuid": {"uuid": "r3"}}, "endpoint_uuid": {"uuid": "Ethernet10"}}
             ]
         }
     ]
-- 
GitLab