Add a suite for checking distribution size 89/46289/9
authorVratko Polak <vrpolak@cisco.com>
Thu, 13 Oct 2016 17:53:07 +0000 (19:53 +0200)
committerLuis Gomez <ecelgp@gmail.com>
Thu, 13 Oct 2016 19:53:23 +0000 (19:53 +0000)
Change-Id: I663497e33c6e7457d2204f3d6116f90ea25ebbda
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
csit/suites/distribution/size.robot [new file with mode: 0644]
csit/suites/distribution/version.robot
csit/testplans/distribution-userfeatures.txt

diff --git a/csit/suites/distribution/size.robot b/csit/suites/distribution/size.robot
new file mode 100644 (file)
index 0000000..5cdbb2d
--- /dev/null
@@ -0,0 +1,34 @@
+*** Settings ***
+Documentation     Suite for testing ODL distribution zip file size.
+...
+...               Copyright (c) 2016 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
+...
+...
+...               Variables needed to be rovided on pybot invocation:
+...               ${BUNDLEFOLDER} (directory name of ODL installation, as it is suffxed by the distribution version).
+...               This suite assumes the .zip file is stll present on ${ODL_SYSTEM_IP} in ${WORKSPACE} directory.
+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/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.
+
+*** Test Cases ***
+Distribution_Size
+    [Documentation]    Run "ls" on ODL_SYSTEM, parse file size and compare to ${DISTRIBUTION_SIZE_LIMIT}.
+    SSHKeywords.Open_Connection_To_ODL_System
+    # 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}'
+    ${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}.
index 8e74a02e2a270ecf904a08e7a6e51e4ca39510af..62875547bcf72d12201cf2e69df6c0db140ebb30 100644 (file)
@@ -18,10 +18,13 @@ Documentation     Suite for testing ODL distribution ability to report ist versi
 ...
 ...               This suite require both Restconf and Netconf-connector to be ready,
 ...               so it is recommended to run netconfready.robot before running this suite.
+...
+...               TODO: Figure out a way to reliably predict Odlparent version.
+...               Possibly, inspection of system/org/opendaylight/odlparent/ would be required.
 Suite Setup       Suite_Setup
 Test Setup        SetupUtils.Setup_Test_With_Logging_And_Without_Fast_Failing
 Test Teardown     SetupUtils.Teardown_Test_Show_Bugs_If_Test_Failed
-Default Tags      critical
+Default Tags      critical    distribution    version
 Resource          ${CURDIR}/../../libraries/TemplatedRequests.robot
 Resource          ${CURDIR}/../../libraries/SetupUtils.robot
 
index 56349db58336ca59f87cf85481eed986af17f7da..a549628524fb2d36b2ff8673d973583b87da8d9e 100644 (file)
@@ -1,9 +1,10 @@
-# Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+# Copyright (c) 2016 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
 
 # Place the suites in run order:
+integration/test/csit/suites/distribution/size.robot
 integration/test/csit/suites/netconf/ready/netconfready.robot
 integration/test/csit/suites/distribution/version.robot