Introduction

Perform complex operations on netconf.

Copyright (c) 2015,2017 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

This library encapsulates a bunch of somewhat complex and commonly used netconf operations into reusable keywords to make writing netconf test suites easier.

TODO: RemoteBash.robot contains logic which could be reused here.

Keywords

Arguments

device_name session
= default
log_response
= True

Documentation

Check that the specified device has no Netconf connectors nor associated data.

Arguments

device_name session
= default
log_response
= True

Documentation

Check that the specified device is accessible from Netconf.

Arguments

current_name log_response
= True

Documentation

Operation for making sure the device is really deconfigured.

Arguments

device_name session
= default

Documentation

Check that there are no instances of the specified device in the Netconf topology.

Arguments

device-number

Documentation

Query netstat on remote machine whether testtool device with the specified number has its port open and fail if not.

Arguments

current_name log_response
= True

Documentation

Operation for configuring the device.

Arguments

current_name log_response
= True

Documentation

Operation for configuring the device in the Netconf subsystem and connecting to it.

Arguments

device_name device_type
= default
device_port
= ${FIRST_TESTTOOL_PORT}
device_address
= ${TOOLS_SYSTEM_IP}
device_user
= admin
device_password
= topsecret
device_key
= device-key
session
= default
schema_directory
= /tmp/schema
http_timeout
= ${EMPTY}
http_method
= put

Documentation

Tell Netconf about the specified device so it can add it into its configuration.

Arguments

device_name session
= default

Documentation

Count all instances of the specified device in the Netconf topology (usually 0 or 1).

Arguments

current_name log_response
= True

Documentation

Operation for deconfiguring the device.

Arguments

current_name log_response
= True

Documentation

Operation for deconfiguring the device from Netconf.

Arguments

controller_ip

Documentation

Sets the config for using SSE (Server Side Events) to false. Note that this keyword only changes the config. A controller restart is needed for the config to to take effect.

Arguments

controller_ip

Documentation

Sets the config for using SSE (Server Side Events) to true. Note that this keyword only changes the config. A controller restart is needed for the config to to take effect.

Arguments

device-count
= 10
debug
= true
schemas
= none
rpc_config
= none
tool_options
= ${EMPTY}
java_options
= ${TESTTOOL_DEFAULT_JAVA_OPTIONS}
mdsal
= true
log_response
= True

Documentation

Install and run testtool.

Arguments

schemas

Documentation

Internal keyword for Install_And_Start_TestTool This deploys the additional schemas if any and returns a command line argument to be added to the testtool commandline to tell it to load them. While this code could be integrated into its only user, I considered the resulting code to be too unreadable as the actions are quite different in the two possibilities (additional schemas present versus no additional schemas present), therefore a separate keyword is used.

Arguments

rpc_config

Documentation

Internal keyword for Install_And_Start_TestTool This deploys the optional custom rpc file. Drop out of the keyword, returning no command line argument when there is no rpc file to deploy.

Arguments

operation deadline_Date log_response
= True

Arguments

device_name log_response
= True

Arguments

operation count
= ${NetconfKeywords__testtool_device_count}
timeout
= 45m
log_response
= True

Arguments

device_name session
= default
location
= location

Documentation

Tell Netconf to deconfigure the specified device

Arguments

create_session_for_templated_requests
= True

Documentation

Setup the environment for the other keywords of this Resource to work properly.

Arguments

filename device-count
= 10
debug
= true
schemas
= none
rpc_config
= none
tool_options
= ${EMPTY}
java_options
= ${TESTTOOL_DEFAULT_JAVA_OPTIONS}
mdsal
= true
log_response
= True

Documentation

Arrange to collect tool's output into a log file. Will use specific ${schemas} unless argument resolves to 'none', which signifies that there are no additional schemas to be deployed. If so the directory for the additional schemas is deleted on the remote machine and the additional schemas argument is left out.

Documentation

Stop testtool and download its log.

Arguments

current_name log_response
= True

Documentation

Operation for waiting until the device is connected.

Arguments

device_name timeout
= 20s
period
= 1s
session
= default
log_response
= True

Documentation

Wait for the device to become connected. It is more readable to use this keyword in a test case than to put the whole WUKS below into it.

Arguments

device_name timeout
= 10s
period
= 1s
session
= default
log_response
= True

Documentation

Wait until all netconf connectors for the device with the given name disappear. Call of Remove_Device_From_Netconf returns before netconf gets around deleting the device's connector. To ensure the device is really gone from netconf, use this keyword to make sure all connectors disappear. If a call to Remove_Device_From_Netconf is not made before using this keyword, the wait will fail. Using this keyword is more readable than putting the WUKS below into a test case.

NetconfKeywords

image/svg+xml