Update Robot Framework format - step 18
[integration/test.git] / tools / deployment / openstack_ha / libraries / OpenStackInstallUtils.robot
index ade7816cd654718c2ca309ddb2cbfb295d1e385f..4933dd5c229a2b27e06c66703e61eafad3ff1a33 100644 (file)
@@ -1,31 +1,49 @@
 *** Settings ***
-Documentation     Openstack library. This library is useful for tests to create network, subnet, router and vm instances
-Library           Collections
-Library           SSHLibrary
-Library           OperatingSystem
-Resource          SystemUtils.robot
-Resource          ../variables/Variables.robot
-Resource          ../variables/netvirt/Variables.robot
-Variables         ../variables/netvirt/Modules.py
+Documentation       Openstack library. This library is useful for tests to create network, subnet, router and vm instances
+
+Library             Collections
+Library             SSHLibrary
+Library             OperatingSystem
+Resource            SystemUtils.robot
+Resource            ../variables/Variables.robot
+Resource            ../variables/netvirt/Variables.robot
+Variables           ../variables/netvirt/Modules.py
+
 
 *** Keywords ***
 Setup Basic Ssh
-    [Arguments]    ${node_ip}    ${user_name}    ${password}    ${prompt}
     [Documentation]    Open SSh Connection and disable selinux
+    [Arguments]    ${node_ip}    ${user_name}    ${password}    ${prompt}
     ${connection}=    Get Ssh Connection    ${node_ip}    ${user_name}    ${password}    ${prompt}
     Disable SeLinux Tempororily    ${connection}
-    [Return]    ${connection}
+    RETURN    ${connection}
 
 Get All Ssh Connections
     [Documentation]    Open All SSH Connections.
-    Run Keyword If    0 < ${NUM_CONTROL_NODES}    Setup Basic Ssh    ${OS_CONTROL_1_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
-    Run Keyword If    2 < ${NUM_CONTROL_NODES}    Setup basic Ssh    ${OS_CONTROL_2_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
-    Run Keyword If    2 < ${NUM_CONTROL_NODES}    Setup basic Ssh    ${OS_CONTROL_3_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
-    Run Keyword If    3 < ${NUM_CONTROL_NODES}    Setup basic Ssh    ${OS_CONTROL_4_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
-    Run Keyword If    4 < ${NUM_CONTROL_NODES}    Setup basic Ssh    ${OS_CONTROL_5_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
-    Run Keyword If    2 < ${NUM_CONTROL_NODES}    Setup basic Ssh    ${HAPROXY_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
-    Run Keyword If    0 < ${NUM_COMPUTE_NODES}    Setup basic Ssh    ${OS_COMPUTE_1_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
-    Run Keyword If    1 < ${NUM_COMPUTE_NODES}    Setup basic Ssh    ${OS_COMPUTE_2_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
+    IF    0 < ${NUM_CONTROL_NODES}
+        Setup Basic Ssh    ${OS_CONTROL_1_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
+    END
+    IF    2 < ${NUM_CONTROL_NODES}
+        Setup basic Ssh    ${OS_CONTROL_2_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
+    END
+    IF    2 < ${NUM_CONTROL_NODES}
+        Setup basic Ssh    ${OS_CONTROL_3_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
+    END
+    IF    3 < ${NUM_CONTROL_NODES}
+        Setup basic Ssh    ${OS_CONTROL_4_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
+    END
+    IF    4 < ${NUM_CONTROL_NODES}
+        Setup basic Ssh    ${OS_CONTROL_5_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
+    END
+    IF    2 < ${NUM_CONTROL_NODES}
+        Setup basic Ssh    ${HAPROXY_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
+    END
+    IF    0 < ${NUM_COMPUTE_NODES}
+        Setup basic Ssh    ${OS_COMPUTE_1_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
+    END
+    IF    1 < ${NUM_COMPUTE_NODES}
+        Setup basic Ssh    ${OS_COMPUTE_2_IP}    ${OS_USER}    ${OS_USER_PASSWORD}    ${OS_NODE_PROMPT}
+    END
 
 Enable Live Migration In A Node
     [Arguments]    ${compute_cxn}
@@ -33,7 +51,12 @@ Enable Live Migration In A Node
     Crudini Edit    ${compute_cxn}    /etc/libvirt/libvirtd.conf    ''    listen_tls    0
     Crudini Edit    ${compute_cxn}    /etc/libvirt/libvirtd.conf    ''    listen_tcp    0
     Crudini Edit    ${compute_cxn}    /etc/libvirt/libvirtd.conf    ''    auth_tcp    '"none"'
-    Crudini Edit    ${compute_cxn}    /etc/nova/nova.conf    DEFAULT    instances_path    '/var/lib/nova/instances_live_migration'
+    Crudini Edit
+    ...    ${compute_cxn}
+    ...    /etc/nova/nova.conf
+    ...    DEFAULT
+    ...    instances_path
+    ...    '/var/lib/nova/instances_live_migration'
     Restart Service    ${compute_cxn}    openstack-nova-compute libvirtd
 
 Enable Live Migration In All Compute Nodes
@@ -48,6 +71,13 @@ Activate Control Node
     Enable Service    ${control_node_cxn}    httpd
     Start Service    ${control_node_cxn}    httpd
     Start Service    ${control_node_cxn}    openstack-glance-api openstack-glance-registry
-    Start Service    ${control_node_cxn}    openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.servi    ce openstack-nova-novncproxy.service
-    Run Command    ${os_node_cxn}    sudo ovs-vsctl set-manager tcp:${OS_CONTROL_1_IP}:6640 tcp:${OS_CONTROL_2_IP}:6640 tcp:${OS_CONTROL_3_IP}:6640 tcp:${OS_CONTROL_4_IP}:6640 tcp:${OS_CONTROL_5_IP}:6640
-    Start Service    ${control_node_cxn}    neutron-server.service neutron-dhcp-agent.service neutron-metadata-agent.service
+    Start Service
+    ...    ${control_node_cxn}
+    ...    openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.servi
+    ...    ce openstack-nova-novncproxy.service
+    Run Command
+    ...    ${os_node_cxn}
+    ...    sudo ovs-vsctl set-manager tcp:${OS_CONTROL_1_IP}:6640 tcp:${OS_CONTROL_2_IP}:6640 tcp:${OS_CONTROL_3_IP}:6640 tcp:${OS_CONTROL_4_IP}:6640 tcp:${OS_CONTROL_5_IP}:6640
+    Start Service
+    ...    ${control_node_cxn}
+    ...    neutron-server.service neutron-dhcp-agent.service neutron-metadata-agent.service