Scalability of VMs in COE 72/75172/44
authorKarthika Panneer <karthikapaneer97@gmail.com>
Mon, 13 Aug 2018 15:21:43 +0000 (08:21 -0700)
committerJamo Luhrsen <jluhrsen@redhat.com>
Tue, 6 Nov 2018 01:00:43 +0000 (01:00 +0000)
To increase the number of nodes and check
how many pods can be brought up on
the nodes.

Change-Id: I63a067c258b32e39b3a1086b4c0c2ae5a3716da0
Signed-off-by: Karthika Panneer <karthikapaneer97@gmail.com>
csit/libraries/Coe.robot
csit/scripts/set_unique_node_uuid.sh
csit/suites/coe/Pods_Basic_Connectivity_Tests.robot
csit/suites/coe/Pods_Scalability_Tests.robot
csit/variables/coe/coe_play.yaml
csit/variables/coe/hosts.yaml
csit/variables/coe/minions_template.yaml [new file with mode: 0644]

index 7bb457cb1b53eb5f040170403d48194c5d001291..2757158ffba13148bda1c45d7a6da7c1f030abd0 100644 (file)
@@ -12,6 +12,7 @@ Resource          ../variables/Variables.robot
 Resource          VpnOperations.robot
 Variables         ../variables/coe/Modules.py
 Variables         ../variables/netvirt/Modules.py
+Resource          ToolsSystem.robot
 
 *** Variables ***
 ${BUSY_BOX}       ${CURDIR}/../variables/coe/busy-box.yaml
@@ -22,74 +23,105 @@ ${HOST_INVENTORY}    ${CURDIR}/../variables/coe/hosts.yaml
 ${K8s_MASTER_IP}    ${TOOLS_SYSTEM_1_IP}
 ${K8s_MINION1_IP}    ${TOOLS_SYSTEM_2_IP}
 ${K8s_MINION2_IP}    ${TOOLS_SYSTEM_3_IP}
+${K8s_MINION3_IP}    ${TOOLS_SYSTEM_4_IP}
+${K8s_MINION4_IP}    ${TOOLS_SYSTEM_5_IP}
+${HOSTS_FILE_TEMPLATE}    ${CURDIR}/../variables/coe/minions_template.yaml
 ${NODE_READY_STATUS}    \\sReady
-${PLAYBOOK}       ${CURDIR}/../variables/coe/coe_play.yaml
+${PLAYBOOK_FILE}    ${CURDIR}/../variables/coe/coe_play.yaml
 ${POD_RUNNING_STATUS}    \\sRunning
+${VARIABLES_PATH}    ${CURDIR}/../variables/coe
 ${WATCHER_COE}    ${CURDIR}/../variables/coe/coe.yaml
-@{NODE_IPs}       ${K8s_MASTER_IP}    ${K8s_MINION1_IP}    ${K8s_MINION2_IP}
+@{NODE_IPs}       ${K8s_MASTER_IP}    ${K8s_MINION1_IP}    ${K8s_MINION2_IP}    ${K8s_MINION3_IP}    ${K8s_MINION4_IP}
 @{COE_DIAG_SERVICES}    OPENFLOW    IFM    ITM    DATASTORE    ELAN    OVSDB
-${VARIABLES_PATH}    ${CURDIR}/../variables/coe
 
 *** Keywords ***
+Coe Suite Setup
+    [Documentation]    COE project requires start suite to be executed only for the first test suite.This keyword find the current suite,compares it with the stored first suite value and executes Coe.Start suite only if the cuurent suite is equal to the first suite.
+    ToolsSystem.Get Tools System Nodes Data
+    Coe.Set Connection ids and Bridge
+    ${current suite}    ${suite names updated}    Extract current suite name
+    ${first_suite} =    Set Variable    ${suite names updated[0]}
+    ${status} =    BuiltIn.Evaluate    '${first_suite}' == '${current suite}'
+    Run Keyword If    '${status}' == 'True'    Coe.Start Suite
+
 Start Suite
     [Documentation]    Suite setup keyword.
     Coe.Configuration Playbook
-    Coe.Set Connection ids and Bridge
     Coe.Verify Config Files
     Coe.Verify Watcher Is Running
     BuiltIn.Wait Until Keyword Succeeds    40s    2s    Coe.Check Node Status Is Ready
     Coe.Label Nodes
     BuiltIn.Wait Until Keyword Succeeds    60    2    ClusterManagement.Check Status Of Services Is OPERATIONAL    @{COE_DIAG_SERVICES}
