summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-08-21 15:57:27 +0200
committerMarek Gradzki <mgradzki@cisco.com>2018-08-21 15:57:27 +0200
commit4a43e8b580e7634e62bfc0a2437377f349834049 (patch)
tree8eec05639d5c38192421a59964a45de9540a6a4e
parent579bc2fc74a764a149afa30291d734f6ebe18b94 (diff)
examples/ncclient: <copy-config> example of bridge domain configuration
Change-Id: I66bf46a953ff40a6937fa77bfe58fa3ee179ed24 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
-rw-r--r--examples/ncclient/Readme.adoc15
-rw-r--r--examples/ncclient/bd/config_bd.xml41
-rw-r--r--examples/ncclient/bd/expected_config_bd.xml41
-rwxr-xr-xexamples/ncclient/bd/test_bd.sh18
4 files changed, 115 insertions, 0 deletions
diff --git a/examples/ncclient/Readme.adoc b/examples/ncclient/Readme.adoc
index ec856c6a3..f2a97eb72 100644
--- a/examples/ncclient/Readme.adoc
+++ b/examples/ncclient/Readme.adoc
@@ -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
index 000000000..d7512239f
--- /dev/null
+++ b/examples/ncclient/bd/config_bd.xml
@@ -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
index 000000000..98632159b
--- /dev/null
+++ b/examples/ncclient/bd/expected_config_bd.xml
@@ -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
index 000000000..6b3ac8fe2
--- /dev/null
+++ b/examples/ncclient/bd/test_bd.sh
@@ -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