aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
AgeCommit message (Expand)AuthorFilesLines
2021-06-02Add maven profiles and testsuite for helm validatorRemigiusz Janeczek1-1/+9
2020-10-08Update READMEsebdet1-52/+102
2020-06-10Add build config in READMEsebdet1-1/+3
2019-06-30Highlight Windows-specific partskaihlavi1-3/+4
2019-06-23Fix minor documentation issueskaihlavi1-35/+35
2018-09-17Updated readme fileIdan Amit1-141/+107
2018-04-09Fix Docker file pathVictor Morales1-3/+3
2017-09-07readme.md for sdc-simulatorTal Gitelman1-5/+54
2017-02-19Initial OpenECOMP SDC commitMichael Lando1-0/+165
: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
*** Settings ***
Documentation     Some handy Keywords for accessing log files over SSH.  Assumptions are that logs will belong to users other than the currently logged in user and that sudo will be required
Library           OperatingSystem
Library         SSHLibrary
Library           HttpLibrary.HTTP
Library           String
Library           Collections

*** Variables ***

*** Keywords ***
Open Connection And Log In
   [Documentation]    Open a connection using the passed user and SSH key. Connection alias will be the host name by default.
   [Arguments]    ${HOST}    ${user}    ${pvt}    ${password}=    ${alias}=${HOST}    ${timeout}=120s
   Open Connection    ${HOST}    alias=${alias}    timeout=${timeout}
   Login With Public Key    ${user}    ${pvt}    password=${password}    delay=0.5 seconds

Grep Local File
    [Documentation]     Grep the passed file name and return all of the lines that match the passed pattern using the current connection
    [Arguments]    ${pattern}     ${fullpath}
    ${output}=    Execute Command    grep ${pattern} ${fullpath}
    [Return]     ${output}

 Grep File on Host
    [Documentation]     Grep the passed file name and return all of the lines that match the passed pattern using passed connection alias/host
    [Arguments]     ${host}    ${pattern}     ${fullpath}
    Switch Connection    ${host}
    ${output}=    Grep Local File    ${pattern}    ${fullpath}
    @{lines}=    Split To Lines    ${output}
    [Return]     @{lines}

Grep File on Hosts
    [Documentation]     Grep the passed file name and return all of the lines that match the passed pattern using passed list of connections
    [Arguments]    ${HOSTS}    ${pattern}    ${fullpath}
    &{map}=    Create Dictionary
    :FOR    ${HOST}    IN    @{HOSTS}
    \    Log    ${HOST}
    \    @{lines}=    Grep File on Host    ${HOST}   ${pattern}    ${fullpath}
    \    &{map}=    Create Dictionary    ${HOST}=@{lines}    &{map}
    [Return]    &{map}

Tail File on Host Until
    [Documentation]     Tail log file into grep which returns file lines containing the grep pattern. Will timeout after timeout= if expected pattern not received.
    [Arguments]    ${host}    ${pattern}    ${fullpath}    ${expected}    ${timeout}=60    ${options}=-c -0
    Switch Connection    ${host}
    ${tailcommand}=    Catenate    tail ${options} -f ${fullpath} | grep --color=never ${pattern}
    Write    ${tailcommand}
    ${stdout}=  Read Until Regexp    ${expected}
    @{lines}=    Split To Lines    ${stdout}
    [Return]    @{lines}