-    Genius.Verify Tunnel Status as UP    default-transport-zone
+    BuiltIn.Wait Until Keyword Succeeds    85    2    Genius.Verify Tunnel Status as UP    default-transport-zone
     Coe.Derive Coe Data Models
 
+Set Connection ids and Bridge
+    [Documentation]    Sets the connection ids for all the nodes and get the bridge from configuration file .
+    : FOR    ${conn_id}    IN    @{TOOLS_SYSTEM_ALL_CONN_IDS}
+    \    SSHLibrary.Switch Connection    ${conn_id}
+    \    SSHKeywords.Flexible_SSH_Login    ${DEFAULT_USER}    ${DEFAULT_PASSWORD}
+    ${file} =    OperatingSystem.Get File    ${CONFIG_FILE_TEMPLATE}
+    ${ovs bridge output}    ${bridge} =    Should Match Regexp    ${file}    "ovsBridge": "(\\w.*)"
+    Set Suite Variable    ${bridge}
+
 Configuration Playbook
     [Documentation]    Ansible playbook which does all basic configuration for kubernetes nodes.
-    ${hosts} =    OperatingSystem.Get File    ${HOST_INVENTORY}
-    ${hosts} =    String.Replace String    ${hosts}    master_ip    ${K8s_MASTER_IP}
-    ${hosts} =    String.Replace String    ${hosts}    minion1_ip    ${K8s_MINION1_IP}
-    ${hosts} =    String.Replace String    ${hosts}    minion2_ip    ${K8s_MINION2_IP}
-    ${hosts} =    String.Replace String    ${hosts}    odl_ip    ${ODL_SYSTEM_IP}
-    ${hosts} =    String.Replace String    ${hosts}    mport    ${OVSDBPORT}
-    ${hosts} =    String.Replace String    ${hosts}    cport    ${ODL_OF_PORT_6653}
-    ${hosts} =    String.Replace String    ${hosts}    filepath    ${CONFIG_FILE_TEMPLATE}
-    ${hosts} =    String.Replace String    ${hosts}    yamlpath    ${USER_HOME}/coe.yaml
-    OperatingSystem.Create File    ${USER_HOME}/hosts.yaml    ${hosts}
+    ${playbook minions}    ${playbook hosts}    ${host file}    Modifying templates in playbook
+    ${playbook} =    OperatingSystem.Get File    ${PLAYBOOK_FILE}
+    ${playbook} =    String.Replace String    ${playbook}    coe-hosts    ${playbook hosts}
+    ${playbook} =    String.Replace String    ${playbook}    coe-minions    ${playbook minions}
+    OperatingSystem.Create File    ${PLAYBOOK_FILE}    ${playbook}
+    OperatingSystem.Create File    ${USER_HOME}/hosts.yaml    ${host file}
     ${watcher} =    OperatingSystem.Get File    ${WATCHER_COE}
     ${watcher} =    String.Replace String    ${watcher}    odlip    ${ODL_SYSTEM_IP}
     ${watcher} =    String.Replace String    ${watcher}    port    ${RESTCONFPORT}
     OperatingSystem.Create File    ${WATCHER_COE}    ${watcher}
     SSHKeywords.Copy_File_To_Remote_System    ${K8s_MASTER_IP}    ${WATCHER_COE}    ${USER_HOME}
-    OperatingSystem.Copy File    ${PLAYBOOK}    ${USER_HOME}
+    OperatingSystem.Copy File    ${PLAYBOOK_FILE}    ${USER_HOME}
     ${play_output} =    OperatingSystem.Run    ansible-playbook ${USER_HOME}/coe_play.yaml -i ${USER_HOME}/hosts.yaml
     BuiltIn.Log    ${play_output}
 
