Actions.ExampleActions package

Submodules

Actions.ExampleActions.example_actions module

Copyright 2017, Fujitsu Network Communications, Inc. 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.

class Actions.ExampleActions.example_actions.CliActions[source]

Bases: object

” Default __init__ field must be used when using classes for keywords

connect_ssh(system_name, session_name=None, expected_prompt='.*')[source]

KEYWORD DOCUMENTATION: A recommended style for keyword documentation is given below Connects to the ssh port of the the given system or subsystems

Datafile usage:

Tags or attributes to be used in input datafile for the system or subsystem If both tag and attribute is provided the attribute will be used.

  1. ip = IP address of the system/subsystem
  2. username = username for the ssh session
  3. password = password for the ssh session
  4. timeout = use if you want to set timeout while connecting
  5. prompt = the prompt expected when the connection is successful
  6. ssh_port = use this tag to provide a ssh port to connect to, if not provided default ssh port 22 will be used.
Arguments:
  1. system_name (string) = This can be name of the system or a subsystem.

    To connect to a system provided system_name=system_name.

    To connect to a single subsystem provide system_name=system_name[subsystem_name].

    To connect to multiple subsystems provide system_name=system_name[subsystem1_name,subsystem2_name..etc..].

    To connect to all subsystems under a system provide system_name=”system_name[all]”.

  2. session_name(string) = name of the session to the system/subsystem.

  3. prompt(string) = prompt expected in the terminal

  4. int_timeout(int) = use this to set timeout value for commands issued in this session.

Returns:
  1. status(bool)= True / False.
  2. session_id (dict element)= an id is generated for each connection and each connection is stored in the framework’s data_repository. session_id=system_name+subsystem_name+session_name.
  3. response dictionary(dict): an empty dictionary to store the responses of all commands sent to the particular system or subsystem. This dictionary is available in warrior frameworks global data_repository and can be retrieved using the key= “session_id + _td_response”.

Module contents

Copyright 2017, Fujitsu Network Communications, Inc. 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.