浏览代码

AMBARI-1547. Fix ambari agent test cases that are failing due to missing directory. (mahadev)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1452178 13f79535-47bb-0310-9956-ffa450edef68
Mahadev Konar 12 年之前
父节点
当前提交
a590882345

+ 3 - 0
CHANGES.txt

@@ -712,6 +712,9 @@ Trunk (unreleased changes):
 
  AMBARI-1299. Bootstrap can hang indefinitely. (mahadev)
 
+ AMBARI-1547. Fix ambari agent test cases that are failing due to missing
+ directory. (mahadev)
+
 AMBARI-1.2.0 branch:
 
  INCOMPATIBLE CHANGES

+ 21 - 0
ambari-agent/src/main/upgrade_scripts/stub

@@ -0,0 +1,21 @@
+#!/usr/bin/env python2.6
+
+'''
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+'''
+
+Will be replaced with a real folder

+ 1 - 1
ambari-agent/src/test/python/TestActionQueue.py

@@ -136,7 +136,7 @@ class TestActionQueue(TestCase):
     self.assertTrue(executeCommand_method.called)
     self.assertEquals(queue.resultQueue.qsize(), 1)
     returned_result = queue.resultQueue.get()
-    self.assertIs(returned_result[1], result[0])
+    self.assertTrue(returned_result[1] is result[0])
 
 
   @patch.object(UpgradeExecutor, "perform_stack_upgrade")

+ 2 - 2
ambari-agent/src/test/python/TestUpgradeExecutor.py

@@ -51,7 +51,7 @@ class TestUpgradeExecutor(TestCase):
       'component' : 'HDFS'
     }
     result = executor.perform_stack_upgrade(command, 'tmpout', 'tmperr')
-    self.assertIn('matches current stack version', result['stdout'])
+    self.assertTrue('matches current stack version' in result['stdout'])
     self.assertFalse(write_stack_version_method.called)
     # Checking unsupported update
     write_stack_version_method.reset()
@@ -64,7 +64,7 @@ class TestUpgradeExecutor(TestCase):
     }
     isdir_method.return_value = False
     result = executor.perform_stack_upgrade(command, 'tmpout', 'tmperr')
-    self.assertIn('not supported', result['stderr'])
+    self.assertTrue('not supported' in result['stderr'])
     self.assertFalse(write_stack_version_method.called)
     # Checking successful result
     write_stack_version_method.reset()