-Set Connection ids and Bridge
-    [Documentation]    Sets the connection ids for all the nodes and get the bridge from configuration file .
-    ${conn_id_1} =    SSHLibrary.Open Connection    ${K8s_MASTER_IP}
-    SSHKeywords.Flexible_SSH_Login    ${DEFAULT_USER}    ${DEFAULT_PASSWORD}
-    BuiltIn.Set Global Variable    ${conn_id_1}
-    ${conn_id_2} =    SSHLibrary.Open Connection    ${K8s_MINION1_IP}
-    SSHKeywords.Flexible_SSH_Login    ${DEFAULT_USER}    ${DEFAULT_PASSWORD}
-    BuiltIn.Set Global Variable    ${conn_id_2}
-    ${conn_id_3} =    SSHLibrary.Open Connection    ${K8s_MINION2_IP}
-    SSHKeywords.Flexible_SSH_Login    ${DEFAULT_USER}    ${DEFAULT_PASSWORD}
-    BuiltIn.Set Global Variable    ${conn_id_3}
-    ${file} =    OperatingSystem.Get File    ${CONFIG_FILE_TEMPLATE}
-    ${line}    ${bridge} =    Should Match Regexp    ${file}    "ovsBridge": "(\\w.*)"
-    BuiltIn.Set Global Variable    ${bridge}
+Modifying templates in playbook
+    ${inventory} =    OperatingSystem.Get File    ${HOST_INVENTORY}
+    ${template} =    OperatingSystem.Get File    ${HOSTS_FILE_TEMPLATE}
+    ${template} =    String.Replace String    ${template}    minion_ip    ${TOOLS_SYSTEM_ALL_IPS[0]}
+    @{minions}    Create List    coe-minion
+    ${hosts}    Set Variable    coe-master:
+    : FOR    ${i}    INRANGE    1    ${NUM_TOOLS_SYSTEM}
+    \    Append To List    ${minions}    coe-minion${i}
+    \    ${hosts} =    Catenate    ${hosts}    coe-minion${i}:
+    ${hosts} =    Replace String Using Regexp    ${hosts}    :$    ${EMPTY}
+    ${hosts} =    Remove Space on String    ${hosts}
+    ${minion hosts} =    Replace String Using Regexp    ${hosts}    ^[\\w-]+:    ${EMPTY}
+    : FOR    ${i}    INRANGE    1    ${NUM_TOOLS_SYSTEM}
+    \    ${j} =    Evaluate    ${i}+1
+    \    ${template} =    String.Replace String    ${template}    ${minions[${i}-1]}    ${minions[${i}]}
+    \    ${template} =    String.Replace String    ${template}    ${TOOLS_SYSTEM_ALL_IPS[${i}-1]}    ${TOOLS_SYSTEM_ALL_IPS[${i}]}
+    \    ${template} =    String.Replace String    ${template}    192.168.50.1${i}    192.168.50.1${j}
+    \    ${template} =    String.Replace String    ${template}    10.11.${i}.0/24    10.11.${j}.0/24
+    \    ${template} =    String.Replace String    ${template}    10.11.${i}.1    10.11.${j}.1
+    \    Append To File    ${HOST_INVENTORY}    ${template}
+    ${host file} =    OperatingSystem.Get File    ${HOST_INVENTORY}
+    ${host file} =    String.Replace String    ${host file}    master_ip    ${TOOLS_SYSTEM_ALL_IPS[0]}
+    ${host file} =    String.Replace String    ${host file}    odl_ip    ${ODL_SYSTEM_IP}
+    ${host file} =    String.Replace String    ${host file}    mport    ${OVSDBPORT}
+    ${host file} =    String.Replace String    ${host file}    cport    ${ODL_OF_PORT_6653}
+    ${host file} =    String.Replace String    ${host file}    filepath    ${CONFIG_FILE_TEMPLATE}
+    ${host file} =    String.Replace String    ${host file}    yamlpath    ${USER_HOME}/coe.yaml
+    log    ${host file}
+    [Return]    ${minion hosts}    ${hosts}    ${host file}
 
 Verify Config Files
     [Documentation]    Checks if the configuration files are present in all nodes
-    : FOR    ${nodes}    IN    @{NODE_IPs}
+    : FOR    ${nodes}    IN    @{TOOLS_SYSTEM_ALL_IPS}
     \    Utils.Verify File Exists On Remote System    ${nodes}    ${CONFIG_FILE}
-    : FOR    ${nodes}    IN    @{NODE_IPs}
+    : FOR    ${nodes}    IN    @{TOOLS_SYSTEM_ALL_IPS}
     \    Utils.Verify File Exists On Remote System    ${nodes}    ${CNI_BINARY_FILE}
 
 Verify Watcher Is Running
     [Documentation]    Checks if watcher is running in the background
