From: Tomoki Sekiyama Date: Thu, 21 Aug 2014 15:13:54 +0000 (-0400) Subject: Revert test_rootwrap_filter to avoid python2.6 test failure X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=9dfc68b9ada43ac2798ba6613b6c66bc915be116;p=openstack-build%2Fcinder-build.git Revert test_rootwrap_filter to avoid python2.6 test failure With oslo.rootwrap 1.3.0.0a1 which has a bug #1340792, that some filter rules are dependent on its evaluation order, test_rootwrap_filter randomly fail for a patch adding to etc/cinder/rootwrap.d/volume.filters with python2.6, as evaluation order is randomly changes. The bug in oslo.rootwrap is fixed in master branch, but is not yet released and not available in CI. So this until new oslo.rootwrap is released, this patch reverts the unit test to avoid to block reviews. Change-Id: If86b6689ae36aa8810aad5b694ed43dfec1fd0c6 --- diff --git a/cinder/tests/test_rootwrap_filter.py b/cinder/tests/test_rootwrap_filter.py deleted file mode 100644 index 2fcbde316..000000000 --- a/cinder/tests/test_rootwrap_filter.py +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (c) 2014 Hitachi Data Systems, Inc. -# All Rights Reserved. -# -# Licensed 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. - -import os - -import mock -from oslo.rootwrap import wrapper - -from cinder import test - - -class RootwrapFilterTest(test.TestCase): - """Test cases for etc/cinder/rootwrap.d/volume.filters - """ - - def setUp(self): - super(RootwrapFilterTest, self).setUp() - self._filters = wrapper.load_filters(['etc/cinder/rootwrap.d/']) - - @mock.patch.object(os, 'access', return_value=True) - def _test_match(self, cmd, mock_access): - filtermatch = wrapper.match_filter(self._filters, cmd, - exec_dirs=['/usr/bin']) - self.assertIsNotNone(filtermatch) - - def test_ionice_filter(self): - self._test_match(['ionice', '-c3', 'dd', 'if=/aaa', 'of=/bbb']) - self._test_match(['ionice', '-c2', '-n7', 'dd', 'if=/aaa', 'of=/bbb', - 'bs=1M', 'count=1024', 'oflag=direct']) - self._test_match(['ionice', '-c1', 'dd', 'if=/aaa', 'of=/bbb', - 'iflag=direct']) - self._test_match(['ionice', '-c0', 'dd', 'if=/aaa', 'of=/bbb', - 'convert=datasync'])