Test for Bug Netvirt-1080
[integration/test.git] / csit / suites / distribution / size.robot
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}.