-    ${lines} =    Utils.Run Command On Remote System    ${K8s_MASTER_IP}    ps -ef | grep watcher
-    BuiltIn.Should Match Regexp    ${lines}    .* watcher odl
+    ${watcher status} =    Utils.Run Command On Remote System    ${K8s_MASTER_IP}    ps -ef | grep watcher
+    BuiltIn.Should Match Regexp    ${watcher status}    .* watcher odl
 
 Check Node Status Is Ready
     [Documentation]    Checks the status of nodes.This keyword is repeated until the status of all nodes is Ready
@@ -100,13 +132,13 @@ Check Node Status Is Ready
 
 Label Nodes
     [Documentation]    Create labels for minions so that random allocation of pods to minions is avoided
-    ${nodes} =    Utils.Run Command On Remote System    ${K8s_MASTER_IP}    kubectl get nodes
-    ${node_1} =    String.Get Line    ${nodes}    2
-    ${minion_1} =    BuiltIn.Should Match Regexp    ${node_1}    ^\\w+-.*-\\d+
-    ${node_2} =    String.Get Line    ${nodes}    3
-    ${minion_2} =    BuiltIn.Should Match Regexp    ${node_2}    ^\\w+-.*-\\d+
-    Utils.Run Command On Remote System And Log    ${K8s_MASTER_IP}    kubectl label nodes ${minion_1} disktype=ssd
-    Utils.Run Command On Remote System And Log    ${K8s_MASTER_IP}    kubectl label nodes ${minion_2} disktype=ssl
+    ${i} =    BuiltIn.Set Variable    1
+    ${get nodes} =    Utils.Run Command On Remote System And Log    ${K8s_MASTER_IP}    kubectl get nodes
+    @{get nodes} =    String.Split To Lines    ${get nodes}    2
+    : FOR    ${status}    IN    @{get nodes}
+    \    ${minion} =    BuiltIn.Should Match Regexp    ${status}    ^\\w+-.*-\\d+
+    \    Utils.Run Command On Remote System And Log    ${K8s_MASTER_IP}    kubectl label nodes ${minion} disktype=ss${i}
+    \    ${i} =    BuiltIn.Evaluate    ${i}+1
     Utils.Run Command On Remote System And Log    ${K8s_MASTER_IP}    kubectl get nodes --show-labels
 
 Derive Coe Data Models
@@ -123,9 +155,8 @@ Check Pod Status Is Running
 
 Tear Down
     [Documentation]    Test teardown to get dumpflows,ovsconfig,model dump,node status,pod status and to dump config files \ and delete pods.
-    OVSDB.Get DumpFlows And Ovsconfig    ${conn_id_1}    ${bridge}
-    OVSDB.Get DumpFlows And Ovsconfig    ${conn_id_2}    ${bridge}
-    OVSDB.Get DumpFlows And Ovsconfig    ${conn_id_3}    ${bridge}
+    : FOR    ${conn_id}    IN    @{TOOLS_SYSTEM_ALL_CONN_IDS}
+    \    OVSDB.Get DumpFlows And Ovsconfig    ${conn_id}    ${bridge}
     BuiltIn.Run Keyword And Ignore Error    DataModels.Get Model Dump    ${ODL_SYSTEM_IP}    ${coe_data_models}
     Coe.DumpConfig File
     Utils.Run Command On Remote System And Log    ${K8s_MASTER_IP}    kubectl get nodes    ${DEFAULT_USER}    ${DEFAULT_PASSWORD}    ${DEFAULT_LINUX_PROMPT_STRICT}
@@ -134,10 +165,10 @@ Tear Down
 
 Delete Pods
     [Documentation]    Waits till the keyword delete status succeeds implying that all pods created have been deleted
-    ${lines} =    Utils.Run Command On Remote System    ${K8s_MASTER_IP}    kubectl get pods -o wide
-    @{lines} =    String.Split To Lines    ${lines}    1
-    : FOR    ${status}    IN    @{lines}
-    \    ${pod_name} =    BuiltIn.Should Match Regexp    ${status}    ^\\w+
+    ${get pods} =    Utils.Run Command On Remote System    ${K8s_MASTER_IP}    kubectl get pods -o wide
+    @{get pods} =    String.Split To Lines    ${get pods}    1
+    : FOR    ${status}    IN    @{get pods}
+    \    ${pod_name} =    BuiltIn.Should Match Regexp    ${status}    ^\\w+-\\w+
     \    Utils.Run Command On Remote System    ${K8s_MASTER_IP}    kubectl delete pods ${pod_name}
     BuiltIn.Wait Until Keyword Succeeds    60s    3s    Coe.Check If Pods Are Terminated
 
