examples/ncclient: <copy-config> example of bridge domain configuration 05/14405/1
authorMarek Gradzki <[email protected]>
Tue, 21 Aug 2018 13:57:27 +0000 (15:57 +0200)
committerMarek Gradzki <[email protected]>
Tue, 21 Aug 2018 13:57:27 +0000 (15:57 +0200)
Change-Id: I66bf46a953ff40a6937fa77bfe58fa3ee179ed24
Signed-off-by: Marek Gradzki <[email protected]>
examples/ncclient/Readme.adoc
examples/ncclient/bd/config_bd.xml [new file with mode: 0644]
examples/ncclient/bd/expected_config_bd.xml [new file with mode: 0644]
examples/ncclient/bd/test_bd.sh [new file with mode: 0755]

index ec856c6..f2a97eb 100644 (file)
@@ -93,13 +93,28 @@ You can disable this behaviour using config/honeycomb.json.
 == <copy-config> examples
 
 === ACL
+
+Example configuration of ACLs on loopback interface.
+
 [source]
 ----
 ./acl/test_acl.sh
 ./acl/test_acl_updates.sh
 ----
 
+=== Bridge Domain
+
+Example configuration of loopback interface and bridge domain assignment.
+
+[source]
+----
+./bd/test_bd.sh
+----
+
 === NAT
+
+Example configuration of NAT on loopback interface.
+
 [source]
 ----
 ./acl/test_nat.sh
diff --git a/examples/ncclient/bd/config_bd.xml b/examples/ncclient/bd/config_bd.xml
new file mode 100644 (file)
index 0000000..d751223
--- /dev/null
@@ -0,0 +1,41 @@
+<!--
+  ~ Copyright (c) 2018 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+<config>
+    <nat xmlns="urn:ietf:params:xml:ns:yang:ietf-nat">
+        <instances>
+            <instance>
+                <id>0</id>
+                <policy>
+                    <id>0</id>
+                </policy>
+            </instance>
+        </instances>
+    </nat>
+    <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
+        <interface>
+            <name>local0</name>
+            <type xmlns:x="urn:ietf:params:xml:ns:yang:iana-if-type">x:ethernetCsmacd</type>
+            <enabled>false</enabled>
+        </interface>
+        <interface>
+            <name>loop1</name>
+            <type xmlns:x="urn:opendaylight:params:xml:ns:yang:v3po">x:loopback</type>
+            <loopback xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+                <mac>00:ff:ff:ff:ff:ff</mac>
+            </loopback>
+            <l2 xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+                <bridge-domain>test_bd</bridge-domain>
+            </l2>
+        </interface>
+    </interfaces>
+    <bridge-domains xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+        <bridge-domain>
+            <name>test_bd</name>
+        </bridge-domain>
+    </bridge-domains>
+</config>
diff --git a/examples/ncclient/bd/expected_config_bd.xml b/examples/ncclient/bd/expected_config_bd.xml
new file mode 100644 (file)
index 0000000..9863215
--- /dev/null
@@ -0,0 +1,41 @@
+<!--
+  ~ Copyright (c) 2018 Cisco Systems, Inc. and others.  All rights reserved.
+  ~
+  ~ This program and the accompanying materials are made available under the
+  ~ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+  ~ and is available at http://www.eclipse.org/legal/epl-v10.html
+  -->
+<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
+    <nat xmlns="urn:ietf:params:xml:ns:yang:ietf-nat">
+        <instances>
+            <instance>
+                <id>0</id>
+                <policy>
+                    <id>0</id>
+                </policy>
+            </instance>
+        </instances>
+    </nat>
+    <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
+        <interface>
+            <name>local0</name>
+            <type xmlns:x="urn:ietf:params:xml:ns:yang:iana-if-type">x:ethernetCsmacd</type>
+            <enabled>false</enabled>
+        </interface>
+        <interface>
+            <name>loop1</name>
+            <type xmlns:x="urn:opendaylight:params:xml:ns:yang:v3po">x:loopback</type>
+            <loopback xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+                <mac>00:ff:ff:ff:ff:ff</mac>
+            </loopback>
+            <l2 xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+                <bridge-domain>test_bd</bridge-domain>
+            </l2>
+        </interface>
+    </interfaces>
+    <bridge-domains xmlns="urn:opendaylight:params:xml:ns:yang:v3po">
+        <bridge-domain>
+            <name>test_bd</name>
+        </bridge-domain>
+    </bridge-domains>
+</data>
diff --git a/examples/ncclient/bd/test_bd.sh b/examples/ncclient/bd/test_bd.sh
new file mode 100755 (executable)
index 0000000..6b3ac8f
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# Copyright (c) 2018 Cisco and/or its affiliates.
+# 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.
+
+DIR_NAME=$(dirname $0)
+
+${DIR_NAME}/../test_copy_config.sh ${DIR_NAME}/config_bd.xml ${DIR_NAME}/expected_config_bd.xml