Add single switch topology in mininet with two hosts. Useful to
demonstrate simple use cases like bridging between two hosts on
single switch.

Change-Id: I9499341facfed4e9da1d62cb17e20f539517f2cc
diff --git a/mininet/.gitignore b/mininet/.gitignore
new file mode 100644
index 0000000..e43b0f9
--- /dev/null
+++ b/mininet/.gitignore
@@ -0,0 +1 @@
+.DS_Store
diff --git a/mininet/Chart.yaml b/mininet/Chart.yaml
index 0a5f10e..d380e2e 100644
--- a/mininet/Chart.yaml
+++ b/mininet/Chart.yaml
@@ -18,4 +18,4 @@
 appVersion: 1.1.0
 description: A Helm chart for Mininet
 name: mininet
-version: 1.2.1
+version: 1.2.2
diff --git a/mininet/sdfabric-single-values.yaml b/mininet/sdfabric-single-values.yaml
new file mode 100644
index 0000000..c2a96ff
--- /dev/null
+++ b/mininet/sdfabric-single-values.yaml
@@ -0,0 +1,40 @@
+---
+# Copyright 2017-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Put Mininet topology scripts in the toposcripts directory.
+# They will be mounted inside the container in /toposcripts
+
+replicaCount: 1
+
+nameOverride: ""
+fullnameOverride: ""
+
+images:
+  mininet:
+    repository: 'opennetworking/mn-stratum'
+    tag: 'latest'
+    pullPolicy: IfNotPresent
+
+global:
+  registry: ''
+
+resources: {}
+
+nodeSelector: {}
+
+tolerations: []
+
+mnStratumSwitchCount: 1
+topoScript: '/toposcripts/topo-singleleaf.py'
diff --git a/mininet/toposcripts/topo-singleleaf.py b/mininet/toposcripts/topo-singleleaf.py
new file mode 100755
index 0000000..2ceeb36
--- /dev/null
+++ b/mininet/toposcripts/topo-singleleaf.py
@@ -0,0 +1,52 @@
+#!/usr/bin/python
+
+# SPDX-FileCopyrightText: 2022-present Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+import argparse
+
+from mininet.cli import CLI
+from mininet.log import setLogLevel
+from mininet.net import Mininet
+from mininet.topo import Topo
+from stratum import StratumBmv2Switch
+
+from mn_lib import IPv4Host
+from mn_lib import TaggedIPv4Host
+
+CPU_PORT = 255
+
+
+class TutorialTopo(Topo):
+    """Single leaf switch with two hosts attached"""
+
+    def __init__(self, *args, **kwargs):
+        Topo.__init__(self, *args, **kwargs)
+
+        # Leaves
+        # gRPC port 50001
+        leaf1 = self.addSwitch('leaf1', cls=StratumBmv2Switch, cpuport=CPU_PORT)
+
+        # IPv4 hosts attached to leaf 1
+        h1a = self.addHost('h1a', cls=IPv4Host, mac="00:00:00:00:00:1A",
+                           ip='172.16.1.1/24', gw='172.16.1.254')
+        h1b = self.addHost('h1b', cls=IPv4Host, mac="00:00:00:00:00:1B",
+                           ip='172.16.1.2/24', gw='172.16.1.254')
+        self.addLink(h1a, leaf1)  # port 1
+        self.addLink(h1b, leaf1)  # port 2
+
+
+def main():
+    net = Mininet(topo=TutorialTopo(), controller=None)
+    net.start()
+    CLI(net)
+    net.stop()
+
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser(
+        description='Mininet topology script for single leaf having two hosts with stratum_bmv2')
+    args = parser.parse_args()
+    setLogLevel('info')
+
+    main()