@@ -149,7 +180,7 @@ Check If Pods Are Terminated
 
 Dump Config File
     [Documentation]    Logs the configuration files present in all nodes
-    : FOR    ${nodes}    IN    @{NODE_IPs}
+    : FOR    ${nodes}    IN    @{TOOLS_SYSTEM_ALL_IPS}
     \    Utils.Run Command On Remote System And Log    ${nodes}    cat ${CONFIG_FILE}
 
 Stop Suite
@@ -162,23 +193,19 @@ Stop Suite
 
 Collect Watcher Log
     [Documentation]    Watcher running in background logs into watcher.out which is copied to ${JENKINS_WORKSPACE}/archives/watcher.log
-    SSHLibrary.Open Connection    ${K8s_MASTER_IP}
-    SSHKeywords.Flexible_SSH_Login    ${DEFAULT_USER}    ${DEFAULT_PASSWORD}
+    SSHLibrary.Switch Connection    ${TOOLS_SYSTEM_ALL_CONN_IDS[0]}
     SSHLibrary.Get File    /tmp/watcher.out    ${JENKINS_WORKSPACE}/archives/watcher.log
-    SSHLibrary.Close Connection
 
 Collect Journalctl Log
     [Documentation]    Logs of the command journalctl -u kubelet is copied to ${JENKINS_WORKSPACE}/archives/journal.log
     Utils.Run Command On Remote System And Log    ${K8s_MASTER_IP}    sudo journalctl -u kubelet > ${USER_HOME}/journal.txt
-    SSHLibrary.Open Connection    ${K8s_MASTER_IP}
-    SSHKeywords.Flexible_SSH_Login    ${DEFAULT_USER}    ${DEFAULT_PASSWORD}
+    SSHLibrary.Switch Connection    ${TOOLS_SYSTEM_ALL_CONN_IDS[0]}
     SSHLibrary.Get File    ${USER_HOME}/journal.txt    ${JENKINS_WORKSPACE}/archives/journalctl.log
-    SSHLibrary.Close Connection
 
 Stop Watcher
     [Documentation]    Kill the watcher running at the background after completion of tests cases
-    ${lines} =    Utils.Run Command On Remote System    ${K8s_MASTER_IP}    ps -ef | grep watcher
-    ${line}    ${pid} =    BuiltIn.Should Match Regexp    ${lines}    \\w+\\s+(\\d+).*watcher odl
+    ${watcher status} =    Utils.Run Command On Remote System    ${K8s_MASTER_IP}    ps -ef | grep watcher
+    ${watcher}    ${pid} =    BuiltIn.Should Match Regexp    ${watcher status}    \\w+\\s+(\\d+).*watcher odl
     Utils.Run Command On Remote System    ${K8s_MASTER_IP}    kill -9 ${pid}
 
 Kube reset
@@ -199,40 +226,46 @@ Create Pods
 
 Collect Pod Names and Ping
     [Documentation]    This keyword collects the pod names and checks connectivity between each and every pod with respect to one another.
-    ${lines} =    Utils.Run Command On Remote System    ${K8s_MASTER_IP}    kubectl get pods -o wide
-    @{lines} =    String.Split To Lines    ${lines}    1
-    : FOR    ${status}    IN    @{lines}
-    \    ${pod_name} =    Builtin.Should Match Regexp    ${status}    ^\\w+
-    \    Ping Pods    ${pod_name}    @{lines}
+    SSHLibrary.Switch Connection    ${TOOLS_SYSTEM_ALL_CONN_IDS[0]}
+    ${get pods} =    Write Commands Until Expected Prompt    kubectl get pods -o wide    ${DEFAULT_LINUX_PROMPT_STRICT}
+    @{pod ips} =    String.Get Regexp Matches    ${get pods}    \\d+\\.\\d+\\.\\d+\\.\\d+
+    @{pod names} =    String.Get Regexp Matches    ${get pods}    ss\\w+-\\w+
+    : FOR    ${pod_name}    IN    @{pod names}
+    \    ${logs} =    Log Statements    ${pod ips}    ${pod names}    ${pod_name}
+    \    Ping Pods    ${pod_name}    ${pod ips}    ${logs}
+
+Log Statements
+    [Arguments]    ${pod ips}    ${pod names}    ${pod_name}
+    @{log statement} =    Create List
+    ${i} =    Set Variable    0
+    : FOR    ${pod_ip}    IN    @{pod ips}
+    \    ${ping statement}    Set Variable    Ping ${pod_name} and ${pod names[${i}]} : ${pod ip}
+    \    Append To List    ${log statement}    ${ping statement}
+    \    ${i} =    Evaluate    ${i}+1
+    [Return]    @{log statement}
 
 Ping Pods
