Update distribution tests to Nitrogen 29/61629/3
authorVratko Polak <vrpolak@cisco.com>
Mon, 14 Aug 2017 17:16:54 +0000 (19:16 +0200)
committerVratko Polák <vrpolak@cisco.com>
Tue, 15 Aug 2017 08:18:37 +0000 (08:18 +0000)
Change-Id: I0378bf30f2974714ad3860d83e1df45506dad885
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
csit/libraries/distribution/StreamDistro.robot [new file with mode: 0644]
csit/suites/distribution/karaf_sequence_install.robot
csit/suites/distribution/size.robot

diff --git a/csit/libraries/distribution/StreamDistro.robot b/csit/libraries/distribution/StreamDistro.robot
new file mode 100644 (file)
index 0000000..93c0200
--- /dev/null
@@ -0,0 +1,23 @@
+*** Settings ***
+Documentation     Distribution testing: generate stream-dependent values.
+...
+...               Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
+...
+...               This program and the accompanying materials are made available under the
+...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
+...               and is available at http://www.eclipse.org/legal/epl-v10.html
+...
+...
+...               As newer ODL versions are released, some values evolve from previously hardcoded constants.
+...               This Resource contains keywords for optaining the correct value for currently testes stream.
+Library           Collections
+Resource          ${CURDIR}/../CompareStream.robot
+
+*** Keywords ***
+Compose_Zip_Filename_Prefix
+    [Documentation]    Return "karaf" if at least Nitrogen, else return "distribution-karaf".
+    BuiltIn.Run_Keyword_And_Return    CompareStream.Set_Variable_If_At_Least_Nitrogen    karaf    distribution-karaf
+
+Compose_Test_Feature_Repo_Name
+    [Documentation]    Return "features-test" if at least Nitrogen, else return "features-integration-test".
+    BuiltIn.Run_Keyword_And_Return    CompareStream.Set_Variable_If_At_Least_Nitrogen    features-test    features-integration-test
index cc4f273a22f70a017b5d8988f7c805334ca61e3b..2fd11f0c2c4220c450bfdc74c331096eedf36b65 100644 (file)
@@ -1,7 +1,7 @@
 *** Settings ***
 Documentation     Bug 4462 test suite.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...               Copyright (c) 2016-2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
 ...               This program and the accompanying materials are made available under the
 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -12,6 +12,7 @@ Documentation     Bug 4462 test suite.
 ...               list of features one by one. Default list is odl-integration-compatible-with-all.
 Suite Setup       SetupUtils.Setup_Utils_For_Setup_And_Teardown
 Default Tags      critical    distribution    features
+Resource          ${CURDIR}/../../libraries/distribution/StreamDistro.robot
 Resource          ${CURDIR}/../../libraries/ClusterManagement.robot
 Resource          ${CURDIR}/../../libraries/SetupUtils.robot
 Resource          ${CURDIR}/../../libraries/SSHKeywords.robot
@@ -27,9 +28,11 @@ ${FEATURE_INSTALL_TIMEOUT}    10m
 Install_Features_One_By_One
     [Documentation]    Try to install current list of features and check whether Karaf hangs on it or not (bug 4462).
     SSHKeywords.Open_Connection_To_ODL_System
-    ${actual_version}=    BuiltIn.Evaluate    '''${BUNDLEFOLDER}'''[len("distribution-karaf-"):]
-    SSHLibrary.Get_File    ${WORKSPACE}/${BUNDLEFOLDER}/system/org/opendaylight/integration/features-integration-test/${actual_version}/features-integration-test-${actual_version}-features.xml    features.xml
-    @{features}=    XML.Get_Elements_Texts    features.xml    .feature[@name="${FEATURES_LIST_NAME}"]/feature
+    ${filename_prefix} =    StreamDistro.Compose_Zip_Filename_Prefix
+    ${actual_version} =    BuiltIn.Evaluate    '''${BUNDLEFOLDER}'''[len("${filename_prefix}-"):]
+    ${features_test} =    StreamDistro.Compose_Test_Feature_Repo_Name
+    SSHLibrary.Get_File    ${WORKSPACE}/${BUNDLEFOLDER}/system/org/opendaylight/integration/${features_test}/${actual_version}/${features_test}-${actual_version}-features.xml    features.xml
+    @{features} =    XML.Get_Elements_Texts    features.xml    .feature[@name="${FEATURES_LIST_NAME}"]/feature
     Collections.Log_List    ${features}
     KarafKeywords.Open_Controller_Karaf_Console_With_Timeout    ${1}    ${FEATURE_INSTALL_TIMEOUT}
     : FOR    ${feature}    IN    @{features}
index 5cdbb2deb6bd3a6ed4e318a18b19b489f27683c7..879afa7b951106f4fa6cc032494f99401ee7cf83 100644 (file)
@@ -1,7 +1,7 @@
 *** Settings ***
 Documentation     Suite for testing ODL distribution zip file size.
 ...
-...               Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
+...               Copyright (c) 2016-2017 Cisco Systems, Inc. and others. All rights reserved.
 ...
 ...               This program and the accompanying materials are made available under the
 ...               terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -15,11 +15,11 @@ Suite Setup       SetupUtils.Setup_Utils_For_Setup_And_Teardown
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
 Default Tags      critical    distribution    size
+Resource          ${CURDIR}/../../libraries/distribution/StreamDistro.robot
 Resource          ${CURDIR}/../../libraries/SetupUtils.robot
 Resource          ${CURDIR}/../../libraries/SSHKeywords.robot
 
 *** Variables ***
-${BUNDLE_PREFIX}    distribution-karaf    # BUNDLEFOLDER may contain -SNAPSHOT part, which is not present in the archive name.
 ${BUNDLE_SUFFIX}    .zip
 ${DISTRIBUTION_SIZE_LIMIT}    469762048    # == 7 * 64 MiB, Nexus limit is 8 * 64 MiB.
 
@@ -27,8 +27,9 @@ ${DISTRIBUTION_SIZE_LIMIT}    469762048    # == 7 * 64 MiB, Nexus limit is 8 * 6
 Distribution_Size
     [Documentation]    Run "ls" on ODL_SYSTEM, parse file size and compare to ${DISTRIBUTION_SIZE_LIMIT}.
     SSHKeywords.Open_Connection_To_ODL_System
+    ${bundle_prefix} =    StreamDistro.Compose_Zip_Filename_Prefix
     # TODO: 'du -b' is shorter, but gives less info. Is that better than ls?
-    ${ls_output} =    SSHKeywords.Execute_Command_Should_Pass    command=bash -c 'ls -lAn ${WORKSPACE}/${BUNDLE_PREFIX}*${BUNDLE_SUFFIX}'
+    ${ls_output} =    SSHKeywords.Execute_Command_Should_Pass    command=bash -c 'ls -lAn ${WORKSPACE}/${bundle_prefix}*${BUNDLE_SUFFIX}'
     ${size} =    SSHKeywords.Execute_Command_Should_Pass    command=echo '${ls_output}' | cut -d ' ' -f 5
     # The following probably fails of there were multiple *.zip files listed.
     BuiltIn.Should_Be_True    ${size} < ${DISTRIBUTION_SIZE_LIMIT}    Distribution size ${size} is not smaller than limit ${DISTRIBUTION_SIZE_LIMIT}.