Refactor Is Feature Installed 29/66529/1
authorSam Hague <shague@redhat.com>
Fri, 15 Dec 2017 23:34:50 +0000 (18:34 -0500)
committerSam Hague <shague@redhat.com>
Fri, 15 Dec 2017 23:34:57 +0000 (18:34 -0500)
Removed the need to query the odl system by
using the CONTROLLERFEATURES parameter.

Change-Id: If438f98fcdac249cd2dd37f2532423bbbc93250d
Signed-off-by: Sam Hague <shague@redhat.com>
csit/libraries/OpenStackOperations.robot
csit/suites/openstack/connectivity/l2.robot
csit/suites/openstack/connectivity/l3.robot

index 7c85d9cf9a664a8a882b29a32277cf3b202ae196..48b14b75ef84c4172ce249284771329fcf2fae6e 100644 (file)
@@ -1209,3 +1209,10 @@ Copy DHCP Files From Control Node
     Get ControlNode Connection
     BuiltIn.Run Keyword And Ignore Error    SSHLibrary.Get Directory    /opt/stack/data/neutron/dhcp    ${dstdir}    recursive=True
     SSHLibrary.Close Connection
+
+Is Feature Installed
+    [Arguments]    ${features}=none
+    : FOR    ${feature}    IN    ${features}
+    \    ${status}    ${output}    Run Keyword And Ignore Error    Builtin.Should Contain    ${CFEATURES}    ${feature}
+    \    Return From Keyword If    "${status}" == "PASS"    True
+    [Return]    False
index 27e09f9505f12cb16c6fb5f4c6a8cba9bdf98b81..c38eac350e6350ff4fce58f62223ad26c78a6a21 100644 (file)
@@ -30,9 +30,7 @@ Create VLAN Network net_1
     [Documentation]    Create Network with neutron request.
     # in the case that the controller under test is using legacy netvirt features, vlan segmentation is not supported,
     # and we cannot create a vlan network. If those features are installed we will instead stick with vxlan.
-    : FOR    ${feature_name}    IN    @{legacy_feature_list}
-    \    ${feature_check_status} =    BuiltIn.Run Keyword And Return Status    KarafKeywords.Verify Feature Is Installed    ${feature_name}
-    \    Exit For Loop If    '${feature_check_status}' == 'True'
+    ${feature_check_status} =    OpenStackOperations.Is Feature Installed    ${legacy_feature_list}
     BuiltIn.Run Keyword If    '${feature_check_status}' == 'True'    OpenStackOperations.Create Network    @{NETWORKS}[0]
     ...    ELSE    OpenStackOperations.Create Network    @{NETWORKS}[0]    --provider-network-type vlan --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} --provider-segment ${NET_1_VLAN_ID}
 
index ac67148e8ac8017d2e9d243b9a8cff204fb26534..437b90656e0e3761f9859bc8bfd5d1ea9cf37a4c 100644 (file)
@@ -31,9 +31,7 @@ Create VLAN Network net_1
     [Documentation]    Create Network with neutron request.
     # in the case that the controller under test is using legacy netvirt features, vlan segmentation is not supported,
     # and we cannot create a vlan network. If those features are installed we will instead stick with vxlan.
-    : FOR    ${feature_name}    IN    @{legacy_feature_list}
-    \    ${feature_check_status} =    BuiltIn.Run Keyword And Return Status    KarafKeywords.Verify Feature Is Installed    ${feature_name}
-    \    Exit For Loop If    '${feature_check_status}' == 'True'
+    ${feature_check_status} =    OpenStackOperations.Is Feature Installed    ${legacy_feature_list}
     Run Keyword If    '${feature_check_status}' == 'True'    OpenStackOperations.Create Network    @{NETWORKS}[0]
     ...    ELSE    OpenStackOperations.Create Network    @{NETWORKS}[0]    --provider-network-type vlan --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} --provider-segment ${NET_1_VLAN_ID}