Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP | Consolidating fabric operations related methods #56

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Apr 5, 2016

  1. Use ssh agent to connect between remote machines

    Current method - copy ssh private key to remote node1 and then try to
    ssh using that key file - is not required, as ssh-agent forwarding will
    enable such facility without ssh private keys present in subsequent
    machines. You just need private key on test node and no need to copy
    private key to anywhere else, just run ssh-agent on test node and run
    the command on remote nodes (even between remote nodes with agent
    forwarding enabled.
    
    Added tools/common.sh with common bash functions.
    Added a new function "prepare"  and also added a new
    parameter to run only "prepare". This will be helpful in case of
    manually running tests which actually need running tools/configure.py as
    well as starting ssh-agent on test node.
    hkumarmk committed Apr 5, 2016
    Configuration menu
    Copy the full SHA
    2bfeb4e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    af10d14 View commit details
    Browse the repository at this point in the history
  3. Moved fabric related methods to tcuils.fabutils

    This is to refactor certain common code to central place and to reuse
    them. Current effort is to consolidate methods which use fabric
    operations to single place and avoid importing fabric module to various
    other files but to use the methods from fabutils.
    hkumarmk committed Apr 5, 2016
    Configuration menu
    Copy the full SHA
    f57a512 View commit details
    Browse the repository at this point in the history
  4. Renamed run_cmd_through_node to run_cmd to use it in wider usecases

    This method to be used to run command on any remote nodes - whether it
    is a remote server or VM or between VMs. This method has capability to
    handle:
    
    1. run remote command on remote server from test node
    2. Run remote command on node-a through node-b from the test node
      * in this case node-a is the target node, node-b is gateway, and the
    nodes will be connect from testnode
      * This is to avoid situation to login to remote node (node-b in this
        case) and run script (fab script or pexpect or any such code) on
        that remote node (node-b) against running command on target node
        (node-a)
    3. Run remote command on VM thorugh compute node - Same usecase as of Juniper#2
    4. Run remote commands between VMs - say copy a file from vm1 to vm2
    through compute node of vm1.
      * This will use ssh-agent forward to avoid copying ssh private keys to
        subsequent servers - Previously we used to copy ssh private keys to
        compute node and then copy the same file to vm1 in order to be able
        to connect from vm1 to vm2.
      * The commands will be running sitting on the test node then run an
      * "ssh/scp" command on vm1 through compute node of vm1 with
        agent_forward on
      * in this case flow is like this: test_node ->
        compute_of_vm1(gateway - passthrough) -> vm1 (run ssh/scp there) ->
        vm2 (final command is run)
    
    NOTE that in all above situations ssh is initiated from the test node
    and NO NEED TO SSH TO ANY OTHER NODE AND RUN SSH/FAB COMMANDS FROM
    THERE.
    hkumarmk committed Apr 5, 2016
    Configuration menu
    Copy the full SHA
    95a82df View commit details
    Browse the repository at this point in the history
  5. Replace run_fab_cmd_on_node with run_cmd

    Removed run_fab_cmd_on_node from the codebase and replaced all
    occurances of it with run_cmd.
    hkumarmk committed Apr 5, 2016
    Configuration menu
    Copy the full SHA
    ec1833a View commit details
    Browse the repository at this point in the history