-    [Arguments]    ${pod_name}    @{lines}
-    [Documentation]    Ping pods to check connectivity between them
-    : FOR    ${pod ip}    IN    @{lines}
-    \    ${status} =    Run Keyword And Return Status    Should Contain    ${pod ip}    ${pod_name}
-    \    BuiltIn.Continue For Loop If    ${status} == True
-    \    ${pod_ip} =    Builtin.Should Match Regexp    ${pod ip}    \\d+.\\d+.\\d+.\\d+
-    \    ${ping} =    Utils.Run Command On Remote System And Log    ${K8s_MASTER_IP}    kubectl exec -it ${pod_name} -- ping -c 3 ${pod_ip}
+    [Arguments]    ${pod_name}    ${pod ips}    ${logs}
+    ${i} =    Set Variable    0
+    : FOR    ${ping info}    IN    @{logs}
+    \    ${ping} =    Write Commands Until Expected Prompt    kubectl exec -it ${pod_name} -- ping -c 3 ${pod ips[${i}]}    ${DEFAULT_LINUX_PROMPT_STRICT}
+    \    BuiltIn.log    ${ping}
     \    Builtin.Should Match Regexp    ${ping}    ${PING_REGEXP}
-
-Coe Suite Setup
-    @{suite names}    Get Regexp Matches    ${SUITES}    coe\\/(\\w+).robot    1
-    @{suite names updated}    Create List
-    : FOR    ${suites}    IN    @{suite names}
-    \    ${suites}    Replace String    ${suites}    _    ${SPACE}
-    \    Append To List    ${suite names updated}    ${suites}
-    ${first suite} =    Set Variable    ${suite names updated[0]}
-    ${line}    ${current suite}    Should Match Regexp    ${SUITE_NAME}    .txt.(\\w.*)
-    ${status} =    BuiltIn.Evaluate    '${first suite}' == '${current suite}'
-    Run Keyword If    '${status}' == 'True'    Coe.Start Suite
+    \    ${i}    Evaluate    ${i}+1
 
 Coe Suite Teardown
+    [Documentation]    COE project requires stop suite to be executed only for the last test suite.This keyword find the current suite,compares it with the stored last suite value and executes Coe.Stop suite only if the cuurent suite is equal to the last suite.
+    ${current suite}    ${suite names updated}    Extract current suite name
+    ${last_suite} =    Set Variable    ${suite names updated[-1]}
+    ${status} =    BuiltIn.Evaluate    '${last_suite}' == '${current suite}'
+    Run Keyword If    '${status}' == 'True'    Coe.Stop Suite
+
+Extract current suite name
+    [Documentation]    This keyword returns the name of current test suite.Appropriate replacement in text is done to make test suite names in SUITES and SUITE_NAME similar.
     @{suite names}    Get Regexp Matches    ${SUITES}    coe\\/(\\w+).robot    1
     @{suite names updated}    Create List
     : FOR    ${suites}    IN    @{suite names}
     \    ${suites}    Replace String    ${suites}    _    ${SPACE}
     \    Append To List    ${suite names updated}    ${suites}
