cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [7/9] git commit: updated refs/heads/master to 143265c
Date Thu, 12 May 2016 15:06:56 GMT
travis: Use patched version of ipmitool for tests

- For out-of-band management feature (CLOUDSTACK-9299) use patched version of
  ipmitool that would work on trusty travis machines
- The ipmitool used is from xenial/16.04 release with patch from RedHat
  https://bugzilla.redhat.com/show_bug.cgi?id=1286035
- Installs ipmitool from xenial repositories to get all the dependencies
  and then install patched deb version
- Skip test if the known failure occurs

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4d5e8df2
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4d5e8df2
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4d5e8df2

Branch: refs/heads/master
Commit: 4d5e8df2f952c4e0594c8fc4d11181f6d3da3811
Parents: 0756446
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Fri May 6 05:52:07 2016 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu May 12 11:05:40 2016 +0530

----------------------------------------------------------------------
 developer/developer-prefill.sql                 |  2 +-
 setup/dev/advanced.cfg                          |  2 +-
 .../smoke/test_outofbandmanagement.py           | 19 ++++++++++++++++---
 tools/travis/before_install.sh                  | 20 ++++++++++++--------
 4 files changed, 30 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d5e8df2/developer/developer-prefill.sql
----------------------------------------------------------------------
diff --git a/developer/developer-prefill.sql b/developer/developer-prefill.sql
index ab3da96..132659e 100644
--- a/developer/developer-prefill.sql
+++ b/developer/developer-prefill.sql
@@ -116,7 +116,7 @@ INSERT INTO `cloud`.`configuration` (category, instance, component, name,
value)
 
 INSERT INTO `cloud`.`configuration` (category, instance, component, name, value)
             VALUES ('Advanced', 'DEFAULT', 'management-server',
-            'outofbandmanagement.sync.interval', '2000');
+            'outofbandmanagement.sync.interval', '1000');
 
 -- Enable dynamic RBAC by default for fresh deployments
 INSERT INTO `cloud`.`configuration` (category, instance, component, name, value)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d5e8df2/setup/dev/advanced.cfg
----------------------------------------------------------------------
diff --git a/setup/dev/advanced.cfg b/setup/dev/advanced.cfg
index 5e92028..48241fa 100644
--- a/setup/dev/advanced.cfg
+++ b/setup/dev/advanced.cfg
@@ -226,7 +226,7 @@
         },
         {
             "name": "outofbandmanagement.sync.interval",
-            "value": "2000"
+            "value": "1000"
         }
     ],
     "mgtSvr": [

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d5e8df2/test/integration/smoke/test_outofbandmanagement.py
----------------------------------------------------------------------
diff --git a/test/integration/smoke/test_outofbandmanagement.py b/test/integration/smoke/test_outofbandmanagement.py
index d1f9840..7c2aa6b 100644
--- a/test/integration/smoke/test_outofbandmanagement.py
+++ b/test/integration/smoke/test_outofbandmanagement.py
@@ -70,6 +70,7 @@ class TestOutOfBandManagement(cloudstackTestCase):
             if self.server:
                 self.server.shutdown()
                 self.server.server_close()
+                IpmiServerContext('reset')
         except Exception as e:
             raise Exception("Warning: Exception during cleanup : %s" % e)
 
@@ -143,7 +144,13 @@ class TestOutOfBandManagement(cloudstackTestCase):
         cmd.action = action
         if timeout:
             cmd.timeout = timeout
-        return self.apiclient.issueOutOfBandManagementPowerAction(cmd)
+
+        try:
+            return self.apiclient.issueOutOfBandManagementPowerAction(cmd)
+        except Exception as e:
+            if "packet session id 0x0 does not match active session" in str(e):
+                raise self.skipTest("Known ipmitool issue hit, skipping test")
+            raise e
 
 
     def configureAndEnableOobm(self):
@@ -166,8 +173,14 @@ class TestOutOfBandManagement(cloudstackTestCase):
 
 
     def checkSyncToState(self, state, interval):
-        self.debug("Waiting for background thread to update powerstate to " + state)
-        time.sleep(1 + int(interval)*2/1000) # interval is in ms
+        def checkForStateSync(expectedState):
+            response = self.getHost(hostId=self.getHost().id).outofbandmanagement
+            return response.powerstate == expectedState, None
+
+        sync_interval = 1 + int(interval)/1000
+        res, _ = wait_until(sync_interval, 10, checkForStateSync, state)
+        if not res:
+            self.fail("Failed to get host.powerstate synced to expected state:" + state)
         response = self.getHost(hostId=self.getHost().id).outofbandmanagement
         self.assertEqual(response.powerstate, state)
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4d5e8df2/tools/travis/before_install.sh
----------------------------------------------------------------------
diff --git a/tools/travis/before_install.sh b/tools/travis/before_install.sh
index b257e05..44ead5a 100755
--- a/tools/travis/before_install.sh
+++ b/tools/travis/before_install.sh
@@ -86,18 +86,22 @@ sudo service mysql restart
 echo -e "\nInstalling Development tools: "
 RETRY_COUNT=3
 
-sudo apt-get -q -y install uuid-runtime genisoimage netcat freeipmi-common freeipmi-tools
libfreeipmi12 > /dev/null
+sudo apt-get -q -y install uuid-runtime genisoimage netcat > /dev/null
 if [[ $? -ne 0 ]]; then
   echo -e "\napt-get packages failed to install"
 fi
 
-# We need version 1.8.15 or above, default installed version is buggy
-wget http://mirrors.kernel.org/ubuntu/pool/universe/i/ipmitool/ipmitool_1.8.15-1ubuntu1.1_amd64.deb
-O /tmp/ipmitool.deb
-if [[ $? -eq 0 ]]; then
-  sudo dpkg -i /tmp/ipmitool.deb
-  sudo apt-get install -f -y
-  ipmitool -V
-fi
+# Use latest ipmitool 1.8.16 dependencies
+sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1397BC53640DB551
+sudo sh -c 'echo "deb http://archive.ubuntu.com/ubuntu xenial main universe" >> /etc/apt/sources.list'
+sudo apt-get update -q -y > /dev/null
+sudo apt-get -q -y -V install freeipmi-common libfreeipmi16 libgcrypt20 libgpg-error-dev
libgpg-error0 libopenipmi0  --no-install-recommends > /dev/null
+
+# Installed version 1.8.16 with patch: https://bugzilla.redhat.com/show_bug.cgi?id=1286035
+wget http://packages.shapeblue.com/contribs/ipmitool_1.8.16_travis_amd64.deb -O ipmitool.deb
> /dev/null
+sudo dpkg -i ipmitool.deb
+
+ipmitool -V
 
 echo "<settings>
   <mirrors>


Mime
View raw message