From: Vratko Polak Date: Mon, 14 Aug 2017 17:16:54 +0000 (+0200) Subject: Update distribution tests to Nitrogen X-Git-Tag: release/nitrogen~70 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;ds=sidebyside;h=708f644381480484338cde7273e4ad7bf79ba715;p=integration%2Ftest.git Update distribution tests to Nitrogen Change-Id: I0378bf30f2974714ad3860d83e1df45506dad885 Signed-off-by: Vratko Polak --- diff --git a/csit/libraries/distribution/StreamDistro.robot b/csit/libraries/distribution/StreamDistro.robot new file mode 100644 index 0000000000..93c020055f --- /dev/null +++ b/csit/libraries/distribution/StreamDistro.robot @@ -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 diff --git a/csit/suites/distribution/karaf_sequence_install.robot b/csit/suites/distribution/karaf_sequence_install.robot index cc4f273a22..2fd11f0c2c 100644 --- a/csit/suites/distribution/karaf_sequence_install.robot +++ b/csit/suites/distribution/karaf_sequence_install.robot @@ -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} diff --git a/csit/suites/distribution/size.robot b/csit/suites/distribution/size.robot index 5cdbb2deb6..879afa7b95 100644 --- a/csit/suites/distribution/size.robot +++ b/csit/suites/distribution/size.robot @@ -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}.