-    ${last suite} =    Set Variable    ${suite names updated[-1]}
-    ${line}    ${current suite}    Should Match Regexp    ${SUITE_NAME}    .txt.(\\w.*)
-    ${status} =    BuiltIn.Evaluate    '${last suite}' == '${current suite}'
-    Run Keyword If    '${status}' == 'True'    Coe.Stop Suite
+    ${suite line}    ${current suite}    Should Match Regexp    ${SUITE_NAME}    .txt.(\\w.*)
+    [Return]    ${current suite}    ${suite names updated}
index c6baa98ace6c67337acf5db463e2e625603e835e..1d753734cf55a08522a33c34aae28f8a154e9d83 100644 (file)
@@ -10,3 +10,7 @@ scp ${WORKSPACE}/system-ovs-restart.sh ${TOOLS_SYSTEM_2_IP}:/tmp/
 ssh ${TOOLS_SYSTEM_2_IP} 'sudo bash /tmp/system-ovs-restart.sh'
 scp ${WORKSPACE}/system-ovs-restart.sh ${TOOLS_SYSTEM_3_IP}:/tmp/
 ssh ${TOOLS_SYSTEM_3_IP} 'sudo bash /tmp/system-ovs-restart.sh'
+scp ${WORKSPACE}/system-ovs-restart.sh ${TOOLS_SYSTEM_4_IP}:/tmp/
+ssh ${TOOLS_SYSTEM_4_IP} 'sudo bash /tmp/system-ovs-restart.sh'
+scp ${WORKSPACE}/system-ovs-restart.sh ${TOOLS_SYSTEM_5_IP}:/tmp/
+ssh ${TOOLS_SYSTEM_5_IP} 'sudo bash /tmp/system-ovs-restart.sh'
index 76703197cbef428b7336a98d4f6876f3d090b46e..681035f0e3418c0d5746a902e811eeda93146851 100644 (file)
@@ -13,14 +13,14 @@ Resource          ../../variables/netvirt/Variables.robot
 Resource          ../../variables/Variables.robot
 
 *** Variables ***
-@{BB_NAMES}       busybox1    busybox2    busybox3    busybox4
-@{BUSY_BOXES}     busy-box-1.yaml    busy-box-2.yaml    busy-box-3.yaml    busy-box-4.yaml
+@{POD_NAMES}      ss1-busybox1    ss1-busybox2    ss1-busybox3    ss2-busybox4
+@{POD_YAMLS}      busy-box-1.yaml    busy-box-2.yaml    busy-box-3.yaml    busy-box-4.yaml
 
 *** Test Cases ***
 Verify L2 Connectivity Between Pods
     [Documentation]    This testcase verifies the connectivity between pods brought up on the same node.Pods are brought on the same node by using the same node selector in busybox.yaml files.
-    Coe.Create Pods    ssd    ${BUSY_BOXES[0]}    ${BB_NAMES[0]}
-    Coe.Create Pods    ssd    ${BUSY_BOXES[1]}    ${BB_NAMES[1]}
+    Coe.Create Pods    ss1    ${POD_YAMLS[0]}    ${POD_NAMES[0]}
+    Coe.Create Pods    ss1    ${POD_YAMLS[1]}    ${POD_NAMES[1]}
     BuiltIn.Wait Until Keyword Succeeds    55s    2s    Coe.Check Pod Status Is Running
     Coe.Collect Pod Names and Ping
 
@@ -28,7 +28,7 @@ Verify L3 Connectivity Between Pods
     [Documentation]    This testcase verifies the connectivity between pods brought up on different nodes.Nodes are given different labels(eg : ssd,ssl) through Coe.Label Nodes keyword.
     ...    These labels are also inlcuded as node selectors in busybox.yaml files ,thus the pods are placed on the desired nodes avoiding random allocation of pods.
     ...    For the pod to be eligible to run on a node, the node must have each of the indicated key-value pairs as labels.
-    Coe.Create Pods    ssd    ${BUSY_BOXES[2]}    ${BB_NAMES[2]}
-    Coe.Create Pods    ssl    ${BUSY_BOXES[3]}    ${BB_NAMES[3]}
+    Coe.Create Pods    ss1    ${POD_YAMLS[2]}    ${POD_NAMES[2]}
+    Coe.Create Pods    ss2    ${POD_YAMLS[3]}    ${POD_NAMES[3]}
     BuiltIn.Wait Until Keyword Succeeds    55s    2s    Coe.Check Pod Status Is Running
     Coe.Collect Pod Names and Ping
index f63f84f5f9172e7549ac3bf3897e4dec0d3d2c07..7258bdc98f68fabd7688f1b8591f58331195bf65 100644 (file)
@@ -13,12 +13,21 @@ Resource          ../../variables/netvirt/Variables.robot
 Resource          ../../variables/Variables.robot
 
 *** Variables ***
