--- /dev/null
+# All these sections are optional, edit this file as you like.
+[general]
+# Ignore certain rules, you can reference them by their id or by their full
+# name
+# ignore=title-trailing-punctuation, T3
+# verbosity should be a value between 1 and 3, the command line -v flags take
+# precedence over this
+# verbosity = 2
+# By default gitlint will ignore merge commits. Set to 'false' to disable.
+# ignore-merge-commits=true
+# By default gitlint will ignore fixup commits. Set to 'false' to disable.
+# ignore-fixup-commits=true
+# By default gitlint will ignore squash commits. Set to 'false' to disable.
+# ignore-squash-commits=true
+# Enable debug mode (prints more output). Disabled by default.
+# debug=true
+# Set the extra-path where gitlint will search for user defined rules
+# See http://jorisroovers.github.io/gitlint/user_defined_rules for details
+# extra-path=examples/
+# contrib=contrib-title-conventional-commits,contrib-body-requires-signed-off-b
+contrib=contrib-body-requires-signed-off-by
+[title-max-length]
+# line-length=80
+line-length=50
+# [title-must-not-contain-word]
+# Comma-separated list of words that should not occur in the title. Matching is
+# case insensitive. It's fine if the keyword occurs as part of a larger word
+# (so "WIPING" will not cause a violation, but "WIP: my title" will.
+# words=wip
+# [title-match-regex]
+# python like regex (https://docs.python.org/2/library/re.html) that the
+# commit-msg title must be matched to.
+# Note that the regex can contradict with other rules if not used correctly
+# (e.g. title-must-not-contain-word).
+# regex=^US[0-9]*
+[B1]
+# B1 = body-max-line-length
+# line-length=120
+line-length=72
+# [body-min-length]
+# min-length=5
+# [body-is-missing]
+# Whether to ignore this rule on merge commits (which typically only have a title)
+# default = True
+# ignore-merge-commits=false
+# [body-changed-file-mention]
+# List of files that need to be explicitly mentioned in the body when they are
+# changed This is useful for when developers often erroneously edit certain
+# files or git submodules. By specifying this rule, developers can only change
+# the file when they explicitly reference it in the commit message.
+# files=gitlint/rules.py,README.md
+# [author-valid-email]
+# python like regex (https://docs.python.org/2/library/re.html) that the
+# commit author email address should be matched to
+# For example, use the following regex if you only want to allow email
+# addresses from foo.com
+# regex=[^@]+@foo.com
+# [ignore-by-title]
+# Ignore certain rules for commits of which the title matches a regex
+# E.g. Match commit titles that start with "Release"
+# regex=^Release(.*)
+#
+# Ignore certain rules, you can reference them by their id or by their full name
+# Use 'all' to ignore all rules
+# ignore=T1,body-min-length
+# [ignore-by-body]
+# Ignore certain rules for commits of which the body has a line that matches a
+# regex
+# E.g. Match bodies that have a line that contain "release"
+# regex=(.*)release(.*)
+#
+# Ignore certain rules, you can reference them by their id or by their full name
+# Use 'all' to ignore all rules
+# ignore=T1,body-min-length
+# Enable Conventional Commit subject line enforcement
+# https://www.conventionalcommits.org/en/v1.0.0/
+#
+# Since we want all subjects to be well formed, enforce the topics
+# to the following (fairly standard) topics and require them to be Mixed Case
+#[contrib-title-conventional-commits]
+#types=Fix,Feat,Chore,Docs,Style,Refactor,Perf,Test,Revert,CI,Build
--- /dev/null
+---
+repos:
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.0.1
+ hooks:
+ - id: trailing-whitespace
+ exclude: '^ordmodels/'
+ # ordmodels trailing blanks shall preferably be fixed in OpenROADM upstream repo
+
+ - repo: https://github.com/jorisroovers/gitlint
+ rev: v0.15.1
+ hooks:
+ - id: gitlint
+ stages: [commit-msg]
+
+ - repo: https://github.com/Lucas-C/pre-commit-hooks
+ rev: v1.1.10
+ hooks:
+ - id: remove-tabs
+ stages: [commit]
+ exclude: '^(.git/|docs/make.bat|docs/Makefile|ordmodels/)'
It listens to connections in clear TCP to the given port. When a TCP connection demand is received,
it establishes a netconf SSH encrypted connection to the host in argument. Netconf rpcs and replies
are then proxified between both ends.
-By default, exchanges are altered according to the rules specified inside this script and easily
+By default, exchanges are altered according to the rules specified inside this script and easily
modifiable. This behaviour can be disabled with the '-s' option.
For more convenience, the server hello handshake can also alternatively be replaced by the content
of an external file instead of writing specific rules.
# copy the socket to standard output
my $buf;
-
+
if (defined ($hello_message)) {
#retrieve the server hello but do not relay it
while (my $nread = sysread($ssh_subsocket,$buf,400)) {
print $client $buf;
$ssh_subsocket->flush();
if (defined($verbose)) { print STDOUT $buf; }
-
+
};
-
+
kill("TERM", $kidpid); # send SIGTERM to child
}
# the else{} block runs only in the child process (client input relayed to the server)
{
- "variables": [],
- "info": {
- "name": "TransportPCE",
- "_postman_id": "2a8c7902-5793-e48c-ebab-72256fcac793",
- "description": "",
- "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
- },
- "item": [
- {
- "name": "test_portmapping",
- "description": "",
- "item": [
- {
- "name": "test_01_rdm_device_connected",
- "request": {
- "auth": {
- "type": "basic",
- "basic": {
- "username": "admin",
- "password": "admin",
- "saveHelperData": true,
- "showPassword": false
- }
- },
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
- "method": "PUT",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- },
- {
- "key": "Authorization",
- "value": "Basic YWRtaW46YWRtaW4=",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"node\" : {\n \"node-id\": \"ROADMA\",\n \"host\": \"127.0.0.1\",\n \"port\": 17830,\n \"username\": \"admin\",\n \"password\": \"admin\",\n \"tcp-only\": false,\n \"keepalive-delay\": 0,\n \"pass-through\": {}\n }\n}\n"
- },
- "description": "connect device 01"
- },
- "response": []
- },
- {
- "name": "test_02_rdm_device_connected",
- "request": {
- "url": "http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_03_rdm_portmapping_DEG1_TTP_TXRX",
- "request": {
- "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/ROADMA/mapping/DEG1-TTP-TXRX",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_04_rdm_portmapping_SRG1_PP7_TXRX",
- "request": {
- "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/ROADMA/mapping/SRG1-PP7-TXRX",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_05_rdm_portmapping_SRG3_PP1_TXRX",
- "request": {
- "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/ROADMA/mapping/SRG3-PP1-TXRX",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_06_xpdr_device_connected",
- "request": {
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/XPDRA",
- "method": "PUT",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"node\" : {\n \"node-id\": \"XPDRA\",\n \"host\": \"127.0.0.1\",\n \"port\": 17831,\n \"username\": \"admin\",\n \"password\": \"admin\",\n \"tcp-only\": false,\n \"keepalive-delay\": 0,\n \"pass-through\": {}\n }\n}"
- },
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_07_xpdr_device_connected",
- "request": {
- "url": "http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/XPDRA",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_08_xpdr_portmapping_NETWORK1",
- "request": {
- "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA/mapping/XPDR1-NETWORK1",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_09_xpdr_portmapping_NETWORK2",
- "request": {
- "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA/mapping/XPDR1-NETWORK2",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_10_xpdr_portmapping_CLIENT1",
- "request": {
- "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA/mapping/XPDR1-CLIENT1",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_11_xpdr_portmapping_CLIENT2",
- "request": {
- "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA/mapping/XPDR1-CLIENT2",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_12_xpdr_portmapping_CLIENT4",
- "request": {
- "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA/mapping/XPDR1-CLIENT4",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_13_xpdr_device_disconnected",
- "request": {
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/XPDRA",
- "method": "DELETE",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_14_xpdr_device_disconnected",
- "request": {
- "url": "http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/XPDRA",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_15_xpdr_device_disconnected",
- "request": {
- "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_16_rdm_device_disconnected",
- "request": {
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
- "method": "DELETE",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_17_rdm_device_disconnected",
- "request": {
- "url": "http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- },
- {
- "name": "test_18_rdm_device_disconnected",
- "request": {
- "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/ROADMA",
- "method": "GET",
- "header": [],
- "body": {},
- "description": ""
- },
- "response": []
- }
- ]
- },
- {
- "name": "Get Modules",
- "request": {
- "auth": {
- "type": "basic",
- "basic": {
- "username": "admin",
- "password": "admin",
- "saveHelperData": true,
- "showPassword": false
- }
- },
- "url": "http://localhost:8181/restconf/modules",
- "method": "GET",
- "header": [
- {
- "key": "Authorization",
- "value": "Basic YWRtaW46YWRtaW4=",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": ""
- },
- "description": "Get installed yang models "
- },
- "response": []
- },
- {
- "name": "Get List Of Network Topologies",
- "request": {
- "auth": {
- "type": "basic",
- "basic": {
- "username": "admin",
- "password": "admin",
- "saveHelperData": true,
- "showPassword": false
- }
- },
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology",
- "method": "GET",
- "header": [
- {
- "key": "Authorization",
- "value": "Basic YWRtaW46YWRtaW4=",
- "description": ""
- }
- ],
- "body": {},
- "description": "Get List Of Network Topologies"
- },
- "response": []
- },
- {
- "name": "Create NetConf device ",
- "request": {
- "auth": {
- "type": "basic",
- "basic": {
- "username": "admin",
- "password": "admin",
- "saveHelperData": true,
- "showPassword": false
- }
- },
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device",
- "method": "PUT",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- },
- {
- "key": "Authorization",
- "value": "Basic YWRtaW46YWRtaW4=",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"node\" : {\n \"node-id\": \"new-netconf-device\",\n \"host\": \"127.0.0.1\",\n \"port\": 17830,\n \"username\": \"admin\",\n \"password\": \"admin\",\n \"tcp-only\": false,\n \"keepalive-delay\": 0\n }\n}\n"
- },
- "description": "Create NetConf device "
- },
- "response": []
- },
- {
- "name": "disconnect device 01",
- "request": {
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
- "method": "DELETE",
- "header": [],
- "body": {},
- "description": "Delete NetConf device"
- },
- "response": []
- },
- {
- "name": "disconnect device 02",
- "request": {
- "auth": {
- "type": "basic",
- "basic": {
- "username": "admin",
- "password": "admin",
- "saveHelperData": true,
- "showPassword": false
- }
- },
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/XPDRA",
- "method": "DELETE",
- "header": [
- {
- "key": "Authorization",
- "value": "Basic YWRtaW46YWRtaW4=",
- "description": ""
- }
- ],
- "body": {},
- "description": "Delete NetConf device"
- },
- "response": []
- },
- {
- "name": "Get Topologies Operational",
- "request": {
- "auth": {
- "type": "basic",
- "basic": {
- "username": "admin",
- "password": "admin",
- "saveHelperData": true,
- "showPassword": false
- }
- },
- "url": "http://localhost:8181/restconf/operational/network-topology:network-topology",
- "method": "GET",
- "header": [
- {
- "key": "Authorization",
- "value": "Basic YWRtaW46YWRtaW4=",
- "description": ""
- }
- ],
- "body": {},
- "description": "Get Topologies Operational"
- },
- "response": []
- },
- {
- "name": "connect device 01",
- "request": {
- "auth": {
- "type": "basic",
- "basic": {
- "username": "admin",
- "password": "admin",
- "saveHelperData": true,
- "showPassword": false
- }
- },
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
- "method": "PUT",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- },
- {
- "key": "Authorization",
- "value": "Basic YWRtaW46YWRtaW4=",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"node\" : {\n \"node-id\": \"ROADMA\",\n \"host\": \"127.0.0.1\",\n \"port\": 17830,\n \"username\": \"admin\",\n \"password\": \"admin\",\n \"tcp-only\": false,\n \"keepalive-delay\": 0,\n \"pass-through\": {}\n }\n}\n"
- },
- "description": "connect device 01"
- },
- "response": []
- },
- {
- "name": "connect device 02",
- "request": {
- "auth": {
- "type": "basic",
- "basic": {
- "username": "admin",
- "password": "admin",
- "saveHelperData": true,
- "showPassword": false
- }
- },
- "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
- "method": "PUT",
- "header": [
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- },
- {
- "key": "Authorization",
- "value": "Basic YWRtaW46YWRtaW4=",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n \"node\" : {\n \"node-id\": \"XPDRA\",\n \"host\": \"127.0.0.1\",\n \"port\": 17831,\n \"username\": \"admin\",\n \"password\": \"admin\",\n \"tcp-only\": false,\n \"keepalive-delay\": 0,\n \"pass-through\": {}\n }\n}\n"
- },
- "description": "connect device 02"
- },
- "response": []
- }
- ]
+ "variables": [],
+ "info": {
+ "name": "TransportPCE",
+ "_postman_id": "2a8c7902-5793-e48c-ebab-72256fcac793",
+ "description": "",
+ "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
+ },
+ "item": [
+ {
+ "name": "test_portmapping",
+ "description": "",
+ "item": [
+ {
+ "name": "test_01_rdm_device_connected",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": {
+ "username": "admin",
+ "password": "admin",
+ "saveHelperData": true,
+ "showPassword": false
+ }
+ },
+ "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
+ "method": "PUT",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"node\" : {\n \"node-id\": \"ROADMA\",\n \"host\": \"127.0.0.1\",\n \"port\": 17830,\n \"username\": \"admin\",\n \"password\": \"admin\",\n \"tcp-only\": false,\n \"keepalive-delay\": 0,\n \"pass-through\": {}\n }\n}\n"
+ },
+ "description": "connect device 01"
+ },
+ "response": []
+ },
+ {
+ "name": "test_02_rdm_device_connected",
+ "request": {
+ "url": "http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_03_rdm_portmapping_DEG1_TTP_TXRX",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/ROADMA/mapping/DEG1-TTP-TXRX",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_04_rdm_portmapping_SRG1_PP7_TXRX",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/ROADMA/mapping/SRG1-PP7-TXRX",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_05_rdm_portmapping_SRG3_PP1_TXRX",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/ROADMA/mapping/SRG3-PP1-TXRX",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_06_xpdr_device_connected",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/XPDRA",
+ "method": "PUT",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"node\" : {\n \"node-id\": \"XPDRA\",\n \"host\": \"127.0.0.1\",\n \"port\": 17831,\n \"username\": \"admin\",\n \"password\": \"admin\",\n \"tcp-only\": false,\n \"keepalive-delay\": 0,\n \"pass-through\": {}\n }\n}"
+ },
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_07_xpdr_device_connected",
+ "request": {
+ "url": "http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/XPDRA",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_08_xpdr_portmapping_NETWORK1",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA/mapping/XPDR1-NETWORK1",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_09_xpdr_portmapping_NETWORK2",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA/mapping/XPDR1-NETWORK2",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_10_xpdr_portmapping_CLIENT1",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA/mapping/XPDR1-CLIENT1",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_11_xpdr_portmapping_CLIENT2",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA/mapping/XPDR1-CLIENT2",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_12_xpdr_portmapping_CLIENT4",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA/mapping/XPDR1-CLIENT4",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_13_xpdr_device_disconnected",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/XPDRA",
+ "method": "DELETE",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_14_xpdr_device_disconnected",
+ "request": {
+ "url": "http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/XPDRA",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_15_xpdr_device_disconnected",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/XPDRA",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_16_rdm_device_disconnected",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
+ "method": "DELETE",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_17_rdm_device_disconnected",
+ "request": {
+ "url": "http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ },
+ {
+ "name": "test_18_rdm_device_disconnected",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/transportpce-portmapping:network/nodes/ROADMA",
+ "method": "GET",
+ "header": [],
+ "body": {},
+ "description": ""
+ },
+ "response": []
+ }
+ ]
+ },
+ {
+ "name": "Get Modules",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": {
+ "username": "admin",
+ "password": "admin",
+ "saveHelperData": true,
+ "showPassword": false
+ }
+ },
+ "url": "http://localhost:8181/restconf/modules",
+ "method": "GET",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": ""
+ },
+ "description": "Get installed yang models "
+ },
+ "response": []
+ },
+ {
+ "name": "Get List Of Network Topologies",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": {
+ "username": "admin",
+ "password": "admin",
+ "saveHelperData": true,
+ "showPassword": false
+ }
+ },
+ "url": "http://localhost:8181/restconf/config/network-topology:network-topology",
+ "method": "GET",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {},
+ "description": "Get List Of Network Topologies"
+ },
+ "response": []
+ },
+ {
+ "name": "Create NetConf device ",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": {
+ "username": "admin",
+ "password": "admin",
+ "saveHelperData": true,
+ "showPassword": false
+ }
+ },
+ "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/new-netconf-device",
+ "method": "PUT",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"node\" : {\n \"node-id\": \"new-netconf-device\",\n \"host\": \"127.0.0.1\",\n \"port\": 17830,\n \"username\": \"admin\",\n \"password\": \"admin\",\n \"tcp-only\": false,\n \"keepalive-delay\": 0\n }\n}\n"
+ },
+ "description": "Create NetConf device "
+ },
+ "response": []
+ },
+ {
+ "name": "disconnect device 01",
+ "request": {
+ "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
+ "method": "DELETE",
+ "header": [],
+ "body": {},
+ "description": "Delete NetConf device"
+ },
+ "response": []
+ },
+ {
+ "name": "disconnect device 02",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": {
+ "username": "admin",
+ "password": "admin",
+ "saveHelperData": true,
+ "showPassword": false
+ }
+ },
+ "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/XPDRA",
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {},
+ "description": "Delete NetConf device"
+ },
+ "response": []
+ },
+ {
+ "name": "Get Topologies Operational",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": {
+ "username": "admin",
+ "password": "admin",
+ "saveHelperData": true,
+ "showPassword": false
+ }
+ },
+ "url": "http://localhost:8181/restconf/operational/network-topology:network-topology",
+ "method": "GET",
+ "header": [
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {},
+ "description": "Get Topologies Operational"
+ },
+ "response": []
+ },
+ {
+ "name": "connect device 01",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": {
+ "username": "admin",
+ "password": "admin",
+ "saveHelperData": true,
+ "showPassword": false
+ }
+ },
+ "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
+ "method": "PUT",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"node\" : {\n \"node-id\": \"ROADMA\",\n \"host\": \"127.0.0.1\",\n \"port\": 17830,\n \"username\": \"admin\",\n \"password\": \"admin\",\n \"tcp-only\": false,\n \"keepalive-delay\": 0,\n \"pass-through\": {}\n }\n}\n"
+ },
+ "description": "connect device 01"
+ },
+ "response": []
+ },
+ {
+ "name": "connect device 02",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": {
+ "username": "admin",
+ "password": "admin",
+ "saveHelperData": true,
+ "showPassword": false
+ }
+ },
+ "url": "http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ROADMA",
+ "method": "PUT",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "description": ""
+ },
+ {
+ "key": "Authorization",
+ "value": "Basic YWRtaW46YWRtaW4=",
+ "description": ""
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"node\" : {\n \"node-id\": \"XPDRA\",\n \"host\": \"127.0.0.1\",\n \"port\": 17831,\n \"username\": \"admin\",\n \"password\": \"admin\",\n \"tcp-only\": false,\n \"keepalive-delay\": 0,\n \"pass-through\": {}\n }\n}\n"
+ },
+ "description": "connect device 02"
+ },
+ "response": []
+ }
+ ]
}
\ No newline at end of file
}
]
}
-
+
}
}
\ No newline at end of file
leaf cc-period {
type oam-period;
description "This attribute models the MI_CC_Period signal defined in G.8021 and configured as specified in G8051.
- It is the period at which the CCM message should be sent.
+ It is the period at which the CCM message should be sent.
Default values are: 3.33 ms for PS, 100 ms for PM, 1 s for FM.";
}
leaf cc-priority {
description "Provides the ordered structure of layer protocol transitions encapsulated in the TopologicalEntity. The ordering relates to the LinkPort role.";
}
description "Relevant for a Link that is formed by abstracting one or more LTPs (in a stack) to focus on the flow and deemphasize the protocol transformation.
- This abstraction is relevant when considering multi-layer routing.
+ This abstraction is relevant when considering multi-layer routing.
The layer protocols of the LTP and the order of their application to the signal is still relevant and need to be accounted for. This is derived from the LTP spec details.
This Pac provides the relevant abstractions of the LTPs and provides the necessary association to the LTPs involved.
Links that included details in this Pac are often referred to as Transitional Links.";
if [ "$JAVA_VER" -ge 110 -a "$JAVAC_VER" -ge 110 ];then
echo "ok, java is 11 or newer"
else
- #java 11 installation for CentOS (releng OS image target)
+ #java 11 installation for CentOS (releng OS image target)
echo "install java 11"
sudo yum install -y java-11-openjdk java-11-openjdk-devel
last_installed_jdk11=$(ls -tr1 /usr/lib/jvm/ | grep java-11-openjdk-11 | tail -1)
+++ /dev/null
-diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/SimulatedOperationProvider.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/SimulatedOperationProvider.java
-index f2828d1..d3026b8 100644
---- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/SimulatedOperationProvider.java
-+++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/SimulatedOperationProvider.java
-@@ -26,6 +26,7 @@ import org.opendaylight.netconf.test.tool.rpc.SimulatedDiscardChanges;
- import org.opendaylight.netconf.test.tool.rpc.SimulatedEditConfig;
- import org.opendaylight.netconf.test.tool.rpc.SimulatedGet;
- import org.opendaylight.netconf.test.tool.rpc.SimulatedGetConfig;
-+import org.opendaylight.netconf.test.tool.rpc.SimulatedGetConnectionPortTrail;
- import org.opendaylight.netconf.test.tool.rpc.SimulatedLock;
- import org.opendaylight.netconf.test.tool.rpc.SimulatedUnLock;
-
-@@ -38,19 +39,19 @@ class SimulatedOperationProvider implements NetconfOperationServiceFactory {
- final Optional<File> notificationsFile,
- final Optional<File> initialConfigXMLFile) {
- this.caps = caps;
-- simulatedOperationService = new SimulatedOperationService(
-+ this.simulatedOperationService = new SimulatedOperationService(
- idProvider.getCurrentSessionId(), notificationsFile, initialConfigXMLFile);
- }
-
- @Override
- public Set<Capability> getCapabilities() {
-- return caps;
-+ return this.caps;
- }
-
- @Override
- public AutoCloseable registerCapabilityListener(
- final CapabilityListener listener) {
-- listener.onCapabilitiesChanged(caps, Collections.emptySet());
-+ listener.onCapabilitiesChanged(this.caps, Collections.emptySet());
- return () -> {
- };
- }
-@@ -58,7 +59,7 @@ class SimulatedOperationProvider implements NetconfOperationServiceFactory {
- @Override
- public NetconfOperationService createService(
- final String netconfSessionIdForReporting) {
-- return simulatedOperationService;
-+ return this.simulatedOperationService;
- }
-
- static class SimulatedOperationService implements NetconfOperationService {
-@@ -76,19 +77,24 @@ class SimulatedOperationProvider implements NetconfOperationServiceFactory {
- @Override
- public Set<NetconfOperation> getNetconfOperations() {
- final DataList storage = new DataList();
-- final SimulatedGet sGet = new SimulatedGet(String.valueOf(currentSessionId), storage);
-- final SimulatedEditConfig sEditConfig = new SimulatedEditConfig(String.valueOf(currentSessionId), storage);
-+ final SimulatedGet sGet = new SimulatedGet(String.valueOf(this.currentSessionId), storage,
-+ this.initialConfigXMLFile);
-+ final SimulatedEditConfig sEditConfig = new SimulatedEditConfig(String.valueOf(this.currentSessionId),
-+ storage);
- final SimulatedGetConfig sGetConfig = new SimulatedGetConfig(
-- String.valueOf(currentSessionId), storage, initialConfigXMLFile);
-- final SimulatedCommit sCommit = new SimulatedCommit(String.valueOf(currentSessionId));
-- final SimulatedLock sLock = new SimulatedLock(String.valueOf(currentSessionId));
-- final SimulatedUnLock sUnlock = new SimulatedUnLock(String.valueOf(currentSessionId));
-+ String.valueOf(this.currentSessionId), storage, this.initialConfigXMLFile);
-+ final SimulatedGetConnectionPortTrail sSimulatedConnectionPortTrail = new SimulatedGetConnectionPortTrail(
-+ String.valueOf(this.currentSessionId));
-+ final SimulatedCommit sCommit = new SimulatedCommit(String.valueOf(this.currentSessionId));
-+ final SimulatedLock sLock = new SimulatedLock(String.valueOf(this.currentSessionId));
-+ final SimulatedUnLock sUnlock = new SimulatedUnLock(String.valueOf(this.currentSessionId));
- final SimulatedCreateSubscription sCreateSubs = new SimulatedCreateSubscription(
-- String.valueOf(currentSessionId), notificationsFile);
-+ String.valueOf(this.currentSessionId), this.notificationsFile);
- final SimulatedDiscardChanges sDiscardChanges = new SimulatedDiscardChanges(
-- String.valueOf(currentSessionId));
-+ String.valueOf(this.currentSessionId));
- return Sets.newHashSet(
-- sGet, sGetConfig, sEditConfig, sCommit, sLock, sUnlock, sCreateSubs, sDiscardChanges);
-+ sGet, sGetConfig, sEditConfig, sCommit, sLock, sUnlock, sCreateSubs, sDiscardChanges,
-+ sSimulatedConnectionPortTrail);
- }
-
- @Override
-diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/config/Configuration.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/config/Configuration.java
-index 6654425..d5bebd6 100644
---- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/config/Configuration.java
-+++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/config/Configuration.java
-@@ -95,7 +95,7 @@ public class Configuration {
- }
-
- public PublickeyAuthenticator getPublickeyAuthenticator() {
-- return publickeyAuthenticator;
-+ return this.publickeyAuthenticator;
- }
-
- public void setPublickeyAuthenticator(final PublickeyAuthenticator publickeyAuthenticator) {
-@@ -103,7 +103,7 @@ public class Configuration {
- }
-
- public AuthProvider getAuthProvider() {
-- return authProvider;
-+ return this.authProvider;
- }
-
- public void setAuthProvider(final AuthProvider authProvider) {
-@@ -111,7 +111,7 @@ public class Configuration {
- }
-
- public Set<YangResource> getDefaultYangResources() {
-- return defaultYangResources;
-+ return this.defaultYangResources;
- }
-
- public void setDefaultYangResources(final Set<YangResource> defaultYangResources) {
-@@ -119,7 +119,7 @@ public class Configuration {
- }
-
- public int getThreadPoolSize() {
-- return threadPoolSize;
-+ return this.threadPoolSize;
- }
-
- public void setThreadPoolSize(final int threadPoolSize) {
-@@ -127,7 +127,7 @@ public class Configuration {
- }
-
- public int getStartingPort() {
-- return startingPort;
-+ return this.startingPort;
- }
-
- public void setStartingPort(final int startingPort) {
-@@ -135,7 +135,7 @@ public class Configuration {
- }
-
- public int getDeviceCount() {
-- return deviceCount;
-+ return this.deviceCount;
- }
-
- public void setDeviceCount(final int deviceCount) {
-@@ -143,7 +143,7 @@ public class Configuration {
- }
-
- public int getGenerateConfigsTimeout() {
-- return generateConfigsTimeout;
-+ return this.generateConfigsTimeout;
- }
-
- public void setGenerateConfigsTimeout(final int generateConfigsTimeout) {
-@@ -151,7 +151,7 @@ public class Configuration {
- }
-
- public boolean isSsh() {
-- return ssh;
-+ return this.ssh;
- }
-
- public void setSsh(final boolean ssh) {
-@@ -159,7 +159,7 @@ public class Configuration {
- }
-
- public String getIp() {
-- return ip;
-+ return this.ip;
- }
-
- public void setIp(final String ip) {
-@@ -167,7 +167,7 @@ public class Configuration {
- }
-
- public Set<String> getModels() {
-- return models;
-+ return this.models;
- }
-
- public void setModels(final Set<String> models) {
-@@ -175,7 +175,7 @@ public class Configuration {
- }
-
- public Set<String> getCapabilities() {
-- return capabilities;
-+ return this.capabilities;
- }
-
- public void setCapabilities(final Set<String> capabilities) {
-@@ -183,7 +183,7 @@ public class Configuration {
- }
-
- public RpcHandler getRpcHandler() {
-- return rpcHandler;
-+ return this.rpcHandler;
- }
-
- public void setRpcHandler(final RpcHandler rpcHandler) {
-@@ -191,7 +191,7 @@ public class Configuration {
- }
-
- public OperationsCreator getOperationsCreator() {
-- return operationsCreator;
-+ return this.operationsCreator;
- }
-
- public void setOperationsCreator(final OperationsCreator operationsCreator) {
-@@ -200,7 +200,7 @@ public class Configuration {
-
- @Deprecated
- public boolean isMdSal() {
-- return mdSal;
-+ return this.mdSal;
- }
-
- @Deprecated
-@@ -210,7 +210,7 @@ public class Configuration {
-
- @Deprecated
- public File getRpcConfigFile() {
-- return rpcConfigFile;
-+ return this.rpcConfigFile;
- }
-
- @Deprecated
-@@ -220,7 +220,7 @@ public class Configuration {
-
- @Deprecated
- public File getNotificationFile() {
-- return notificationFile;
-+ return this.notificationFile;
- }
-
- @Deprecated
-@@ -230,7 +230,7 @@ public class Configuration {
-
- @Deprecated
- public File getInitialConfigXMLFile() {
-- return initialConfigXMLFile;
-+ return this.initialConfigXMLFile;
- }
-
- @Deprecated
-@@ -240,12 +240,12 @@ public class Configuration {
-
- @Deprecated
- public boolean isXmlConfigurationProvided() {
-- return initialConfigXMLFile != null && notificationFile != null;
-+ return this.initialConfigXMLFile != null;//&& notificationFile != null;
- }
-
- @Deprecated
- public File getSchemasDir() {
-- return schemasDir;
-+ return this.schemasDir;
- }
-
- @Deprecated
-diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/operations/DefaultOperationsCreator.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/operations/DefaultOperationsCreator.java
-index edfdf6e..0bc0b9d 100644
---- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/operations/DefaultOperationsCreator.java
-+++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/operations/DefaultOperationsCreator.java
-@@ -30,14 +30,14 @@ public final class DefaultOperationsCreator implements OperationsCreator {
- private final SimulatedOperationService simulatedOperationService;
-
- private DefaultOperationsCreator(final long currentSessionId) {
-- simulatedOperationService = new SimulatedOperationService(currentSessionId);
-+ this.simulatedOperationService = new SimulatedOperationService(currentSessionId);
- }
-
- @Override
- public NetconfOperationService getNetconfOperationService(final Set<Capability> caps,
- final SessionIdProvider idProvider,
- final String netconfSessionIdForReporting) {
-- return simulatedOperationService;
-+ return this.simulatedOperationService;
- }
-
- public static DefaultOperationsCreator getDefaultOperationServiceCreator(final long currentSessionId) {
-@@ -55,17 +55,19 @@ public final class DefaultOperationsCreator implements OperationsCreator {
- @Override
- public Set<NetconfOperation> getNetconfOperations() {
- final DataList storage = new DataList();
-- final SimulatedGet sGet = new SimulatedGet(String.valueOf(currentSessionId), storage);
-- final SimulatedEditConfig sEditConfig = new SimulatedEditConfig(String.valueOf(currentSessionId), storage);
-+ final SimulatedGet sGet = new SimulatedGet(String.valueOf(this.currentSessionId), storage,
-+ Optional.absent());
-+ final SimulatedEditConfig sEditConfig = new SimulatedEditConfig(String.valueOf(this.currentSessionId),
-+ storage);
- final SimulatedGetConfig sGetConfig = new SimulatedGetConfig(
-- String.valueOf(currentSessionId), storage, Optional.absent());
-- final SimulatedCommit sCommit = new SimulatedCommit(String.valueOf(currentSessionId));
-- final SimulatedLock sLock = new SimulatedLock(String.valueOf(currentSessionId));
-- final SimulatedUnLock sUnlock = new SimulatedUnLock(String.valueOf(currentSessionId));
-+ String.valueOf(this.currentSessionId), storage, Optional.absent());
-+ final SimulatedCommit sCommit = new SimulatedCommit(String.valueOf(this.currentSessionId));
-+ final SimulatedLock sLock = new SimulatedLock(String.valueOf(this.currentSessionId));
-+ final SimulatedUnLock sUnlock = new SimulatedUnLock(String.valueOf(this.currentSessionId));
- final SimulatedCreateSubscription sCreateSubs = new SimulatedCreateSubscription(
-- String.valueOf(currentSessionId), Optional.absent());
-+ String.valueOf(this.currentSessionId), Optional.absent());
- final SimulatedDiscardChanges sDiscardChanges = new SimulatedDiscardChanges(
-- String.valueOf(currentSessionId));
-+ String.valueOf(this.currentSessionId));
- return Sets.newHashSet(
- sGet, sGetConfig, sEditConfig, sCommit, sLock, sUnlock, sCreateSubs, sDiscardChanges);
- }
-diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java
-index e5b197d..92f71fc 100644
---- a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java
-+++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGet.java
-@@ -9,27 +9,62 @@
- package org.opendaylight.netconf.test.tool.rpc;
-
- import com.google.common.base.Optional;
-+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-+import java.io.File;
-+import java.io.IOException;
-+import java.util.Collections;
-+import java.util.List;
- import org.opendaylight.netconf.api.xml.XmlElement;
- import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
- import org.opendaylight.netconf.api.xml.XmlUtil;
- import org.opendaylight.netconf.util.mapping.AbstractLastNetconfOperation;
-+import org.slf4j.Logger;
-+import org.slf4j.LoggerFactory;
- import org.w3c.dom.Document;
- import org.w3c.dom.Element;
-+import org.xml.sax.SAXException;
-
- public class SimulatedGet extends AbstractLastNetconfOperation {
-
- private final DataList storage;
-+ private static final Logger LOG = LoggerFactory.getLogger(SimulatedGet.class);
-
-- public SimulatedGet(final String netconfSessionIdForReporting, final DataList storage) {
-+ public SimulatedGet(final String netconfSessionIdForReporting, final DataList storage,
-+ final Optional<File> initialConfigXMLFile) {
- super(netconfSessionIdForReporting);
-- this.storage = storage;
-+
-+ if (initialConfigXMLFile.isPresent()) {
-+ LOG.info("File is present: {}", initialConfigXMLFile.get().getName());
-+ this.storage = loadInitialConfigXMLFile(initialConfigXMLFile.get());
-+ } else {
-+ this.storage = storage;
-+ }
-+ }
-+
-+ @SuppressFBWarnings(value = "DLS_DEAD_LOCAL_STORE")
-+ private DataList loadInitialConfigXMLFile(final File file) {
-+ LOG.info("Loading initial config xml file: {}", file.getName());
-+ DataList configData = new DataList();
-+ List<XmlElement> xmlElementList = Collections.emptyList();
-+ try {
-+ Element element = XmlUtil.readXmlToElement(file);
-+ XmlElement xmlElement = XmlElement.fromDomElement(element);
-+ xmlElementList = xmlElement.getChildElements();
-+ configData.setConfigList(xmlElementList);
-+ } catch (IOException e) {
-+ LOG.info("IO exception loading xml file: {} ", e.getMessage());
-+
-+ } catch (SAXException e) {
-+ LOG.info("SAXException {}", e.getMessage());
-+ }
-+ return configData;
- }
-
- @Override
- protected Element handleWithNoSubsequentOperations(final Document document, final XmlElement operationElement) {
- final Element element = XmlUtil.createElement(document, XmlNetconfConstants.DATA_KEY, Optional.absent());
-
-- for (final XmlElement e : storage.getConfigList()) {
-+ for (final XmlElement e : this.storage.getConfigList()) {
- final Element domElement = e.getDomElement();
- element.appendChild(element.getOwnerDocument().importNode(domElement, true));
- }
-diff --git a/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConnectionPortTrail.java b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConnectionPortTrail.java
-new file mode 100644
-index 0000000..551eb71
---- /dev/null
-+++ b/netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/rpc/SimulatedGetConnectionPortTrail.java
-@@ -0,0 +1,42 @@
-+/*
-+ * Copyright (c) 2014 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
-+ */
-+package org.opendaylight.netconf.test.tool.rpc;
-+
-+import org.opendaylight.netconf.api.DocumentedException;
-+import org.opendaylight.netconf.api.xml.XmlElement;
-+import org.opendaylight.netconf.util.mapping.AbstractLastNetconfOperation;
-+import org.w3c.dom.Document;
-+import org.w3c.dom.Element;
-+
-+public class SimulatedGetConnectionPortTrail extends AbstractLastNetconfOperation {
-+
-+ public SimulatedGetConnectionPortTrail(final String netconfSessionIdForReporting) {
-+ super(netconfSessionIdForReporting);
-+ }
-+
-+ @Override
-+ protected Element handleWithNoSubsequentOperations(Document document, XmlElement operationElement)
-+ throws DocumentedException {
-+ Element portname = document.createElement("port-name");
-+ portname.appendChild(document.createTextNode("L1"));
-+ Element circuitpackname = document.createElement("circuit-pack-name");
-+ circuitpackname.appendChild(document.createTextNode("2/0"));
-+ Element ports = document.createElement("ports");
-+ ports.setAttribute("xmlns", "http://org/openroadm/device");
-+ ports.appendChild(portname);
-+ ports.appendChild(circuitpackname);
-+ return ports;
-+ }
-+
-+ @Override
-+ protected String getOperationName() {
-+ return "get-connection-port-trail";
-+ }
-+
-+
-+}
</span>
</OMS-attributes>
</link>
-<link xmlns="urn:ietf:params:xml:ns:yang:ietf-network-topology">
+<link xmlns="urn:ietf:params:xml:ns:yang:ietf-network-topology">
<link-id>OpenROADM-3-2-DEG3-to-OpenROADM-2-3-DEG3</link-id>
<opposite-link xmlns="http://org/openroadm/common/network">OpenROADM-2-3-DEG3-to-OpenROADM-3-2-DEG3</opposite-link>
<clfi xmlns="http://org/openroadm/common/network">fiber3223</clfi>
<link-id>OpenROADM-5-1-DEG1-to-OpenROADM-5-2-DEG1</link-id>
<opposite-link xmlns="http://org/openroadm/common/network">OpenROADM-5-2-DEG1-to-OpenROADM-5-1-DEG1</opposite-link>
<link-type xmlns="http://org/openroadm/common/network">ROADM-TO-ROADM</link-type>
- <source><source-node>OpenROADM-5-1-DEG1</source-node><source-tp>DEG1-TTP-TX</source-tp></source>
+ <source><source-node>OpenROADM-5-1-DEG1</source-node><source-tp>DEG1-TTP-TX</source-tp></source>
<destination><dest-node>OpenROADM-5-2-DEG1</dest-node><dest-tp>DEG1-TTP-RX</dest-tp></destination>
<administrative-state xmlns="http://org/openroadm/common/network">inService</administrative-state>
<operational-state xmlns="http://org/openroadm/common/network">inService</operational-state>
</span>
</OMS-attributes>
</link>
-<link xmlns="urn:ietf:params:xml:ns:yang:ietf-network-topology">
+<link xmlns="urn:ietf:params:xml:ns:yang:ietf-network-topology">
<link-id>OpenROADM-5-1-DEG3-to-OpenROADM-4-2-DEG3</link-id>
<opposite-link xmlns="http://org/openroadm/common/network">OpenROADM-4-2-DEG3-to-OpenROADM-5-1-DEG3</opposite-link>
<link-type xmlns="http://org/openroadm/common/network">ROADM-TO-ROADM</link-type>
<supported-interface-capability xmlns:x="http://org/openroadm/port/types">x:if-OCH</supported-interface-capability>
</ports>
</circuit-packs>
- <circuit-packs>
+ <circuit-packs>
<is-pluggable-optics>true</is-pluggable-optics>
<circuit-pack-name>1/0/ETH-PLUG</circuit-pack-name>
<circuit-pack-type>port</circuit-pack-type>
<name>OMS-DEG2-TTP-TXRX</name>
<supporting-circuit-pack-name>2/0</supporting-circuit-pack-name>
<supporting-port>L1</supporting-port>
- <supporting-interface>OTS-DEG2-TTP-TXRX</supporting-interface>
- <type xmlns:openROADM-if="http://org/openroadm/interfaces">openROADM-if:openROADMOpticalMultiplex</type>
- <description>TBD</description>
+ <supporting-interface>OTS-DEG2-TTP-TXRX</supporting-interface>
+ <type xmlns:openROADM-if="http://org/openroadm/interfaces">openROADM-if:openROADMOpticalMultiplex</type>
+ <description>TBD</description>
<circuit-id>TBD</circuit-id>
<operational-state>inService</operational-state>
- <administrative-state>inService</administrative-state>
+ <administrative-state>inService</administrative-state>
</interface>
<protocols>
<name>OMS-DEG1-TTP-TXRX</name>
<supporting-circuit-pack-name>1/0</supporting-circuit-pack-name>
<supporting-port>L1</supporting-port>
- <supporting-interface>OTS-DEG1-TTP-TXRX</supporting-interface>
- <type xmlns:openROADM-if="http://org/openroadm/interfaces">openROADM-if:openROADMOpticalMultiplex</type>
- <description>TBD</description>
+ <supporting-interface>OTS-DEG1-TTP-TXRX</supporting-interface>
+ <type xmlns:openROADM-if="http://org/openroadm/interfaces">openROADM-if:openROADMOpticalMultiplex</type>
+ <description>TBD</description>
<circuit-id>TBD</circuit-id>
<operational-state>inService</operational-state>
- <administrative-state>inService</administrative-state>
+ <administrative-state>inService</administrative-state>
</interface>
<protocols>
<slot-name>CP3-S10</slot-name>
<label>CP3S10</label>
</cp-slots>
- <cp-slots>
+ <cp-slots>
<slot-name>CP3-S11</slot-name>
<label>CP3S11</label>
</cp-slots>
<slot-name>CP3-S20</slot-name>
<label>CP3S20</label>
</cp-slots>
- <cp-slots>
+ <cp-slots>
<slot-name>CP3-S21</slot-name>
<label>CP3S21</label>
</cp-slots>
<slot-name>CP3-S30</slot-name>
<label>CP3S30</label>
</cp-slots>
- <cp-slots>
+ <cp-slots>
<slot-name>CP3-S31</slot-name>
<label>CP3S31</label>
</cp-slots>
<slot-name>CP3-S40</slot-name>
<label>CP3S40</label>
</cp-slots>
- <cp-slots>
+ <cp-slots>
<slot-name>CP3-S41</slot-name>
<label>CP3S41</label>
</cp-slots>
<slot-name>CP3-S50</slot-name>
<label>CP3S50</label>
</cp-slots>
- <cp-slots>
+ <cp-slots>
<slot-name>CP3-S51</slot-name>
<label>CP3S51</label>
</cp-slots>
<slot-name>CP3-S60</slot-name>
<label>CP3S60</label>
</cp-slots>
- <cp-slots>
+ <cp-slots>
<slot-name>CP3-S61</slot-name>
<label>CP3S61</label>
</cp-slots>
<slot-name>CP3-S70</slot-name>
<label>CP3S70</label>
</cp-slots>
- <cp-slots>
+ <cp-slots>
<slot-name>CP3-S71</slot-name>
<label>CP3S71</label>
</cp-slots>
<eqpt-srg-id>6</eqpt-srg-id>
</xpdr-port>
</xponder>
- <xponder>
+ <xponder>
<xpdr-number>3</xpdr-number>
<xpdr-type>mpdr</xpdr-type>
<xpdr-port>
</port-list>
</non-blocking-list>
</odu-switching-pools>
- <odu-switching-pools>
+ <odu-switching-pools>
<switching-pool-number>3</switching-pool-number>
<switching-pool-type xmlns:org-openroadm-switching-pool-types="http://org/openroadm/switching-pool-types">non-blocking</switching-pool-type>
<non-blocking-list>
<slot-name>CP3-S0</slot-name>
</pluggable-optics-holder-list>
</non-blocking-list>
- <non-blocking-list>
+ <non-blocking-list>
<nbl-number>11</nbl-number>
<interconnect-bandwidth-unit>1000000000</interconnect-bandwidth-unit>
<interconnect-bandwidth>0</interconnect-bandwidth>
<slot-name>CP3-S0</slot-name>
</pluggable-optics-holder-list>
</non-blocking-list>
- <non-blocking-list>
+ <non-blocking-list>
<nbl-number>21</nbl-number>
<interconnect-bandwidth-unit>1000000000</interconnect-bandwidth-unit>
<interconnect-bandwidth>0</interconnect-bandwidth>
<slot-name>CP3-S0</slot-name>
</pluggable-optics-holder-list>
</non-blocking-list>
- <non-blocking-list>
+ <non-blocking-list>
<nbl-number>31</nbl-number>
<interconnect-bandwidth-unit>1000000000</interconnect-bandwidth-unit>
<interconnect-bandwidth>0</interconnect-bandwidth>
<slot-name>CP3-S0</slot-name>
</pluggable-optics-holder-list>
</non-blocking-list>
- <non-blocking-list>
+ <non-blocking-list>
<nbl-number>41</nbl-number>
<interconnect-bandwidth-unit>1000000000</interconnect-bandwidth-unit>
<interconnect-bandwidth>0</interconnect-bandwidth>
<slot-name>CP3-S0</slot-name>
</pluggable-optics-holder-list>
</non-blocking-list>
- <non-blocking-list>
+ <non-blocking-list>
<nbl-number>51</nbl-number>
<interconnect-bandwidth-unit>1000000000</interconnect-bandwidth-unit>
<interconnect-bandwidth>0</interconnect-bandwidth>
<slot-name>CP3-S0</slot-name>
</pluggable-optics-holder-list>
</non-blocking-list>
- <non-blocking-list>
+ <non-blocking-list>
<nbl-number>61</nbl-number>
<interconnect-bandwidth-unit>1000000000</interconnect-bandwidth-unit>
<interconnect-bandwidth>0</interconnect-bandwidth>
<slot-name>CP3-S0</slot-name>
</pluggable-optics-holder-list>
</non-blocking-list>
- <non-blocking-list>
+ <non-blocking-list>
<nbl-number>71</nbl-number>
<interconnect-bandwidth-unit>1000000000</interconnect-bandwidth-unit>
<interconnect-bandwidth>0</interconnect-bandwidth>
docs
docs-linkcheck
checkbashisms
+ pre-commit
+ gitlint
skipsdist = true
setupdir = tests/
commands =
pyang --version
sh -c 'find ../api/ -name target -prune -o -name *.yang -print | while read -r fname; do pyang -f yang --yang-canonical --yang-remove-unused-imports --max-line-length=120 --keep-comments -p../api/src/main/yang/:../ordmodels/common/src/main/yang/:../ordmodels/service/src/main/yang/:../tapimodels/src/main/yang/ "$fname" -o /tmp/tmpfile.$$ && mv /tmp/tmpfile.$$ "$fname";done'
+
+[testenv:pre-commit-install]
+basepython = python3
+deps = pre-commit
+commands =
+ pre-commit install
+ pre-commit install --hook-type commit-msg
+
+[testenv:pre-commit-uninstall]
+basepython = python3
+deps = pre-commit
+commands =
+ pre-commit uninstall
+ pre-commit uninstall --hook-type commit-msg
+
+[testenv:pre-commit]
+basepython = python3
+deps = pre-commit
+passenv = HOME
+commands =
+ pre-commit run --all-files --show-diff-on-failure
+ pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
+ # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage.
+ # Its default arguments --passed and --msg-filename are different from CI recommandations.
+ # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.
+ # A dedicated gitlint profile for CI is proposed below. Also to behave fine locally, this profile must have access
+ # to the HOME variable so that Gitlint can retrieve Git user settings.
+
+[testenv:gitlint]
+basepython = python3
+deps = gitlint
+commands =
+ gitlint
+