-${NO_OF_PODS_PER_VM}    15
+${NO_OF_PODS_PER_VM}    9
 
 *** Test Cases ***
 Verify Connectivity Between Pods
-    : FOR    ${i}    IN RANGE    1    ${NO_OF_PODS_PER_VM}+1
-    \    Coe.Create Pods    ssd    busybox${i}.yaml    busybox${i}
-    \    Coe.Create Pods    ssl    pod${i}.yaml    pod${i}
+    Assign Labels
     BuiltIn.Wait Until Keyword Succeeds    55s    2s    Coe.Check Pod Status Is Running
     Coe.Collect Pod Names and Ping
+
+*** Keywords ***
+Apply label and Create pods
+    [Arguments]    ${label}
+    : FOR    ${i}    IN RANGE    1    ${NO_OF_PODS_PER_VM}+1
+    \    Coe.Create Pods    ${label}    ${label}-busybox${i}.yaml    ${label}-busybox${i}
+
+Assign Labels
+    : FOR    ${i}    IN RANGE    1    ${NUM_TOOLS_SYSTEM}
+    \    ${label} =    BuiltIn.Set Variable    ss${i}
+    \    Apply label and Create pods    ${label}
index a8771434e80ac1558d615b59dec3a177023fbbbb..53cccd449010e543bcd27ea5b029781131718cac 100644 (file)
@@ -1,6 +1,6 @@
 ---
 
-- hosts: coe-master:coe-minion1:coe-minion2
+- hosts: coe-hosts
   vars:
     gopath: "{{ ansible_env.HOME }}/go"
     coe_path: "{{ gopath }}/src/git.opendaylight.org/gerrit/p/coe.git"
@@ -83,7 +83,7 @@
         remote_src: true
       become: true
 
-- hosts: coe-master:coe-minion1:coe-minion2
+- hosts: coe-hosts
   tasks:
     - name: Set OVS Manager
       shell: ovs-vsctl set-manager tcp:{{ manager_ip }}:{{ manager_port }} && touch /tmp/ovs-set-manager
       args:
         creates: /tmp/watcher.out
 
-- hosts: coe-minion1:coe-minion2
+- hosts: coe-minions
   tasks:
     - name: Disable swapfile
       shell: swapoff -a
index 3feb87833316666b723da1484522306d13f4928a..f3cd2753e1c02801db049a1f0c7052e43ed07cbc 100644 (file)
@@ -15,35 +15,3 @@ coe-master:
     conf_path: filepath
     k8s_advertise_address: master_ip
     watcher_path: yamlpath
-
-coe-minion1:
-  hosts:
-    minion1_ip:
-  vars:
-    external_interface: enp0s9
-    overlay_ip: minion1_ip
-    external_ip: 192.168.50.12
-    subnet: 10.11.2.0/24
-    gateway: 10.11.2.1
-    manager_ip: odl_ip
-    manager_port: mport
-    controller_ip: odl_ip
-    controller_port: cport
-    go_version: \1.10.2\
-    conf_path: filepath
-
-coe-minion2:
-  hosts:
-    minion2_ip:
-  vars:
-    external_interface: enp0s9
-    overlay_ip: minion2_ip
-    external_ip: 192.168.50.13
-    subnet: 10.11.3.0/24
-    gateway: 10.11.3.1
-    manager_ip: odl_ip
-    manager_port: mport
-    controller_ip: odl_ip
-    controller_port: cport
-    go_version: \1.10.2\
-    conf_path: filepath
diff --git a/csit/variables/coe/minions_template.yaml b/csit/variables/coe/minions_template.yaml
new file mode 100644 (file)
index 0000000..eceb639
--- /dev/null
@@ -0,0 +1,15 @@
+coe-minion:
+  hosts:
+    minion_ip:
+  vars:
+    external_interface: enp0s9
+    overlay_ip: minion_ip
+    external_ip: 192.168.50.11
+    subnet: 10.11.1.0/24
+    gateway: 10.11.1.1
+    manager_ip: odl_ip
+    manager_port: mport
+    controller_ip: odl_ip
+    controller_port: cport
+    go_version: \1.10.2\
+    conf_path: filepath